Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/12/2022 01:13 PM
Hi All,
We have a requirement for REST application integration where need perform a post call(Call1) to fetch some value then make an use of that value in subsequent post call (call2) and we wanted to perform both the call in createAccountJSON.
below is the JSON detail:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result[0].sys_id",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call2",
"connection": "userAuth",
"httpMethod": "POST",
"httpParams": "{\"sysparm_quantity\": \"1\",\"variables\": {\"u_requester\": \"${response.message.result[0].sys_id}\",\"u_on_behalf_of\": \"{response.message.result[0].sys_id}\",\"u_phone_number\": \"+91 9998877665\",\"u_location\":\"Bengaluru\",\"line_manager\":\"{response.message.result[0].sys_id}\",\"u_employee_zone\": \"55ccca0f1bfb00104aae202a2d4bcbb5\",\"action\": \"request_for_new_joiner\",\"first_name\": \"${user.firstname}\",\"last_name\": \"${user.lastname}\",\"line_managers_name\": \"${user.manager}\",\"line_managers_email_address\": \"${manager.email}\",\"employee_type\": \"non_abi_employee_external_user\",\"u_employee_designation\": \"white_collar\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.cart_id",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
Regards,
Ashish
Solved! Go to Solution.
04/12/2022 02:37 PM
Ashish,
Could you elaborate your question further,I'm not able to understand what exactly you are trying to do.
Regards,
Avinash Chhetri
04/12/2022 02:37 PM
Hi Avinash,
We are trying to call multiple Rest APIs in CreateticketJSON for ServiceNow Rest connection where the call1 response will be used by call2. so, chain them together in the createaccountjson is not working.
In the JOSN shared above u_requester attribute value I am trying to populate from call1.
Thanks,
Ashish
04/12/2022 02:37 PM
Ashish,
You can try using response.call1.message instead of response.message when retrieving the informaton in call2.
Regards,
Avinash Chhetri
04/12/2022 02:37 PM
Hi Avinash,
This works. Thanks for the solution.
Regards,
Ashish