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
16,294 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,020 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
4,790 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
2,505 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
9,573 views
0 votes
1 answer

Due to Malformed Lambda proxy response my lambda function through API gateway fails

You can refer to the following documentation ...READ MORE

answered Nov 2, 2018 in AWS by Priyaj
• 58,020 points
6,088 views
    <