Amazon API Gateway REST API Reference

method:integration

Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.

HTTP Request

GET /restapis/<restapi_id>/resources/<resource_id>/methods/<http_method>/integration

Remarks

Example:

Request

GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1
Content-Type: application/json
Host: apigateway.us-east-1.amazonaws.com
Content-Length: 117
X-Amz-Date: 20160613T213210Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/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-integration-{rel}.html&quot;,
        "name": "integration",
        "templated": true
      },
      {
        "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html&quot;,
        "name": "integrationresponse",
        "templated": true
      }
    ],
    "self": {
      "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration"
    },
    "integration:delete": {
      "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration"
    },
    "integration:responses": {
      "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200",
      "name": "200",
      "title": "200"
    },
    "integration:update": {
      "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration"
    },
    "integrationresponse:put": {
      "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}",
      "templated": true
    }
  },
  "cacheKeyParameters": [],
  "cacheNamespace": "0cjtch",
  "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole",
  "httpMethod": "POST",
  "passthroughBehavior": "WHEN_NO_MATCH",
  "requestTemplates": {
    "application/json": "{\n    \"a\":  \"$input.params('operand1')\",\n    \"b\":  \"$input.params('operand2')\", \n    \"op\": \"$input.params('operator')\"   \n}"
  },
  "type": "AWS",
  "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations",
  "_embedded": {
    "integration:responses": {
      "_links": {
        "self": {
          "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200",
          "name": "200",
          "title": "200"
        },
        "integrationresponse:delete": {
          "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200"
        },
        "integrationresponse:update": {
          "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200"
        }
      },
      "responseParameters": {
        "method.response.header.operator": "integration.response.body.op",
        "method.response.header.operand_2": "integration.response.body.b",
        "method.response.header.operand_1": "integration.response.body.a"
      },
      "responseTemplates": {
        "application/json": "#set($res = $input.path('$'))\n{\n    \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n  \"a\" : \"$res.a\",\n  \"b\" : \"$res.b\",\n  \"op\" : \"$res.op\",\n  \"c\" : \"$res.c\"\n}"
      },
      "selectionPattern": "",
      "statusCode": "200"
    }
  }
}

See Also

AWS CLI