cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API Test For Completion

jhagist
New Contributor III

I have a pattern where I run a REST POST api call and then need to run a REST GET to see if the request has completed. I need to somehow loop back to run the REST GET again if it isn’t done.

Recommendations on how to handle this pattern?

1 ACCEPTED SOLUTION

jhagist
New Contributor III

Incredible. It was right in front of me all along. 😎

So here are the pictures.

This is the API response. (in this case I need status = success. It tells me I can go get the data)

image

This is how I set up the Rest GET Snap. I have Has next set to try again if status <> success.

image

Hopefully this won’t be as painful for you as it was for me!!

View solution in original post

12 REPLIES 12

SandeepVemula
Contributor

Use REST Get in a Child Pipeline and Call it Via Pipline Execute.

jhagist
New Contributor III

Ok… I am a bit confused. So I need to follow this pattern.

Rest Post request data
Rest Get to see if it has completed.

So in the scenario that the Rest Get returns it isn’t done, I run my wait script (Python) but how to I run to the GET again?

Thanks for you response!

SandeepVemula
Contributor

Use Union Snap before REST GET which will have 2 inputs and after GET Place Script and a router(If required. To go futher or loop back) and route back to REST Get Via Union Snap.
image

Perfect! Worked like a charm.

Thanks for the picture!