Accessing Project Online through REST api

Copper Contributor

Hi. I'm having a lot of trouble trying to access Project Online data through the REST interface. (I also posted this to the Sharepoint Dev community, not sure which place is best). 

 

I understand Oauth2 and I'm successfully getting an authorization token using a client id and secret that I obtained via the https://<<tenant>>.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx page. 

 

I can use the bearer token to do a GET on https://<<tenant>>.sharepoint.com/sites/pwa/_api/web/lists without a problem. However when I try to access https://<<tenant>>.sharepoint.com/sites/pwa/_api/ProjectData/Projects I get an authorization error, code 20010, "Access Denied".

 

The user I'm logging in with is the company administrator, and has also been added as a site admin for the Project site explicitly by name. Also when I'm logged in as that user, I can navigate to the above link and get the data inside the browser. That's using login cookies I guess, not oauth.

 

It seems obvious that I've not added the correct permissions, but I've given every permission I can find to my user through the admin website, not only to the project site but to the root site. 

 

I'm pretty stumped, I'd be grateful for a trailhead.

 

Thanks,

Rod

4 Replies

@rodfrey 

Hi Rod it sounds like you are just granting SharePoint permissions as you talk about sites. You'll need a project level 3 license and project web app permissions. Go to pwa settings and ensure you are in the administrators group as well. project web app uses its own set of permissions. Well I am assuming  you are in project server permissions mode ....

ray

@rayletts 

I'm having the same/similar issue as rodfrey.  But I don't have access to the sharepoint server or our company's Project Online (PWA?) console.  Our current admin inherited it.

When you say "Go to pwa settings and ensure you are in the administrators group as well. " what, exactly does that entail? Where are the pwa settings found - where might I direct our admin and what to look for there?

 

thank you

@rayletts 

I have the exact problem. Can you point us a doc link on how to set PWA permission to get the proper permission?

 

Thanks!

@rodfrey You need to understand there is a differences between SharePoint and Project Online.

https://<<tenant>>.sharepoint.com/sites/pwa/_api/web/lists usually considered as SharePoint API.

While for https://<<tenant>>.sharepoint.com/sites/pwa/_api/ProjectData/Projects usually considered as Project Online API.

 

When you try to hit "that" Project Online API then displayed Access Denied, basically it is because you are not "Project Online Administrator". You can check it by accessing PWA Settings, Manage Users, check in there if your user is registered in there. Also don't forget to check the Users Security Groups.