Search API key

Prev Next

Available in Classic and VPC

Enter query criteria in the request body to search for the corresponding API key information.

Request

The following describes the request format for the endpoint. The request format is as follows:

Method URI
POST /api-keys/search

Request headers

For headers common to API Gateway, see API Gateway common request headers.

Request syntax

The request syntax is as follows.

{
  "offset" : 0,
  "limit" : 0,
  "productId" : "productId",
  "apiKeyName" : "apiKeyName",
  "statusSet" : [ "statusSet" ]
}

Request body

The following describes the request body.

Field Type Required Description
offset Long Optional Starting point in the list of data to view
  • 0 - 9,223,372,036,854,775,807
limit Long Optional Number of data to view at once
  • 1 - 9,223,372,036,854,775,807
productId Long Required Product ID associated with the API key
  • 1 - 10
apiKeyName String Optional Filter by API key name
  • 0 - 20
statusSet Object Optional Filter by the status of the API key associated with the product
  • ACCEPTED | REJECTED | REQUEST | DENY | BLOCKED_REQUEST
    • ACCEPTED: approved
    • REJECTED: denied
    • REQUEST: requested
    • DENY: request denied
    • BLOCKED_REQUEST: request blocked

Request example

The following is a sample request.

curl -X POST 'https://apigateway.apigw.ntruss.com/api/v1/api-keys/search' \
--header 'Content-Type: application/json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
--data '{
  "offset" : 6,
  "productId": "*****xn0bk",
  "limit" : 1,
  "apiKeyName" : "apiKey-***",
  "statusSet" : [ "REQUEST" ]
}'

Response

The following describes the response format.

Response syntax

The syntax is as follows.

{
    "apiKeys": [
        {
            "apiKeyId": "apiKeyId",
            "apiKeyName": "apiKeyName",
            "apiKeyDescription": "apiKeyDescription",
            "status": "status"
        }
    ],
    "total": 0
}

Response status codes

For response status codes common to API Gateway, see API Gateway response status codes.

Response example

The following is a sample response.

{
    "apiKeys": [
        {
            "apiKeyId": "*****vg079",
            "apiKeyName": "apiKey-***",
            "apiKeyDescription": "apiKey-*** Description",
            "status": "ACCEPTED"
        }
    ],
    "total": 1
}