All Products
Search
Document Center

API Gateway:GetConsumerAuthorizationRule

Last Updated:Dec 17, 2025

Obtains a consumer authentication rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:GetConsumerAuthorizationRulenone
*Domain
acs:apig:{#regionId}:{#accountId}:consumer/{#ConsumerId}
    none
none

Request syntax

GET /v1/consumers/{consumerId}/authorization-rules/{consumerAuthorizationRuleId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
consumerAuthorizationRuleIdstringNo

Filters the list of operations by a specific consumer authorization rule ID. Only authorized operations are returned in the response.

car-ctgdn8em1hko5krqq03g
consumerIdstringNo

The consumer ID.

cs-ctgdn2um1hkossul8gvg

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

The request ID.

53102737-1E4E-5A8B-8E0A-4184B0959B84
consumerIdstring

The consumer ID.

cs-ctgdn2um1hkossul8gvg
consumerAuthorizationRuleIdstring

Filters the list of operations by a specific consumer authorization rule ID. Only authorized operations are returned in the response.

car-ctgdn8em1hko5krqq03g
apiInfoHttpApiApiInfo

The API information.

environmentInfoEnvironmentInfo

The environment information.

gatewayInfoGatewayInfo

The gateway information.

resourceTypestring

The resource type.

API
expireStatusstring

The rule status.

true
expireModestring

The expiry mode. Valid values: LongTerm and ShortTerm.

LongTerm
expireTimestamplong

The expiration time.

1750852089975
createTimestamplong

The creation timestamp. Unit: milliseconds.

1750852089975
updateTimestamplong

The update timestamp. Unit: milliseconds.

1750852089975
deployStatusstring

The publishing status of the API in the current environment.

""

Examples

Sample success responses

JSONformat

{
  "requestId": "53102737-1E4E-5A8B-8E0A-4184B0959B84",
  "consumerId": "cs-ctgdn2um1hkossul8gvg",
  "consumerAuthorizationRuleId": "car-ctgdn8em1hko5krqq03g",
  "apiInfo": {
    "httpApiId": "api-xxx",
    "name": "test",
    "protocols": [
      "HTTP"
    ],
    "basePath": "/v1",
    "description": "for test only",
    "versionInfo": {
      "enable": true,
      "scheme": "Query",
      "headerName": "my-version",
      "queryName": "myVersion",
      "version": "v1"
    },
    "environments": [
      {
        "environmentId": "env-xxx",
        "backendScene": "SingleService",
        "backendType": "Service",
        "serviceConfigs": [
          {
            "gatewayServiceId": "gs-xxx",
            "name": "demo-service",
            "protocol": "HTTP",
            "port": 8080,
            "weight": 100,
            "version": "v1",
            "match": {
              "default": true,
              "conditions": [
                {
                  "type": "Query",
                  "key": "color",
                  "value": "gray",
                  "operator": "equal"
                }
              ]
            },
            "serviceId": "svc-xxx"
          }
        ],
        "customDomains": [
          {
            "domainId": "d-xxx",
            "name": "www.example.com",
            "protocol": "HTTP"
          }
        ],
        "name": "test",
        "alias": "test",
        "gatewayInfo": {
          "gatewayId": "gw-xxx",
          "name": "test"
        },
        "deployStatus": "Deployed",
        "subDomains": [
          {
            "domainId": "d-xxx",
            "name": "www.example.com",
            "protocol": "HTTP",
            "networkType": "Internet"
          }
        ]
      }
    ],
    "ingressInfo": {
      "sourceId": "src-xxx",
      "ingressClass": "mse",
      "watchNamespace": "default",
      "environmentInfo": {
        "environmentId": "env-xxx"
      },
      "k8sClusterInfo": {
        "clusterId": "ca435c77cba1547cca9311957bcxxxxxx"
      },
      "overrideIngressIp": true
    },
    "type": "Rest",
    "resourceGroupId": "rg-xxx",
    "aiProtocols": [
      "OpenAI/v1"
    ],
    "deployConfigs": [
      {
        "customDomainIds": [
          "d-xxx"
        ],
        "environmentId": "env-xxx",
        "backendScene": "SingleService",
        "serviceConfigs": [
          {
            "serviceId": "svc-xxx",
            "weight": 100,
            "modelNamePattern": "qwen-*",
            "modelName": "qwen-max"
          }
        ],
        "policyConfigs": [
          {
            "type": "AiFallback",
            "enable": true,
            "aiFallbackConfig": {
              "serviceIds": [
                "svc-xxx"
              ]
            }
          }
        ],
        "autoDeploy": true
      }
    ],
    "enabelAuth": true,
    "authConfig": {
      "authType": "Jwt",
      "authMode": "NoAuth"
    }
  },
  "environmentInfo": {
    "environmentId": "env-cq7l5s5lhtgi6qasrdc0",
    "name": "test",
    "alias": "test-env",
    "description": "This is a test environment.",
    "gatewayInfo": {
      "gatewayId": "gw-cq7og15lhtgi6qasrj60",
      "name": "apitest-gw",
      "vpcInfo": {
        "vpcId": "vpc-uf664nyle5kh***",
        "name": "test-vpc"
      },
      "engineVersion": "2.0.7"
    },
    "subDomainInfos": [
      {
        "domainId": "d-cpudb0llhtgl2djvq2sg",
        "name": "abc.com",
        "protocol": "HTTP",
        "networkType": "Intranet"
      }
    ],
    "default": false,
    "createTimestamp": 1721116090326,
    "updateTimestamp": 1721116090326,
    "resourceGroupId": "rg-xxxx"
  },
  "gatewayInfo": {
    "gatewayId": "gw-cq7og15lhtgi6qasrj60",
    "name": "apitest-gw",
    "vpcInfo": {
      "vpcId": "vpc-uf664nyle5kh***",
      "name": "test-vpc"
    },
    "engineVersion": "2.0.7"
  },
  "resourceType": "API",
  "expireStatus": true,
  "expireMode": "LongTerm",
  "expireTimestamp": 1750852089975,
  "createTimestamp": 1750852089975,
  "updateTimestamp": 1750852089975,
  "deployStatus": ""
}

Error codes

For a list of error codes, visit the Service error codes.