Amazon API Gateway REST API Reference

apikey:usageplans

Gets all the usage plans associated with the API key.

HTTP Request

GET /usageplans{?limit,keyId}

Template Variable

Response

UsagePlans

Remarks

Example

Request

The following example shows how to query available usage plans associated with an API key.

GET /usageplans?keyId=3JX4ISs7Ik23cDsgiaJdu6SiLffQpIsU7AyTMALs&keyType=API_KEY HTTP/1.1
Content-Type: application/json
Host: apigateway.{region}.amazonaws.com
X-Amz-Date: 20160801T201501Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160801/{region}/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sigV4_hash}

Response

The successful response returns a 200 OK response containing a payload similar to the following:

{
  "_links": {
    "curies": [
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-usage-{rel}.html",
        "name": "usage",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-usageplan-{rel}.html",
        "name": "usageplan",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-usageplankey-{rel}.html",
        "name": "usageplankey",
        "templated": true
      }
    ],
    "self": {
      "href": "/usageplans?keyId=3JX4ISs7Ik23cDsgiaJdu6SiLffQpIsU7AyTMALs&keyType=API_KEY"
    },
    "item": {
      "href": "/usageplans/ywbqww"
    },
    "usageplan:by-id": {
      "href": "/usageplans/{usageplanId}",
      "templated": true
    },
    "usageplan:create": {
      "href": "/usageplans"
    }
  },
  "_embedded": {
    "item": {
      "_links": {
        "self": {
          "href": "/usageplans/ywbqww"
        },
        "usage:get": {
          "href": "/usageplans/ywbqww/usage?startDate=2016-07-02&endDate=2016-08-01"
        },
        "usageplan:delete": {
          "href": "/usageplans/ywbqww"
        },
        "usageplan:update": {
          "href": "/usageplans/ywbqww"
        },
        "usageplan:usageplankeys": {
          "href": "/usageplans/ywbqww/keys"
        },
        "usageplankey:create": {
          "href": "/usageplans/ywbqww/keys"
        }
      },
      "apiStages": {
        "stage": "testStage",
        "apiId": "xbvxlpijch"
      },
      "description": "Plan A",
      "id": "ywbqww",
      "name": "Plan_A",
      "quota": {
        "period": "MONTH",
        "offset": 0,
        "limit": 1000
      },
      "throttle": {
        "rateLimit": 100,
        "burstLimit": 200
      }
    }
  }
}

See Also

UsagePlans