cancel
Showing results for 
Search instead for 
Did you mean: 

Rest GET Poller

mbostrom_dtiq
New Contributor II

Hi all,
We are integrating SnapLogic with Zendesk. The Zendesk API creates a JSON job which tells the status of the job for various requests made to the API. However using the REST GET snap to get the JSON job runs too quickly and the job status is still “In Progress”. However I need to error handle an error after the job is completed and also alert on a success. How do we have SnapLogic wait and continue to try that job JSON URL until it gets a success or error? I see a Retry parameter on the snap but i think that is just for handling exceptions and the result is coming back ok. The Salesforce Poller snap handles this similarly but that is not available.

6 REPLIES 6

christwr
Contributor III

Have you tried using the Has Next and Next URL of the REST GET snap?

Seems like your Has Next expression could evaluate some part of the response to tell whether it was “in progress” and use the same URL again for the Next URL, with whatever delay you want for the Pagination interval.

i’ve tried it but for some reason its not working. here is the Rest Get:

image

It’s still going to the next step though even when the status = “queued”:
image

tlikarish
Employee
Employee

The way pagination works in the REST Get snap is to continue making HTTP requests while the Has next is true. So in your case, every 3 seconds it’ll continue to make a HTTP request use the $response.entity.job_status.url while the status is not completed. Each of those requests will pass the HTTP response to the downstream snaps even if the status was not completed. Would it be possible to add a filter after this snap that filters out the document if the status is not completed?

ok i tried adding a filter after the Rest Get but now its just stopping b/c no documents are going through. could it be something related to me “validating” the pipeline and not executing and maybe snaplogic is having a caching issue on the Has Next retries? i don’t observe the snap actually waiting and have tried the Pagination Interval at 30 seconds. would expect that snap to take longer but its cruising through quickly:

image

image

image