You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many api's out there that implement pagination mechanisms. To mention some:
Atlassian Jira
Teamviewer Api
It would be great if the plugin would support these apis better by leveraging the pagination and fetching more data. This is not as easy as it might sound. I can't propose a sound technical spec on how to implement this. Therefore I'm highlighting two concrete examples:
This api sends an optional next_offset item in the json response that should be sent as http argument offset_id to fetch more data. For example the first response to /reports/devices?from_date=2021-08-01T05:14:00Z json may look like:
And the following request to fetch more data should now be sent with the parameter /reports/devices?offset_id=eyJTdGFydCI6IjIwMjEtMDgtMDFUMDU6MTQ6MDArMDA6MDAiLCJUYWJsZUNvbnRpbnVhdGlvblRva2VuIjoiOGVmYjQyNjctMjM1NS00YzMxLWIyYmYtNDgzMTlkMzIzOTRhIn0=.
A smart guy would be able to base64 decode eyJTdGFydCI6IjIwMjEtMDgtMDFUMDU6MTQ6MDArMDA6MDAiLCJUYWJsZUNvbnRpbnVhdGlvblRva2VuIjoiOGVmYjQyNjctMjM1NS00YzMxLWIyYmYtNDgzMTlkMzIzOTRhIn0= to:
This api endpoint expects numeric http parameters maxResults and startAt while returning startAt, maxResults, total in the json response. For example requesting ?maxResults=2000&startAt=100 the following is returned:
@vdufloth Yes, I could fetch the data but ended up with partial results. This is not at all useful and confusing at best. At the moment I can't recall how I managed to get it working.
There are many api's out there that implement pagination mechanisms. To mention some:
It would be great if the plugin would support these apis better by leveraging the pagination and fetching more data. This is not as easy as it might sound. I can't propose a sound technical spec on how to implement this. Therefore I'm highlighting two concrete examples:
Teamviewer Api endpoint https://webapi.teamviewer.com/api/v1/reports/devices
This api sends an optional
next_offset
item in the json response that should be sent as http argumentoffset_id
to fetch more data. For example the first response to/reports/devices?from_date=2021-08-01T05:14:00Z
json may look like:And the following request to fetch more data should now be sent with the parameter
/reports/devices?offset_id=eyJTdGFydCI6IjIwMjEtMDgtMDFUMDU6MTQ6MDArMDA6MDAiLCJUYWJsZUNvbnRpbnVhdGlvblRva2VuIjoiOGVmYjQyNjctMjM1NS00YzMxLWIyYmYtNDgzMTlkMzIzOTRhIn0=
.A smart guy would be able to base64 decode
eyJTdGFydCI6IjIwMjEtMDgtMDFUMDU6MTQ6MDArMDA6MDAiLCJUYWJsZUNvbnRpbnVhdGlvblRva2VuIjoiOGVmYjQyNjctMjM1NS00YzMxLWIyYmYtNDgzMTlkMzIzOTRhIn0=
to:Atlassian Jira Api endpoint https://jira.example.com/rest/api/2/search
This api endpoint expects numeric http parameters
maxResults
andstartAt
while returningstartAt
,maxResults
,total
in the json response. For example requesting?maxResults=2000&startAt=100
the following is returned:Note that
maxResults
is capped at1000
.The text was updated successfully, but these errors were encountered: