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 do we pass field values from the response of an API call(s) to the next API call in a JSON?

amanmalakar007
New Contributor II
New Contributor II

Scenario :

We have a DisableAccountJSON where we make 3 API Calls named 'call1', 'call2' and 'call3'. We call these consecutively one after the other. The calling order is : call1 --> call2 --> call3.

When the first two calls are successful, we pass certain values from their response to 'call3'. We need these values in order to construct the 'url' and 'httpParams' fields in 'call3'.

Sample DisableAccountJSON (explaning the above scenario) :

 

{
    "call": [
        {
            "name": "call1",
            "url": "https://api.example1.com",
            "httpMethod": "PUT",
            "httpParams": "{\"param1\":\"value1\"}"
        },
        {
            "name": "call2",
            "url": "https://api.example2.com",
            "httpMethod": "POST",
            "httpParams": "{\"param2\":\"value2\"}"
        },
        {
            "name": "call3",
            "url": "https://api.example3.com/${responseFromCall1.someField}",
            "httpMethod": "PUT",
            "httpParams": "{\"param3\":\"${responseFromCall2.someField\"}"
        }
    ]
}

 

Question :

We need help with DisableAccountJSON, and design it such that we can pass the values of certain fields from the response of previous API calls (call1 and call2) to the next API call (call3).

We came across inputParams, dependentCall, keyField, listField and other similar JSON properties from the Saviynt Docs, but we are unable to understand how should we use them in our DisableAccountJSON. Would appreciate some help from the community.

Thanks in advance!

 

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

${response.call1.message.data}

data will be attribute name from response 1 

call1 is call name in previous call


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

Hi @rushikeshvartak ,

So, do we have to specify any other fields like inputParams / dependentCall / listField / keyField etc? Or can we directly refer to the field values from the previous call using the syntax which you showed above?

Direct without any additional attribute


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