Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/09/2024 06:17 AM
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
09/09/2024 06:20 AM
@Sampsa Refer the REST documentation, I think it should work. Also refer following thread which addresses similar needs
09/09/2024 07:13 AM
@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
]
}
}
]
}
09/09/2024 07:21 AM