2

I am new in web development and trying to learn AWS. I have made a lambda function for listing. What I am doing here is I am showing listing, if I get counteId in params(URL) then it shows only data of that counter id else it shows all data. My lambda function was working fine. But I am having a problem while API integration.

this is how I am accessing pathparameters which are in the event

this is how I am configuring event

and this is my query and response

then I create an API gateway for it. this is what I did while creating Resource

/{proxy+} - ANY - Setup

I want to get only data of counterId 1, but I am getting whole data. response

My HTTPmethod is "ANY" and I choose lambda proxy integration in request integration. I don't know how to send path parameters. Kindly help me.

Reza Mousavi
  • 4,420
  • 5
  • 31
  • 48
ashraf Khan
  • 21
  • 1
  • 4
  • 1
    Hi, welcome to StackOverflow. Please edit your question so that as much of possible of the material is pasted in as text; screenshots make it hard for the community to help you. Thanks. – MandyShaw Aug 30 '18 at 19:03
  • @MandyShaw ok, i'll keep that in mind and will edit this post. ThanK you. – ashraf Khan Aug 31 '18 at 05:20

1 Answers1

1

You have to edit 'Mapping Template' in 'Integration Request' of you method properties in API Gateway.

You could find how to map it in API Gateway Mapping Template Reference article, in the 'Accessing the $input Variable' section.

Your template has to look like next:

{
    "name" : "$input.params('name')",
    "body" : $input.json('$') 
}

Check out more details in my answer to the similar question.

RredCat
  • 5,259
  • 5
  • 60
  • 100