By using AWS re:Post, you agree to the Terms of Use

Websocket API error: Execution failed due to configuration error: No match for output mapping and no default output mapping configured. Endpoint Response Status Code: 200


I have a websocket API connected to an HTTP API. $default works successfully, but $connect fails. I am configuring it without HTTP_PROXY and have the following request template:

{"connection-id": "$context.connectionId", "event-type": "$context.eventType"}

The request makes it to by backend which then replies with a 200 status code. The response is turned into a 500 error with the above error message appearing in the access logs.

Any suggestions? I've been working on this for two days and can't find an answer.


1 Answer

Looks like your integration response key mappings are missing in the Integration Response tab. Take a look at this document - particularly the below section. Either a $default mapping has to be present or a /2\d\d/ response key has to be present for the backend return code of 200 to be mapped back in the response.

**For non-proxy integrations, you must set up at least one integration response:

Ideally, one of your integration responses should act as a catch-all when no explicit choice can be made. This default case is represented by setting an integration response key of $default.

In all other cases, the integration response key functions as a regular expression. It should follow a format of "/expression/".

For non-proxy HTTP integrations:

API Gateway will attempt to match the HTTP status code of the backend response. The integration response key will function as a regular expression in this case. If a match cannot be found, then $default is chosen as the integration response.

The template selection expression, as described above, functions identically. For example:

/2\d\d/: Receive and transform successful responses

/4\d\d/: Receive and transform bad request errors

$default: Receive and transform all unexpected responses

For current limitations of template selection expressions, see Template selection expressions.**

profile picture
answered 18 days ago

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