Rpalos
(Rainiel Anne Palos)
September 12, 2023, 2:28am
1
Hi,
I’m trying to retrieve all the accounts from particular source in my Identitynow. what I mean by all accounts includes uncorrelated accounts.
I tried to use the v3 get accounts api:
{{baseUrl}}/v3/accounts?filters=sourceId eq “47ce5419701040c593789252007aed5d”
but this api have a maximum number of records to return in a single API call which is 250.
is there a way to do paging? like fetch the first 250 accounts from page 1 then, another api call to fetch page 2 then next 250 accounts.
Thanks in advance.
Hi @Rpalos ,
I believe the options you are looking for are limit & offset param which looks like the following,
{{baseUrl}}/v3/accounts?limit=250&offset=0&filters=sourceId eq “47ce5419701040c593789252007aed5d”
For more references related to the API do check this link .
Note: The offset value is record-based, not page-based, and the index starts at 0
To get the next 250 accounts the Query will look something like,
{{baseUrl}}/v3/accounts?limit=250&offset=249&filters=sourceId eq “47ce5419701040c593789252007aed5d”
Note: Collection is done based on array indexing and starts from 0. So the first 250 records number from 0-249 (offset=0, limit=250) & second 250 records number from 250-499 (offset=249, limit=250) and so on.
The collection standards imply that its its 250 per page like you said. If you want to explore more on the other options and standards that go with collection type endpoint check here
1 Like
mcheek
(Mark Cheek)
September 12, 2023, 1:16pm
3
I would add to this to make sure you’re adding a “sorters” query parameter to this… preferably something like id that does not change.
I’ve found that sometimes the default sorting isn’t consistent and can lead to not getting back all the records or bringing in duplicates
1 Like
Rpalos
(Rainiel Anne Palos)
September 13, 2023, 1:28am
4
Hi gladstone,
Thanks! I can fetch now all the accounts from the target system.
1 Like
Rpalos
(Rainiel Anne Palos)
September 13, 2023, 1:31am
5
Hi mark,
I see. I’ll make sure to add the sorters parameter as well. Thanks for the inputs.
iamnithesh
(Nithesh Rao)
September 13, 2023, 2:40am
6
Gladstone Abraham:
limit=250&offset=249
offset should be 250 to get the 251st record onwards.
iamnithesh
(Nithesh Rao)
September 13, 2023, 2:42am
7
Very important point indeed… It drove me crazy when I had a case where there were few thousands of records and it took a me a long time to figure out the solution
system
(system)
Closed
November 12, 2023, 2:43am
8
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.