How to use Request Templates in API Gateway Websocket Integration?

0

I cannot get the Velocity RequestTemplates in my Websocket API integration to transform my input before sending my request to the integration.

Specifically I have created an AWS integration to Step Functions and need to transform the request to be {"input": { actual input }, "stateMachineArn": "arn of statemachine"}

I have tested with wscat specifying --header "Content-Type: application: json". My Request Template is mapped to "application/json". The CloudWatch logs for the Stage show the connection with the Content-Type header correct and also shows the routed request being routed properly. But the input before and after mapping is the same, so the Step Functions StartExecution call is returning 400.

Using the aws apigatewayv2 get-integrations I can confirm the RequestTemplates is set properly.

What is a simple of example of a Websocket API using RequestTemplates properly?

mjans71
asked a year ago94 views
No Answers

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