SerializationException Start of structure or map found where not expected API Gateway to Step function

0 votes

I am using the standard blog tutorial on integrating api gateway with step functions from here:https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html

My step function expects the following output:

{
   "My_params":
   {
      "Config": "Config_value"
   }
}

the Request body needed to do a post request as mentioned in the blog is:

{
  "input": "{}",
  "name": "MyExecution",
  "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld"
}

I am passing my required input like this:

{
   "input":
   {
      "my_params":
      {
         "config": "config_value"
      }
   },
   "name": "MyExecution",
   "stateMachineArn": "my-arn"
}

However, I am continuously getting following error:

{
   "__type": "com.amazon.coral.service#SerializationException",
   "Message": "Start of structure or map found where not expected."
}

Can someone tell me what exactly is the problem here? What am I doing wrong here? Quick help appreciated.

Aug 29, 2018 in AWS by bug_seeker
• 15,520 points
13,029 views

1 answer to this question.

0 votes

Use escape character for your parameters as follows

{ "input": "{ \"my_params\": { \"config\": \"config_value\" } }", "name": "MyExecution", "stateMachineArn": "my-arn" }

answered Aug 29, 2018 by Priyaj
• 58,090 points

Related Questions In AWS

0 votes
1 answer

How to get API Gateway function output from a step-function

First of all the step functions executes ...READ MORE

answered Dec 27, 2018 in AWS by Archana
• 5,640 points
3,736 views
0 votes
1 answer

How to make API Gateway accept http instead of https?

You can put a Cloudfront distribution in ...READ MORE

answered Aug 21, 2018 in AWS by Archana
• 4,170 points
1,694 views
+2 votes
3 answers
0 votes
1 answer
0 votes
1 answer
+1 vote
3 answers

Not able to pass params POST to AWS Lambda from Amazon API Gateway

For this template : application/x-www-form-urlencoded  This line below will ...READ MORE

answered Jun 13, 2018 in AWS by Cloud gunner
• 4,670 points
8,375 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP