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

Binding an Access Control Policy to an API

Function

This API is used to bind an access control policy to a specified API.

You can bind different access control policies to an API in different environments, but you can bind only one type of access control policy to the API in each environment.

URI

The following table lists the HTTPS request method and URI of the API.

Table 1 HTTPS request method and URI

Request Method

URI

POST

/v1.0/apigw/acl-bindings

Request

Table 2 Parameter description

Parameter

Type

Description

acl_id

String

Access control policy ID

publish_ids

[]String

API publication record ID

Example request:

{
  "acl_id": "206bb985d8a04ec09f13c3e51ef77095",
  "publish_ids": [
    "1bc8b2b741a04bd4af3ef9d7cd003104"
  ]
}

Response

Table 3 Parameter description

Parameter

Type

Description

id

String

Binding ID

api_id

String

API ID

env_id

String

Environment ID

acl_id

String

Access control policy ID

create_time

Timestamp

Time when the access control policy is bound to the API

Example response:

[
  {
    "id": "4ffc0da71ddd4c22add8ff801e19846c",
    "api_id": "aebacac6095942b4b2dd2b209bb7b9bc",
    "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
    "acl_id": "206bb985d8a04ec09f13c3e51ef77095",
    "create_time": "2018-07-27T11:27:10.7470224Z"
  }
]

Status Codes

Table 4 Status codes

Status Code

Description

201

Created

400

Bad Request

403

Forbidden

404

Not Found

500

Server Internal Error