Amazon API Gateway REST API Reference

apikey:by-key

Gets the ApiKey resource with the specified key identifier.

HTTP Request

GET /apikeys/{api_Key}{?includeValue}

Template Variable

Response

ApiKey

Remarks

With UsagePlans enabled, the ApiKey identifier and key value may be different. In either case, you must specify an key identifier when invoking this link-relation.

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:

Request

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

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

{
  "_links": {
    "curies": {
      "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-apikey-{rel}.html",
      "name": "apikey",
      "templated": true
    },
    "self": {
      "href": "/apikeys/hzYAVO9Sg98nsNh65VfX81M84O2kyXVy6K1xwHD7"
    },
    "apikey:delete": {
      "href": "/apikeys/hzYAVO9Sg98nsNh65VfX81M84O2kyXVy6K1xwHD7"
    },
    "apikey:update": {
      "href": "/apikeys/hzYAVO9Sg98nsNh65VfX81M84O2kyXVy6K1xwHD7"
    }
  },
  "createdDate": "2015-11-06T23:51:03Z",
  "enabled": true,
  "id": "hzYAVO9Sg98nsNh65VfX81M84O2kyXVy6K1xwHD7",
  "lastUpdatedDate": "2016-06-06T23:44:43Z",
  "name": "my_test_gateway_service",
  "stageKeys": [
    "h4ah70cvmb/beta",
    "fugvjdxtri/stage2"
  ]
}

See Also

AWS CLI