Bug or Feature in Rest API ?

28 views
Skip to first unread message

Monika Mevenkamp

unread,
Jun 19, 2019, 3:55:59 PM6/19/19
to dspac...@googlegroups.com

 

I have been looking at the demo.dspace.org/rest api

 

https://demo.dspace.org/rest/hierarchy

gives a tree for communities and collections – looking for ‘Sample Community’ is listed there

<community>
  <
handle>10673/1</handle>
  <
id>ff19bb02-4b01-4150-a7ff-997a9a9f89c2</id>
  <
name>Sample Community</name>

 

 

https://demo.dspace.org/rest/communities/top-communities

lists the top level communities

I expected to find ‘Sample Community’ listed – but can’t find it

 

Is this a bug or am I abusing the rest API ?

 

Monika

 

-- 

Monika Mevenkamp
OIT Princeton University

701 Carnegie Center – 331C
Phone: 609-258-4161
Skype: mo-meven

Tim Donohue

unread,
Jun 20, 2019, 12:21:09 PM6/20/19
to Monika Mevenkamp, dspac...@googlegroups.com
Hi Monika,

That list of Communities is paginated, so you are seeing the first page of top level communities (which is just the first 20).  Here's how pagination works in the 6.x REST API:  https://wiki.duraspace.org/display/DSDOC6x/REST+API#RESTAPI-Pagination

Therefore, if you wanted to see the next 20 top communities, you'd pass along:  https://demo.dspace.org/rest/communities/top-communities?offset=20&limit=20

So, this isn't a bug.  But, it's just something that isn't very well documented/explained in the current REST API, so it's easy to overlook by accident. 

- Tim  

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/BL0PR06MB49931C643160BE63FD9EFCEDADE50%40BL0PR06MB4993.namprd06.prod.outlook.com.


--
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org
Reply all
Reply to author
Forward
0 new messages