Updated on 2022-02-21 GMT+08:00

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.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

POST

/v1.0/apigw/app-auths

Request

Table 2 Parameter description

Parameter

Mandatory

Type

Description

api_ids

Yes

Array of strings

List of API IDs

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

Table 3 Parameter description

Parameter

Type

Description

--

Dictionary

Authorization list

Table 4 Parameter description of the 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:

PROVIDER

CONSUMER

auth_result

String

Authorization result, which can be:

SUCCESS

SKIPPED

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

Table 5 Status codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

500

Server Internal Error