[{"data":1,"prerenderedAt":40},["ShallowReactive",2],{"snippet-apigateway-sqs-integration-mapping-template":3},{"id":4,"title":5,"contributors":6,"description":8,"extension":9,"gitHub":10,"introBox":13,"languages":22,"meta":24,"resources":25,"services":26,"snippets":29,"stem":36,"tags":37,"type":38,"__hash__":39},"snippets\u002Fsnippets\u002Fapigateway-sqs-integration-mapping-template.json","Mapping template for API Gateway with SQS integration",[7],"content\u002Fcontributors\u002Fpallavi-bhat.json","Provides a mapping template for API Gateway and SQS integration","json",{"template":11},{"repoURL":12},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-snippets\u002Ftree\u002Fmain\u002Fapigateway-sqs-integration-mapping-template",{"headline":14,"text":15},"How it works",[16,17,18,19,20,21],"These snippets can be used to send and receive messages to an existing SQS queue.","When creating the integration, ensure to have the below configuration to use the mapping template:","1. For Path override the value must be given as '\u003CAWS account number>\u002F\u003CSQS Queue name>' ","2. The header 'Content-Type' should have the value 'application\u002Fx-www-form-urlencoded' (include the single quotes in the value)","3. IAM role with appropriate sns:publish IAM permission for sqs:publish and sqs:receive","4. Select the integration HTTP method as 'POST'",[23],"vtl",{},null,[27,28],"apigw","sqs",[30,33],{"title":31,"language":23,"code":32},"Use the following mapping template to send messages to SQS queue:","Action=SendMessage&MessageBody=$util.urlEncode($input.body)",{"title":34,"language":23,"code":35},"Use the following mapping template to poll for or retrieve messages from the specified queue:","Action=ReceiveMessage&MaxNumberOfMessages=10&WaitTimeSeconds=10","snippets\u002Fapigateway-sqs-integration-mapping-template",[],"Integration","uVH3ZfImq1ODAQVyhMCW67atXAqXATRqkk-SGyxk6lk",1792665262596]