6

I'm using a REST api to get data from the User Information List using

    https://servername/sitename/_api/Web/SiteUserInfoList/items

This works great but the list stops after 121 entries - ending with a line such as

    <link rel="next" href="https://servername/sitename/_api/Web/SiteUserInfoList/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d2102" /> 

How should I go about calling the entire list?

7

Some options to do this:

  1. Use Listdata.svc:
    http://SiteURL/_vti_bin/listdata.svc/UserInformationList. This returns all the items.
  2. Use $top=5000:
    http://SiteURL/_api/Web/SiteUserInfoList/items?$top=5000. This will return all items within the threshold limit.
  3. Use GetItems
    This is a POST request where you can use an empty CAML query to return all the items. Please note that JSON format is default for this and it won't return in XML.

    Request would be like below:

    URL:
    http://SiteURL/_api/Web/lists/getbytitle('User Information List')/getitems

    Headers:
    Accept: application/json; odata=verbose X-RequestDigest: RequestDigest Content-Type: application/json; odata=verbose
    CAML query:
    { "query" : {"__metadata": {"type": "SP.CamlQuery" } , "ViewXml": "<View><Query></Query></View>" } }
0

header must be included

Accept: application/json; odata=verbose
Content-Type: application/json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.