How to read the response return by Asynchronous REST Call (ecc_queue)

Rameswhar Nalaw
Tera Contributor

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 

2 REPLIES 2

Ahmmed Ali
Mega Sage

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

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

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.