Amazon API Gateway REST API Reference

apigateway:api-keys

Gets the ApiKeys resource representing the set of ApiKey resources to identify clients for all of your APIs.

HTTP Request

GET /apikeys{?includeValues}

Template Variable

Response

ApiKeys

Remarks

Error Codes

The following exception may be thrown when the request fails.

  • UnauthorizedException
  • TooManyRequestsException
  • BadRequestException

For detailed error code information, including the corresponding HTTP Status Codes, see API Gateway Error Codes

Example: Retrieve API Keys of an Account

Request

The following example request retrieves the available API keys in the caller's AWS account.

GET /apikeys HTTP/1.1
Content-Type: application/json
Host: apigateway.us-east-1.amazonaws.com
X-Amz-Date: 20160601T180431Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160601/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response

A successful response returns the requested ApiKey resources that can be navigated to by following the linked item or examining the embedded item resource.

{
  "_links": {
    "curies": [
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-apikey-{rel}.html",
        "name": "apikey",
        "templated": true
      }
    ],
    "self": {
      "href": "/apikeys"
    },
    "apikey:by-key": {
      "href": "/apikeys/{api_Key}",
      "templated": true
    },
    "apikey:create": {
      "href": "/apikeys"
    },
    "apikey:delete": {
      "href": "/apikeys/{api_Key}",
      "templated": true
    },
    "item": {
      "href": "/apikeys/hzYAVO9Sg98nsNh45VfX81M84O2kyXVy6K1xwHD7"
    }
  },
  "_embedded": {
    "item": {
      "_links": {
        "self": {
          "href": "/apikeys/hzYAVO9Sg98nsNh45VfX81M84O2kyXVy6K1xwHD7"
        },
        "apikey:delete": {
          "href": "/apikeys/hzYAVO9Sg98nsNh45VfX81M84O2kyXVy6K1xwHD7"
        },
        "apikey:update": {
          "href": "/apikeys/hzYAVO9Sg98nsNh45VfX81M84O2kyXVy6K1xwHD7"
        }
      },
      "createdDate": "2015-11-06T23:51:03Z",
      "enabled": true,
      "id": "hzYAVO9Sg98nsNh45VfX81M84O2kyXVy6K1xwHD7",
      "lastUpdatedDate": "2016-01-26T20:05:38Z",
      "name": "my_test_gateway_service",
      "stageKeys": "h4ah70cvmb/beta"
    }
  }
}

See Also

Use an API Key, AWS CLI