I have some trouble to use the Sharepoint2013 Rest API _api/Web/SiteUserInfoList. I need to use a $filter on the Name. I get always a 400 Bad Request. This is my endopoint rest ....my_site.../_api/Web/SiteUserInfoList/items/?$filter=Name eq 'i:0#.w|bs\user' How can I filter on the Name?

Thanks, Nk

  • have you try with %27 instead of ' ? – Salvatore Di Fazio Mar 25 '14 at 8:54
  • 1
    I think you need to encode the user name since it contains tons of chars not allowed in a querystring :) You could for example use encodeURIComponent: w3schools.com/jsref/jsref_encodeuricomponent.asp – Robert Lindgren Mar 25 '14 at 8:54
  • encodeURIComponent() solved my problem :) I tried to use encodeURI() but it didn't work. Thanks :D – user24623 Mar 25 '14 at 9:04

Name property value (claim format) should be encoded, for example using encodeURIComponent function or as an alternative you could specify UserName property instead:

/_api/Web/SiteUserInfoList/items?$filter=UserName eq 'username@tenant.onmicrosoft.com'

You need to change the # in the username to %23.

http://spsite/_api/Web/SiteUserInfoList/items/?$filter=Name eq 'i:0%23.w|bs\user'

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.