How to read the response return by Asynchronous REST Call (ecc_queue)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 04:19 AM
Hi All,
Case: I am executing the Outbound REST call Asynchronous(executeAsync()) way. Now since it is aync call we may not guarantee for the response. I need to do some changes in servicenow table once the response is received. So how can i read the response once it is amiable. I do not want to use the esecute() method.
Thanks in Advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 05:49 AM
As per DOC, You need to provide wait seconds in response object post which you will have response data in response object.
refer below URL for example script.
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/app-store/dev_portal/API_reference/RESTMessageV2/reference/r_AsynchronousRESTMessageV2Example.html
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 06:11 AM
Thank Ahmmed,
Yes as per your suggestion i can use
response.waitForResponse(60)
but this this make the call synchronous only .
I should not want wait for response. Instead i am expecting something like notify or
or lister who will execute once i received the response from Aysnc call.
THANKS.