0

As part of migration from oapi to the new api, I am replacing a call that used the "library" api with a new call that now uses the "documents" api ( since the "library" api is not available anymore).

Here is what the request looks like : https://api.mendeley.com/documents?limit=5 ( with the token in the header).

The response is just JSON data for the documents in the library.I am not getting the fields like - total_results, total_pages, current_page etc. in the response.

How can I get the total_results, total_pages, current_page data etc. in the response.

Thanks, Prasad

1 Answers1

0

The total results is returned in the response in a header called - Mendeley-Count: XXXX. This header is only included in the first page of a paged results set so your application should retrieve this value before requesting other result pages.

You don't need to know the total_pages or current_pages as we have abstracted this away in the link headers. All you have to do is follow these links.

There is a worked example here and it working with collections is documented here

  • Thanks for sharing this. There seems to be a bug though. The header is not set if the limit is set to a number higher than the max number of items in the library. e.g. if the library has 73 items and if I set the limit to 75 , the "Mendeley-Count" header is not set. If I set the limit to 70, I do see the header. – Prasad Joshi Oct 30 '14 at 19:50