Amazon API Gateway REST API Reference

usageplan:usageplankeys

Gets the collection of UsagePlanKey resources added to associate specified API keys with the given usage plan.

HTTP Request

GET /usageplans/<usageplanId>/keys

Response

UsagePlanKeys

Remarks

Example

The following example gets all the UsagePlanKeys resources of a given UsagePlan (n371pt) to inspect the API keys associated with the usage plan.

Request
GET /usageplans/n371pt/keys HTTP/1.1
Content-Type: application/json
Host: apigateway.us-east-1.amazonaws.com
Content-Length: 58
X-Amz-Date: 20160805T185459Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160805/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sigv4_hash}
Response

The successful response returns a 200 OK status code and a payload similar to the following:

{
  "_links": {
    "self": {
      "href": "/usageplans/n371pt/keys"
    },
    "item": {
      "href": "/usageplans/n371pt/keys/4wj0d1lt91"
    }
  },
  "_embedded": {
    "item": {
      "_links": {
        "self": {
          "href": "/usageplans/n371pt/keys/4wj0d1lt91"
        }
      },
      "id": "4wj0d1lt91",
      "name": "MyApiKey",
      "type": "API_KEY"
    }
  }
}

In this example, only a single API key has been associated with the usage plan.

See Also

Create and Use Usage Plans