AWS API Gateway Proxy Payload Quick Reference

Input (event object)

{
 "resource":"/",
 "path":"/",
 "httpMethod":"POST",
 "headers":{
 "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
 "Accept-Encoding":"gzip, deflate, br",
 "Accept-Language":"en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4",
 "cache-control":"max-age=0",
 "CloudFront-Forwarded-Proto":"https",
 "CloudFront-Is-Desktop-Viewer":"true",
 "CloudFront-Is-Mobile-Viewer":"false",
 "CloudFront-Is-SmartTV-Viewer":"false",
 "CloudFront-Is-Tablet-Viewer":"false",
 "CloudFront-Viewer-Country":"GB",
 "content-type":"application/x-www-form-urlencoded",
 "Host":"j3ap25j034.execute-api.eu-west-2.amazonaws.com",
 "origin":"https://j3ap25j034.execute-api.eu-west-2.amazonaws.com",
 "Referer":"https://j3ap25j034.execute-api.eu-west-2.amazonaws.com/dev/",
 "upgrade-insecure-requests":"1",
 "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
 "Via":"2.0 a3650115c5e21e2b5d133ce84464bea3.cloudfront.net (CloudFront)",
 "X-Amz-Cf-Id":"0nDeiXnReyHYCkv8cc150MWCFCLFPbJoTs1mexDuKe2WJwK5ANgv2A==",
 "X-Amzn-Trace-Id":"Root=1-597079de-75fec8453f6fd4812414a4cd",
 "X-Forwarded-For":"50.129.117.14, 50.112.234.94",
 "X-Forwarded-Port":"443",
 "X-Forwarded-Proto":"https"
 },
 "queryStringParameters":null,
 "pathParameters":null,
 "stageVariables":null,
 "requestContext":{
 "path":"/dev/",
 "accountId":"125002137610",
 "resourceId":"qdolsr1yhk",
 "stage":"dev",
 "requestId":"0f2431a2-6d2f-11e7-b75152aa497861",
 "identity":{
 "cognitoIdentityPoolId":null,
 "accountId":null,
 "cognitoIdentityId":null,
 "caller":null,
 "apiKey":"",
 "sourceIp":"50.129.117.14",
 "accessKey":null,
 "cognitoAuthenticationType":null,
 "cognitoAuthenticationProvider":null,
 "userArn":null,
 "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
 "user":null
 },
 "resourcePath":"/",
 "httpMethod":"POST",
 "apiId":"j3azlsj0c4"
 },
 "body":"postcode=LS17FR",
 "isBase64Encoded":false
}

Output (response)

{
  "message": "Hello me!",
  "input": {
    "resource": "/{proxy+}",
    "path": "/hello/world",
    "httpMethod": "POST",
    "headers": {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "cache-control": "no-cache",
      "CloudFront-Forwarded-Proto": "https",
      "CloudFront-Is-Desktop-Viewer": "true",
      "CloudFront-Is-Mobile-Viewer": "false",
      "CloudFront-Is-SmartTV-Viewer": "false",
      "CloudFront-Is-Tablet-Viewer": "false",
      "CloudFront-Viewer-Country": "US",
      "Content-Type": "application/json",
      "headerName": "headerValue",
      "Host": "gy415nuibc.execute-api.us-east-1.amazonaws.com",
      "Postman-Token": "9f583ef0-ed83-4a38-aef3-eb9ce3f7a57f",
      "User-Agent": "PostmanRuntime/2.4.5",
      "Via": "1.1 d98420743a69852491bbdea73f7680bd.cloudfront.net (CloudFront)",
      "X-Amz-Cf-Id": "pn-PWIJc6thYnZm5P0NMgOUglL1DYtl0gdeJky8tqsg8iS_sgsKD1A==",
      "X-Forwarded-For": "54.240.196.186, 54.182.214.83",
      "X-Forwarded-Port": "443",
      "X-Forwarded-Proto": "https"
    },
    "queryStringParameters": {
      "name": "me"
    },
    "pathParameters": {
      "proxy": "hello/world"
    },
    "stageVariables": {
      "stageVariableName": "stageVariableValue"
    },
    "requestContext": {
      "accountId": "12345678912",
      "resourceId": "roq9wj",
      "stage": "testStage",
      "requestId": "deef4878-7910-11e6-8f14-25afc3e9ae33",
      "identity": {
        "cognitoIdentityPoolId": null,
        "accountId": null,
        "cognitoIdentityId": null,
        "caller": null,
        "apiKey": null,
        "sourceIp": "192.168.196.186",
        "cognitoAuthenticationType": null,
        "cognitoAuthenticationProvider": null,
        "userArn": null,
        "userAgent": "PostmanRuntime/2.4.5",
        "user": null
      },
      "resourcePath": "/{proxy+}",
      "httpMethod": "POST",
      "apiId": "gy415nuibc"
    },
    "body": "{\r\n\t\"a\": 1\r\n}",
    "isBase64Encoded": false
  }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s