I am building a Provider Hosted App for SharePoint 2013 in PHP. I have been successfully able to generate an access token for my user, and remotely access an api for showing all the lists. (_api/web/lists).

However, I seem to be unable to access: https://mysharepointsite.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties

I get the message: Access denied. You do not have permission to perform this action or access this resource.

I am sending in the following HTTP headers which work for showing the lists, just not the user profile:

 $http_headers = array( 'Authorization: Bearer ' . $access_token,
                    'Accept: application/json;odata=verbose'     );

The app permissions I am asking for are:

  • News Feed (Social) : write
  • User Profiles (Social) : read
  • Tenant : Read
  • Core (Social) : Read

Any help would be greatly appreciated!

| improve this question | | | | |
  • Is your app permissions set to read? in your app manifest – Hugh Wood May 14 '13 at 11:06
  • yes. Here is the xml output: <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" /> <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Read" /> <AppPermissionRequest Scope="http://sharepoint/social/microfeed" Right="Write" /> <AppPermissionRequest Scope="http://sharepoint/social/core" /> </AppPermissionRequests> – Graham May 14 '13 at 14:52
  • Hi Graham, can you show a piece of code - how you've received a token? Which libraries were used? Thanks! – Andron Oct 1 '14 at 8:07

I don't know if this is the answer... but I found a different API endpoint that gave me enough information. I am still not sure if this is the best way to go, so any direction would be really helpful!

I used https://mysharepointsite.com/_api/Web/CurrentUser

| improve this answer | | | | |

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.