PI REST Adapter - Polling a REST API
We would like to frequently poll hiring information from REST API
We have two options in REST Adapter polling in SAP PO:
Option 1: Incremental request based on timestamp of last call
Option 2: Incremental request based on response content
Can we combine these two options
Is there any custom way of handling below HTTP polling scenario. I am trying to get candidates from a Recruiting system and I need to pass below values in URL:
https://api.jv.com/api/v2/candidate?api=<key>&sc=<secret>&format=json &start=1&count=50&datestart=2016-04-25&dateend=2016-04-26
1. So my variables are "start" which would the next starting index i.e. 1...51...101
2. datestart would be the last time I ran this interface
3. dateend would be current time.
I tried the incremental count approach but how do we handle both incremental date and nextPageToken ?
Also if I use next Pagetoken the API response doesn't carry a page index or current page and next page token.
- If we are iterating the records page by page, say we have 2000 records and max we can get in one request is 500, the 4 request call will be as below:
https://api.jv.com/api/v2/candidate?api=api_key&sc=abc&start=1&count=500&datestart=2016-04-25&dateend=2016-04-26
https://api.jv.com/api/v2/candidate?api=api_key&sc=abc&start=501&count=500&datestart=2016-04-25&dateend=2016-04-26
https://api.jv.com/api/v2/candidate?api=api_key&sc=abc&start=1001&count=500&datestart=2016-04-25&dateend=2016-04-26
https://api.jv.com/api/v2/candidate?api=api_key&sc=abc&start=1501&count=500&datestart=2016-04-25&dateend=2016-04-26
What value do we store in nextPageToken and how do we handle the date start and date end ?