Amazon API Gateway REST API Reference

usage:get

Gets the usage data of a usage plan in a specified time interval.

HTTP Request

GET /usageplans/<usageplanId>/usage{?keyId,startDate,endDate,limit}

Template Variable

Response

Usage

Remarks

Example

Request

The following example shows how to get the usage of a usage plan (as identified by q2hrol) between the required startDate and endDate values.

GET /usageplans/q2hrol/usage?startDate=2016-08-01&endDate=2016-08-04 HTTP/1.1
Content-Type: application/json
Host: apigateway.ap-southeast-1.amazonaws.com
Content-Length: 254
X-Amz-Date: 20160801T211516Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160801/ap-southeast-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sigv4_hash}
Response

A successful response returns a 200 OK status code with a payload containing the usage data.

{
  "_links": {
    "self": {
      "href": "/usageplans/q2hrol/usage?startDate=2016-08-01&endDate=2016-08-04"
    },
    "first": {
      "href": "/usageplans/q2hrol/usage?startDate=2016-08-01&endDate=2016-08-04"
    }
  },
  "endDate": "2016-08-04",
  "startDate": "2016-08-01",
  "usagePlanId": "q2hrol",
  "values": {
    "px1KW6TIqK6L8PfqZYR3R3rrFWSS74BB5qBazOJH": [
      [
        0,
        5000
      ],
      [
        0,
        5000
      ],
      [
        0,
        10
      ],
      [
        0,
        10
      ]
    ]
  }
}

See Also

Create and Use Usage Plans