Re: [atom-users] API Response Default Paging

84 views
Skip to first unread message

Dan Gillean

unread,
Mar 15, 2022, 9:05:45 AM3/15/22
to ICA-AtoM Users
Hi Ailish, 

AtoM's API endpoints can certainly be improved upon - the application is not really API driven, so they were added later on and aren't as fully featured as they might be. That said, perhaps the documentation will help: 
As noted in this section, the limit of records returned in the response is controlled by AtoM's global results per page setting. You could ask your client to increase this to return more results - though we don't recommend setting it too high, or the response may time out before completing. Try 50 results and see how that goes. Here's a link to the setting, which you could pass on to your client: 
Knowing that there are a specific number of results returned in a single response means you can use the skip parameter in your query to page to the next set. From the docs: 

  • skip: The amount of information objects skipped when returning the results. This parameter can be used to page results - for example, if the first response includes 10 results, then the following request can include a skip=10 parameter, which will skip the first 10 results and begin the response on the 11th. See the examples below.
    • Example - Skip the first 20 results: /api/informationobjects?skip=20
Hope this helps!

Regards, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


On Mon, Mar 14, 2022 at 2:31 PM Ailish McCarthy <ailishmc...@gmail.com> wrote:
Hi all - I'm trying to access items from my client's AtoM database using the API. I'm querying the data with 

https://atom-example-url-here.net/index.php/api/informationobjects?topLod=0 

Seems that the default paging is set to 10 right? For my purposes I need to parse through all returned results (over 28000 in my case), so I have 2 questions:

1. Is there a way to change the default number of results returned in the response?
2. How to actually page through this data when there is no info provided in the response about what page is currently being returned?

Thanks for any and all info! And if there's anything else I should clarify please let me know :)

Ailish

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/b3a6eff6-1e44-474c-8476-437fcc402e32n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages