Authorizing Apps
Function
An app cannot access any APIs immediately after it is created. To access an API in an environment, first authorize the app to call the API.
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}/app-auths |
The following table lists the parameters in the URI.
|
Parameter |
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 |
|---|---|---|---|
|
api_ids |
Yes |
Array of strings |
List of API IDs You can select both self-developed and purchased APIs. |
|
app_ids |
Yes |
Array of strings |
List of app IDs |
|
env_id |
Yes |
String |
ID of the environment in which the apps will be authorized |
Example request:
{
"api_ids": ["5bbc47e2-95b0-4a56-904e-a3cdc422f8e9",
"6632a062-9dcf-4f18-9646-3cabb925a290"],
"app_ids": ["14b399ac-967f-4115-bb62-c0346b4537e9"],
"env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID"
}
Response
|
Parameter |
Type |
Description |
|---|---|---|
|
-- |
Dictionary |
Authorization list |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Authorization ID |
|
api_id |
String |
API ID |
|
app_id |
String |
App ID |
|
auth_time |
Timestamp |
Authorization time |
|
auth_role |
String |
Authorizer, which can be:
|
|
auth_result |
String |
Authorization result, which can be:
|
Example response:
[{
"id": "dffcaff92d144135a9f420fcd485bbf3",
"api_id": "8aa097b00e9843efabc9c593d11b769d",
"app_id": "f8c6ea15-0d1b-4c5b-bd4b-911610bd3b3e",
"auth_time": "2018-03-30T09:37:43.490197204Z",
"auth_role": "PROVIDER",
"auth_result": "SUCCESS"
}]
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
|
409 |
Conflict |
|
500 |
Server Internal Error |
Last Article: Querying the List of APIs Not Bound to an App
Next Article: Querying the List of APIs Bound to an App
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.