restapi:models
Gets an API's model collection represented by a Models instance.
HTTP Request
GET /restapis/<restapi_id>/models{?limit}
Template Variable
- limit: Optional.
The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Response
Remarks
The Models collection is created and contains two default models named Empty
and Error
when an API is created.
Example: Get the collection of models defined for an API
Request
The following example request retrieves the collection of models for an API:
GET /restapis/l9kujxkzq2/models HTTP/1.1
Content-Type: application/json
Host: apigateway.us-east-1.amazonaws.com
Content-Length: 60
X-Amz-Date: 20170223T172652Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20170223/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns the 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",
"name": "model",
"templated": true
},
"self": {
"href": "/restapis/l9kujxkzq2/models"
},
"item": [
{
"href": "/restapis/l9kujxkzq2/models/Empty?flatten=false"
},
{
"href": "/restapis/l9kujxkzq2/models/Error?flatten=false"
}
],
"model:by-name": {
"href": "/restapis/l9kujxkzq2/models/{model_name}?flatten=false",
"templated": true
}
},
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "/restapis/l9kujxkzq2/models/Empty?flatten=false"
},
"model:create": {
"href": "/restapis/l9kujxkzq2/models"
},
"model:delete": {
"href": "/restapis/l9kujxkzq2/models/Empty"
},
"model:generate-template": {
"href": "/restapis/l9kujxkzq2/models/Empty/default_template"
},
"model:update": {
"href": "/restapis/l9kujxkzq2/models/Empty"
}
},
"contentType": "application/json",
"description": "This is a default empty schema model",
"id": "71l0yh",
"name": "Empty",
"schema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Empty Schema\",\n \"type\" : \"object\"\n}"
},
{
"_links": {
"self": {
"href": "/restapis/l9kujxkzq2/models/Error?flatten=false"
},
"model:create": {
"href": "/restapis/l9kujxkzq2/models"
},
"model:delete": {
"href": "/restapis/l9kujxkzq2/models/Error"
},
"model:generate-template": {
"href": "/restapis/l9kujxkzq2/models/Error/default_template"
},
"model:update": {
"href": "/restapis/l9kujxkzq2/models/Error"
}
},
"contentType": "application/json",
"description": "This is a default error schema model",
"id": "sddpxt",
"name": "Error",
"schema": "{\n \"$schema\" : \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Error Schema\",\n \"type\" : \"object\",\n \"properties\" : {\n \"message\" : { \"type\" : \"string\" }\n }\n}"
}
]
}
}