1

I need get multiple users by ID with REST API. I looked this question: How to get multiple users with REST API

But is not answered.

I've the ID's in an array:

var people = [426, 352, 155];

I've already seen this way:

http://siteurl/_vti_bin/ListData.svc/UserInformationList(426)

But I want get all users info in only one request.

0

1 Answer 1

4

For few items in ID's array, then you can try following

/_api/Web/Lists/GetByTitle('User Information List')/Items?$filter=(Id eq 426) or (Id eq 352) or (Id eq 155)

It will give you all users in one request. Remember GET request has MAX URL length.

For many items in ID's array, you have to use CAML & POST. CAML Should look like

<Where>
    <In>
        <FieldRef Name="ID" />
        <Values>
            <Value Type="Integer">426</Value>
            <Value Type="Integer">352</Value>
            <Value Type="Integer">155</Value>
            .............
        </Values>
    </In>
</Where>

End-Point will be

/_api/Web/Lists/GetByTitle('User Information List')/getitems

Also see my another answer about MAX URL length for GET request.

4
  • I've the error: The List 'User Information List' does not exist on the site with the URL :/
    – Carlos
    Feb 25, 2016 at 18:36
  • My sharepoint is in Portuguese, the list is named "Lista de Informações sobre o Usuário"
    – Carlos
    Feb 25, 2016 at 18:47
  • So change the list name and try Feb 25, 2016 at 19:16
  • Yes, I'm testing.
    – Carlos
    Feb 25, 2016 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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