CAN WE SEND JSON DATA FROM APIGATEWAY TO SQS WITHOUT PATHOVER RIDING ?

0

while create apigateway we override path by <accountId/sqs-queue-name> but is there any alternative for this ? I tried adding an IAM policy by giving action 'SendMessage' to sqs and added it to a role given to APIGateway. I used actionname as 'SendMessage' in apigateway but the data in json format is not getting into sqs-queue which actionname can be used to perform the operation of sending json into sqs from apigateway?

1 Answer
0

Hi,

Could you check that you have configure the request mapping template as follows? I also recommend that you take a look at the following Knowledge Center article, or the following blog, which describe how to carry out the integration between a REST API Gateway and Amazon SQS.

Action=SendMessage&MessageBody=$input.body

Updated: According to the following Knowledge Center article, if the AWS service API expects a resource path in the request, you should use the path override options, and the SendMessage operation requieres it. In contrast, Kinesis PutRecord or SNS Publish operations could use the action name, since they don't expect a resource path.

profile picture
EXPERT
answered 10 months ago
  • Yes, I did the same..

  • Can you give more information to help you find the solution?

  • Just compare integrating apigateway-sqs with integrating apigateway-firehose

    1. In apigateway-firehose we will choose action as 'PutRecord'
    2. In apigateway-sqs we will choose override path and set that as <accountid/sqs-name>(which is same as in the article you suggested) My doubt is that, if we can do the same in the case of apigateway-sqs as done in apigateway-firehose by selecting action name as 'SendMessage' instead of overriding path?
  • Hi,

    According to the following Knowledge Center article, if the AWS service API expects a resource path in the request, you should use the path override options, and the SendMessage operation requieres it. In contrast, Kinesis PutRecord or SNS Publish operations could use the action name, since they don't expect a resource path. I hope this helps you.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions