Creating an App
Function
This API is used to create an app. An app is an identity for accessing an API. An app can call the APIs to which it has been authorized.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
|
Request Method |
URI |
|---|---|
|
POST |
/v1/{project_id}/apigw/instances/{instance_id}/apps |
The following table lists the parameters in the URI.
|
App name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID, which can be obtained by the administrator on the My Credentials page. |
|
instance_id |
Yes |
String |
Instance ID, which can be obtained from the dedicated gateway information on the API Gateway console. |
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
App name An app name consists of 3–64 characters, starting with a letter. Only letters, digits, and underscores (_) are allowed. |
|
remark |
No |
String |
Description of the app The description cannot exceed 255 characters. |
|
app_key |
No |
String |
AppKey An AppKey consists of 8–64 characters, starting with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed.
NOTE:
This parameter is available in some regions. |
|
app_secret |
No |
String |
AppSecret An AppSecret consists of 8–64 characters, starting with a letter or digit. Only letters, digits, and the following special characters are allowed: _-!@#$%
NOTE:
This parameter is available in some regions. |
{
"name": "app_001",
"remark": "first app",
"app_key": "app_key_sample",
"app_secret": "app_secret_sample"
}
Response
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
App ID |
|
name |
String |
App name |
|
status |
Integer |
App status |
|
app_key |
String |
AppKey |
|
app_secret |
String |
AppSecret |
|
creator |
String |
App creator, which can be:
|
|
register_time |
Timestamp |
Time when the app is registered |
|
remark |
String |
Description of the app |
|
update_time |
Timestamp |
Time when the app was last updated |
|
app_type |
String |
App type. The default value is apig. |
Example response:
{
"id": "14b399ac-967f-4115-bb62-c0346b4537e9",
"name": "app_001",
"status": 1,
"app_key": "d49b1cbf-cc81-4a5f-b2a0-61b568e376eb",
"app_secret": "******",
"creator": "USER",
"remark": "First app"
"register_time": "2017-12-28T12:26:54.2345858Z",
"update_time": "2017-12-28T12:26:54.2345858Z",
"app_type": "apig"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
500 |
Server Internal Error |
Last Article: Object Model
Next Article: Modifying an App
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.