IdentityIQ REST API Response

Which IIQ version are you inquiring about?

8.4p1

Hi Team, We are calling a identityIQ workflow from REST API call below and in response we are getting a default response as below. my question is how to add error message or identity request ID to API response. thanks in advance any guidance in this regards would be greatly appreciated.

API Call:
http://localhost:8080/identityiq/rest/workflows/workflowName/launch
Response :

{
“status”: null,
“requestID”: “0a9c3f2097871ddb819787538232005f”,
“warnings”: null,
“errors”: null,
“retryWait”: 0,
“metaData”: null,
“attributes”: null,
“complete”: false,
“success”: false,
“retry”: false,
“failure”: false
}

Thanks,
Mahendra

Hi @kanwantm,

You can include additional details like the Identity Request ID or custom error messages in the REST API response by setting them in the workflow’s context attributes.

Just add a script step in your workflow that looks like this:

<Step name="SetResponseData">
    <Script>
        <![CDATA[
        Map attrs = context.getAttributes();
        attrs.put("identityRequestId", request.getId());
        attrs.put("errorMessage", "Provisioning failed due to XYZ reason");
        context.setAttributes(attrs);
        ]]>
    </Script>
</Step>

Once this is in place, the values will be returned in the attributes section of the API response.

1 Like

@kanwantm did you declared the variable as output=“true” ? that will solve ur problem. also
in case of error or validation just set like below.

wfcontext.getWorkflowCase().addMessage(new Message(Message.Type.Error, "Error message", null));

this will directly return as output.  you don't need to do any calculation in steps. 

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.