cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Looping through Api call

sravan
New Contributor II

Hi We have a requirement where, If we do an api call , we get response something like below
{
records_remaining : โ€œ200โ€,
records_processed: โ€œ100โ€,
failed: โ€œ0โ€
},
โ€œentityโ€: [
"rec1: โ€œabcโ€,
โ€œrec2โ€:โ€œxyzโ€
]

Pagination does not support by Api . we need to wait for 10 sec for every api call until we get records_remaining is 0

for example https:abc.com/8080/getfullload?batch=50 -----> wait for 10 sec and do the same call until we get records remainining to 0
@bojanvelevski Any best way we can achieve this? please help!

1 ACCEPTED SOLUTION

bojanvelevski
Valued Contributor

Hi @sravan,

Even though the API does not support pagination, I think we can leverage of the pagination option in the Rest Get snap. There is a Pagination Interval option, which basically means โ€œWait for X seconds before doing the next requestโ€.

The logic would be something like:

HasNext: parseInt($records_remaining) > 0
NextURL: https:abc.com/8080/getfullload?batch=50

Let me know if this helps,

Regards,
Bojan

View solution in original post

2 REPLIES 2

bojanvelevski
Valued Contributor

Hi @sravan,

Even though the API does not support pagination, I think we can leverage of the pagination option in the Rest Get snap. There is a Pagination Interval option, which basically means โ€œWait for X seconds before doing the next requestโ€.

The logic would be something like:

HasNext: parseInt($records_remaining) > 0
NextURL: https:abc.com/8080/getfullload?batch=50

Let me know if this helps,

Regards,
Bojan

Thanks @bojanvelevski you are a Savior. It works!