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,350 points
665 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
• 56,520 points

Related Questions In AWS

0 votes
1 answer
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,090 points
32 views
+2 votes
3 answers
0 votes
2 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,260 points
1,857 views