Amazon API Gateway REST API Reference

model:by-name

Gets information about the Model of a specified name.

HTTP Request

GET /restapis/<restapi_id>/models/{model_name}{?flatten}

Template Variable

Response

Model

Remarks

Example: Retrieve a named Model resource representing an API data model

Request

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

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

{
  "_links": {
    "curies": {
      "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-model-{rel}.html&quot;,
      "name": "model",
      "templated": true
    },
    "self": {
      "href": "/restapis/uojnr9hd57/models/output?flatten=false"
    },
    "model:create": {
      "href": "/restapis/uojnr9hd57/models"
    },
    "model:delete": {
      "href": "/restapis/uojnr9hd57/models/output"
    },
    "model:generate-template": {
      "href": "/restapis/uojnr9hd57/models/output/default_template"
    },
    "model:update": {
      "href": "/restapis/uojnr9hd57/models/output"
    }
  },
  "contentType": "application/json",
  "id": "hkhn0z",
  "name": "output",
  "schema": "{\n\t\"title\": \"Calc output\",\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"a\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"b\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"op\": {\n\t\t\t\"description\": \"operations of +-*/\",\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"c\": {\n\t\t    \"type\": \"number\"\n\t\t}\n\t},\n\t\"required\": [\"a\", \"b\", \"op\"]\n}\n"
}

Notice that the schema property value is a JSON string, not a JSON object.

See Also

AWS CLI