Amazon API Gateway REST API Reference

model:generate-template

Generates a sample mapping template that can be used to transform a payload into the structure of a model.

HTTP Request

GET /restapis/<restapi_id>/models/<model_name>/default_template

Response

Template

Remarks

Example: Generate the sample template from a model

Request

GET /restapis/uojnr9hd57/models/output/default_template HTTP/1.1
Content-Type: application/json
Host: apigateway.us-east-1.amazonaws.com
X-Amz-Date: 20160614T202448Z
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": {
    "self": {
      "href": "/restapis/uojnr9hd57/models/output/default_template"
    }
  },
  "value": "#set($inputRoot = $input.path('$'))\n{\n  \"a\" : 3.1415,\n  \"b\" : 3.1415,\n  \"op\" : \"foo\",\n  \"c\" : 3.1415\n}"
}

See Also

AWS CLI