Amazon API Gateway REST API Reference

restapi:resources

Gets an API's resource collection as represented by a Resources instance.

HTTP Request

GET /restapis/<restapi_id>/resources{?limit,embed}

Template Variable

Response

Resources

Remarks

The Resources instance is the container of API resources. It is created and contains the root resource when the API is created.

Example: Get an API resource collection

Request

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

The successful (200 OK) response returns the API's Resources resource that also acts as the API's root resource. This root resource must be specified to create and manage child resources and HTTP methods on any resource.

{
  "_links": {
    "curies": [
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html&quot;,
        "name": "method",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-resource-{rel}.html&quot;,
        "name": "resource",
        "templated": true
      }
    ],
    "self": {
      "href": "/restapis/fugvjdxtri/resources"
    },
    "item": {
      "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2"
    },
    "resource:by-id": {
      "href": "/restapis/fugvjdxtri/resources/{resource_id}{?embed}",
      "templated": true
    },
    "resource:create": {
      "href": "/restapis/fugvjdxtri/resources/{parent_id}",
      "templated": true
    }
  },
  "_embedded": {
    "item": {
      "_links": {
        "self": {
          "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2"
        },
        "method:by-http-method": {
          "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/{http_method}",
          "templated": true
        },
        "method:put": {
          "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/{http_method}",
          "templated": true
        },
        "resource:create-child": {
          "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2"
        },
        "resource:update": {
          "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2"
        }
      },
      "id": "3kzxbg5sa2",
      "path": "/"
    }
  }
}

In this example, the API resource collection has only one item, the API root resource.

See Also

AWS CLI