When using the API Connector Close or Flow Control Return Raw cards to return a response body to the caller of an API Endpoint workflow, the response body is not returned.
- Workflows
- API Endpoint workflow
- API Connector Close card
- Flow Control Return Raw card
This will occur when the Close or Return Raw card is used within an If/Error or If/ElseIf card. In the following example, the API Endpoint flow gets a user ID from the request body payload and constructs a response object that should return the user's ID, status and department:
However, the following response is returned to the caller of the API Endpoint flow rather than the responseBody object that was passed to the Close card:
{ "statusCode": 200} To return the response body, move the Close card outside of the If/Error card and use Outputs to pass the response status and body to the Close card:
In this example, the response is returned to the caller of the API Endpoint flow:
{ "department": "Engineering", "status": "ACTIVE", "userId": "00urduzspHCdrPdL25d6"}