All Products
Document Center

Add an IP access control policy (AddIpControlPolicyItem)

Last Updated: Feb 25, 2018


Add a policy to an existing IP access control.

  • This function is intended for API providers.
  • Once you add a policy, it is immediately effective for all the APIs bound to it.
  • Each IP access control can have a maximum of 100 policies.

Request parameters

Parameter Type Required Description
Action String Yes Operation interface name, a required parameter, value: AddIpControlPolicyItem
IpControlId String Yes IP address access control ID, which identifies a unique IP access control policy
CidrIp String Yes IP addresses or IP address segments in the policy. If multiple IP addresses or IP address segments are input, they must be separated by a semicolon (;). A policy can contain a maximum of 10 IP addresses or IP address segments.
AppId String No ID of the application controlled by the policy. This parameter can be set only when the access control type is whitelist (IpControlType is ALLOW).
  • Only one application ID can be added each time.
  • If this parameter is left blank, the policy does not restrict specific application IDs.
  • If this parameter is set, the policy controls API calls based on both IP addresses and application IDs.
  • Note that if this parameter is set and the API security authentication mode is set to “No authentication”, all API calls are restricted.
  • If the policy is a blacklist (IpControlType is REFUSE) and this parameter is set, the API Gateway ignores this parameter and applies access control only to the specified IP addresses.

Response parameters

Parameter Type Description
RequestId String ID of the current request
PolicyItemId String Unique ID of the policy


Sample request

  2. &IpControlId=7ea91319a34d48a09b5c9c871d9768b1
  3. &CidrIp=;
  4. &AppId=1111111
  5. &<Public Request Parameters>

Sample response

XML format

  1. <CreateSignatureResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BZ004</RequestId>
  3. <PolicyItemId>P151617000829241</PolicyItemId>
  4. </CreateSignatureResponse>

JSON format

  1. {
  2. "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BZ004",
  3. "PolicyItemId":"P151617000829241"
  4. }