Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
SreejithSL
Contributor III
Contributor III

Read multiple Json pages from a REST API

Hi All,

I have a scenario to extract responses from a REST API on a daily basis. For this as per the API definition I have to provide query parameter as from_date and to_date hence responses for this particular period would be retrieved form the API and a max of 50 responses is included in a page. If this particular period have 100 records then it would be included in 2 pages.

The design what I implement only iterate to the first page and return 50 records , in order to get the whole records I need to call the Rest API one more time. That is another query parameter the API support to pass the page number ,so in this case I have to pass the page parameter dynamically two time .

I tried this requirement as like below

Firstly, with the date range I found the total number of page and save to a context variable (say 2)

then in the next branch I put one tforLoop and give the condition to iterate two times. The problem is I cannot connect tForloop to tRestClient. If anybody have some idea about to resolve this , Please share your suggestions.

Thank you.

Labels (2)
1 Reply
Anonymous
Not applicable

I have written an article/blog which covers this with the Slack API. You can see it here....

 

https://community.talend.com/s/article/Sending-Slack-messages-with-Talend-part-2-Collecting-your-Slack-data?language=en_US

 

You are looking for the "Retrieving key Slack information to send messages" section. I repeat calls to the API and make use of a "cursor" in the URL which is constructed from the result of the previous call.