3

I activated user profiles (and managed metadata services), but when I call: http://<mysharepointsite>/_api/SP.UserProfiles.PeopleManager/GetMyProperties

I get:

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1, Microsoft.SharePoint.Client.UnknownError</m:code>
<m:message xml:lang="en-US">Unknown Error</m:message>
</m:error>

I can query lists just fine with REST. Do I need to activate something? Or does it take some time for this information to be query-able?

Do I need to create a site collection for Mysite?

EDIT Solved:

I needed to setup Mysite. Now everything works fine.

2 Answers 2

4

Setting up Mysite fixed the problem.

0

This code works fine against my Office 365 Tenant

$.ajax({
        url: appweburl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties",
        method: "GET",
        headers: {
                "Accept": "application/json; odata=verbose",
        }

})

Have you granted you app the permissions to User Profiles (Social)? (Although you should get access denied, not unknown error then..)

1
  • I haven't started writing the app yet because I can't retreive the data (just through the broswer for instance). The same REST call works on a different SP tenant that we have, but I did not set it up and the people that did never used REST. I made a brand new site collection, setup user profile and managed metadata service, and I guess I screwed up somewhere.
    – azium
    Jul 7, 2014 at 15:53

Your Answer

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

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