Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/24/2024 03:09 PM - edited 09/24/2024 03:10 PM
Hi,
In the developer's documentation it states the below:
retryWaitSeconds - Use this attribute to specify the sleep time interval between the two blocks of calls, so that the dependent second call is processed after completing the calls in the first block.
How do I define two blocks of calls in createticketjson as the retryWaitSeconds is not working when added to connectionjson for SNOW REST connection.
I currently have below, I need a delay between each call, in particular submit_order needs to wait a number of seconds after order_now adds the item to the SNOW cart.
{
"ticketidPath": "call3.message.result.request_number",
"cartidPath": "call2.message.result.cart_id",
"usersysidPath": "call1.message.result.sys_id",
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "userAuth",
"url": "https://xxx.service-now.com/api/now/table/sys_user?sysparm_query=user_name%3D${user.username}&syspar...",
"httpMethod": "GET",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
403,
409,
412
]
}
},
{
"name": "call2",
"callOrder": 1,
"connection": "${response.call1.message.result[0].size() == 0 ? '' : 'userAuth'}",
"url": "${(task.tasktype==3 || task.tasktype==6) ? 'https://xxx.service-now.com/api/sn_sc/servicecatalog/items/498cb9f3e0e206000f720ccf56a5bb52/order_no...' : 'https://xxx.service-now.com/api/sn_sc/servicecatalog/items/0c9883e4db8d79504775be32f3961954/order_no...'}",
"httpMethod": "POST",
"httpParams": "{\"sysparm_quantity\":\"1\",\"variables\":{\"SomeoneElse\":\"Someone Else\",\"RequestedFor\":\"${response.call1.message.result[0].sys_id}\",\"sysparm_requested_for\":\"${response.call1.message.result[0].sys_id}\",\"action\":\"${(task.tasktype==3 || task.tasktype==6) ?'Request access':''}\",\"Software_PC_Serial\":\"${(task.tasktype==3 || task.tasktype==6) ? 'NA' : ''}\",\"Short Description\":\"${(task.tasktype==3 || task.tasktype==6) ? 'HR21 Kiosk':''}\",\"TellUsAbout\":\"${(task.tasktype==3 || task.tasktype==6) ?'Automatically raised by Saviynt Joiner workflow' : 'Automatically raised by Saviynt Leaver workflow'}\",\"UserAccountManagement_workflow\":\"${(task.tasktype==3 || task.tasktype==6) ? '' : 'pre_delete'}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"message": "",
"statusCode": [
500,
400,
401
]
}
},
{
"name": "call3",
"callOrder": 2,
"connection": "${response.call1.message.result[0].size() == 0 ? '' : 'userAuth'}",
"url": "https://xxx.service-now.com/api/sn_sc/servicecatalog/cart/submit_order",
"httpMethod": "POST",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
400,
401
]
}
}
]
}
This is comms from Servicenow Support:
The submit_order API calls should have at least 3 secs of time interval to avoid this scenario of duplicate requests being created for the same user. Which will eventually help servicenow to pass the checks points (if any), process the existing submit_cart API call in progress before another submit_cart API call being made.
TIA Huddos
09/24/2024 06:10 PM - edited 09/24/2024 06:13 PM
@Huddos
You can introduce the below configuration to the limit; It's only supported in seconds.
"apiRateLimitConfig": { "retryAfterCalls": 60, "retryWaitSeconds": 30 }
09/24/2024 07:17 PM
retryWaitSeconds needs to be added in ConfigJSON
{
"apiRateLimitConfig": {
"maxApiCapacityPercentage": 70,
"maxRefreshTryCount": 5,
"retryWaitSeconds": 8
}
}
https://docs.saviyntcloud.com/bundle/Okta-v24x/page/Content/Creating-an-integration.htm
09/24/2024 07:53 PM
Hi Rushikesh,
From my understanding and commentary in forums that was only for OKTA and not for REST, has that changed? And why does the dev handbook say use to delay between blocks of calls?
thanks
09/24/2024 09:24 PM
Hi @Huddos , yes it works .. just add that in rest connection json