Amazon API Gateway REST API Reference

restapi:by-id

Gets the RestApi resource with the specified identifier.

HTTP Request

GET /restapis/{restapi_id}

Template Variable

Response

RestApi

Remarks

Example

Request

The following example request retrieves an API identified by the specified API identifier (0n1anifwvf). You can obtain the API identifier by calling apigateway:rest-apis.

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

A successful (200 OK) response returns the requested RestApi resource in the payload:

{
  "_links": {
    "curies": [
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-authorizer-{rel}.html",
        "name": "authorizer",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-deployment-{rel}.html",
        "name": "deployment",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-model-{rel}.html",
        "name": "model",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-resource-{rel}.html",
        "name": "resource",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-restapi-{rel}.html",
        "name": "restapi",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-stage-{rel}.html",
        "name": "stage",
        "templated": true
      }
    ],
    "self": {
      "href": "/restapis/0n1anifwvf"
    },
    "authorizer:by-id": {
      "href": "/restapis/0n1anifwvf/authorizers/{authorizer_id}",
      "templated": true
    },
    "authorizer:create": {
      "href": "/restapis/0n1anifwvf/authorizers"
    },
    "deployment:by-id": {
      "href": "/restapis/0n1anifwvf/deployments/{deployment_id}{?embed}",
      "templated": true
    },
    "deployment:create": {
      "href": "/restapis/0n1anifwvf/deployments"
    },
    "model:by-name": {
      "href": "/restapis/0n1anifwvf/models/{model_name}?flatten=false",
      "templated": true
    },
    "model:create": {
      "href": "/restapis/0n1anifwvf/models"
    },
    "resource:by-id": {
      "href": "/restapis/0n1anifwvf/resources/{resource_id}{?embed}",
      "templated": true
    },
    "resource:create": {
      "href": "/restapis/0n1anifwvf/resources/ny9qrywoj2"
    },
    "restapi:authorizers": {
      "href": "/restapis/0n1anifwvf/authorizers"
    },
    "restapi:delete": {
      "href": "/restapis/0n1anifwvf"
    },
    "restapi:deployments": {
      "href": "/restapis/0n1anifwvf/deployments{?limit}",
      "templated": true
    },
    "restapi:models": {
      "href": "/restapis/0n1anifwvf/models"
    },
    "restapi:resources": {
      "href": "/restapis/0n1anifwvf/resources{?limit,embed}",
      "templated": true
    },
    "restapi:stages": {
      "href": "/restapis/0n1anifwvf/stages{?deployment_id}",
      "templated": true
    },
    "restapi:update": {
      "href": "/restapis/0n1anifwvf"
    },
    "stage:by-name": {
      "href": "/restapis/0n1anifwvf/stages/{stage_name}",
      "templated": true
    },
    "stage:create": {
      "href": "/restapis/0n1anifwvf/stages"
    }
  },
  "createdDate": "2016-04-05T19:58:27Z",
  "description": "Your first API with Amazon API Gateway. This is a sample API that integrates via HTTP with our demo Pet Store endpoints",
  "id": "0n1anifwvf",
  "name": "PetStore"
}

See Also

Creating an API, AWS CLI