Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

how to conditionally determine to execute a REST API Call or not?

alc
Regular Contributor
Regular Contributor

Hello 

In REST Connector, it support multiple API calls with call1, call2 and call3 etc.

In my case, call1 will be executed. but call2 and call3 execution should be depend on the response of call1. For example if call1.returnCode is 0 execute call2. but if call1.returnCode is 1, execute call3.

Any help please!

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

You can use callcondition or connection name logic

refer https://forums.saviynt.com/t5/identity-governance/make-second-call-depending-on-call1-response-messa...

https://forums.saviynt.com/t5/identity-governance/skip-the-service-now-ticket-creation-if-task-sourc...


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

alc
Regular Contributor
Regular Contributor

Hello Rushikesh,

Thank you very much! Really appreciate your prompt answer.

Now if I want to use a short variable to represent the response data of first API call, how should I do it?

For example, instead of using response.call1.message.data, use respVar?

Can I claim it with:

{

"respVar" : response.call1.message.data

}

You can try but it should come from response.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

alc
Regular Contributor
Regular Contributor

I see. in SOAP Connector, I can see this is defined. I am wondering if we can do same in REST Connector? Any idea?

"RESPONSEMAPPING": {
"errorCode": "Body.loginResponse.loginReturn.errorCode"
}