Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Making multiple REST calls in updateUserJSON

Sampsa
New Contributor III
New Contributor III

Hi,

Is it possible to make multiple REST calls within the same updateUserJSON for a single UpdateLogin task? We would need to first do a GET request and then use a value from the response in the next POST call. Can this be done and what is the correct structure of the json if it's possible?

Br,

Sampsa

3 REPLIES 3

mbh_it2
New Contributor III
New Contributor III

@Sampsa Refer the REST documentation, I think it should work. Also refer following thread which addresses similar needs 

https://forums.saviynt.com/t5/identity-governance/issue-while-calling-multiple-apis-for-update-accou...


Regards,
Mahesh

If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

stalluri
Valued Contributor II
Valued Contributor II

@Sampsa 
Below  is a working JSON for us.

{
    "call": [
        {
            "name": "call1",
            "connection": "userAuth",
            "url": "XXXXX",
            "httpMethod": "GET",
            "httpParams": "{}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    401,
                    404,
                    405,
                    500
                ]
            }
        },
        {
            "name": "call2",
            "connection": "userAuth",
            "url": "",
            "httpMethod": "$if(response.call1.message.value[0] != ''){POST}else{'PATCH'}",
            "httpParams": "{}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201,
                    204,
                    205
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    401,
                    404,
                    405,
                    500
                ]
            }
        },
        {
            "name": "call3",
            "connection": "userAuth",
            "url": "",
            "httpMethod": "$if(response.call2.message.value[1] != ''){PATCH}else{'POST'}",
            "httpParams": "{}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    200,
                    201,
                    204,
                    205
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    401,
                    404,
                    405,
                    500
                ]
            }
        }
    ]
}

Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/identity-governance/sav4sav-rest-connector-multiple-user-update-json-c...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.