<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Workflows Return Raw and Close Cards do not Return the Response Body to the Caller of an API Endpoint Workflow
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

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.

Applies To
  • Workflows
  • API Endpoint workflow
    • API Connector Close card
    • Flow Control Return Raw card
Cause

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:

CloseNotWorking 

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
}
 
Solution

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:

APICloseWorking 

In this example, the response is returned to the caller of the API Endpoint flow:
 

{
    "department": "Engineering",
    "status": "ACTIVE",
    "userId": "00urduzspHCdrPdL25d6"
}
 
When using nested If/Error and If/ElseIf cards, Outputs must be used on each card to return data to the outermost card so it can be passed to a Close or Return Raw card that sits outside of the nested If/Error and If/ElseIf cards.


Related References

Recommended content

Documentation
Return Raw
Documentation
Pause Raw
Loading
Workflows Return Raw and Close Cards do not Return the Response Body to the Caller of an API Endpoint Workflow