6

I'm trying to call the "getpropertiesfor" Sharepoint Onlines REST endpoint.

https://msdn.microsoft.com/en-us/library/office/dn790354.aspx#bk_PeopleManagerGetPropertiesFor

I'm logged in and am just pasting the url into the browser. I am webencoding the string parameter @v. So my complete URL looks like this.

https://domain.sharepoint.com/_api/sp.userprofiles.peoplemanager/getpropertiesfor(@v)?@v=’i%3A0%23.f%7Cmembership%7Cuser.name%40domain.com’

Still I only get the error message.

The query string "accountName" is missing or invalid.

Any pointers on what's wrong? If I call an endpoint without parameters, like the "/sp.userprofiles.peoplemanager.gettrendingtags" endpoint it works and I get a correct response.

  • 3
    The call should look like this: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|user@domain.com' Reference: sharepoint.stackexchange.com/a/148320/10271 – Mx. Dec 12 '16 at 16:50
  • 2
    Thanks, so weird, I can swear I've tried all permutations of everything, from start to end, twice. Nothing worked. Now all of the sudden it works. :) Well, I must have made an error somewhere. Thank you for your time and help. – Molotch Dec 12 '16 at 18:36
7

I also had the same issue but resolved it finally;

Resolution: all the characters should be encoded after @v= (as below)

@v=%27i%3A0%23.f%7Cmemb‌​ership|user@domain.c‌​om%27

Full URL will be: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropert‌​iesFor(accountName=@‌​v)?@v=%27i%3A0%23.f%7Cmemb‌​ership|user@domain.c‌​om%27

0

As Mx writes in the comment the url formatted as shown here works.

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropert‌​iesFor(accountName=@‌​v)?@v='i:0%23.f|memb‌​ership|user@domain.c‌​om'

Still not sure where the "accountName=@v" addition comes from though. In the documentation (see link in first post) there's no mentioning you have to specify "accountName=", just that you have to supply your account name as a parameter.

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.