Accessing Project Online through REST api

%3CLINGO-SUB%20id%3D%22lingo-sub-655851%22%20slang%3D%22en-US%22%3EAccessing%20Project%20Online%20through%20REST%20api%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-655851%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%20I'm%20having%20a%20lot%20of%20trouble%20trying%20to%20access%20Project%20Online%20data%20through%20the%20REST%20interface.%20(I%20also%20posted%20this%20to%20the%20Sharepoint%20Dev%20community%2C%20not%20sure%20which%20place%20is%20best).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20understand%20Oauth2%20and%20I'm%20successfully%20getting%20an%20authorization%20token%20using%20a%20client%20id%20and%20secret%20that%20I%20obtained%20via%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fterrapinenergy.sharepoint.com%2Fsites%2Fpwa%2F_layouts%2F15%2Fappregnew.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2F%26lt%3B%3CTENANT%3E%26gt%3B.sharepoint.com%2Fsites%2Fpwa%2F_layouts%2F15%2Fappregnew.aspx%3C%2FTENANT%3E%3C%2FA%3E%26nbsp%3Bpage.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20use%20the%20bearer%20token%20to%20do%20a%20GET%20on%26nbsp%3B%3CSPAN%3Ehttps%3A%2F%2F%26lt%3B%3CTENANT%3E%26gt%3B.sharepoint.com%2Fsites%2Fpwa%2F_api%2Fweb%2Flists%20without%20a%20problem.%20However%20when%20I%20try%20to%20access%26nbsp%3Bhttps%3A%2F%2F%26lt%3B%3CTENANT%3E%26gt%3B.sharepoint.com%2Fsites%2Fpwa%2F_api%2FProjectData%2FProjects%20I%20get%20an%20authorization%20error%2C%20code%2020010%2C%20%22Access%20Denied%22.%3C%2FTENANT%3E%3C%2FTENANT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20user%20I'm%20logging%20in%20with%20is%20the%20company%20administrator%2C%20and%20has%20also%20been%20added%20as%20a%20site%20admin%20for%20the%20Project%20site%20explicitly%20by%20name.%20Also%20when%20I'm%20logged%20in%20as%20that%20user%2C%20I%20can%20navigate%20to%20the%20above%20link%20and%20get%20the%20data%20inside%20the%20browser.%20That's%20using%20login%20cookies%20I%20guess%2C%20not%20oauth.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIt%20seems%20obvious%20that%20I've%20not%20added%20the%20correct%20permissions%2C%20but%20I've%20given%20every%20permission%20I%20can%20find%20to%20my%20user%20through%20the%20admin%20website%2C%20not%20only%20to%20the%20project%20site%20but%20to%20the%20root%20site.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI'm%20pretty%20stumped%2C%20I'd%20be%20grateful%20for%20a%20trailhead.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ERod%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1436501%22%20slang%3D%22en-US%22%3ERe%3A%20Accessing%20Project%20Online%20through%20REST%20api%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1436501%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F340115%22%20target%3D%22_blank%22%3E%40rodfrey%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Rod%20it%20sounds%20like%20you%20are%20just%20granting%20SharePoint%20permissions%20as%20you%20talk%20about%20sites.%20You'll%20need%20a%20project%20level%203%20license%20and%20project%20web%20app%20permissions.%20Go%20to%20pwa%20settings%20and%20ensure%20you%20are%20in%20the%20administrators%20group%20as%20well.%20project%20web%20app%20uses%20its%20own%20set%20of%20permissions.%20Well%20I%20am%20assuming%26nbsp%3B%20you%20are%20in%20project%20server%20permissions%20mode%20....%3C%2FP%3E%3CP%3Eray%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494153%22%20slang%3D%22en-US%22%3ERe%3A%20Accessing%20Project%20Online%20through%20REST%20api%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494153%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F687922%22%20target%3D%22_blank%22%3E%40rayletts%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20the%20same%2Fsimilar%20issue%20as%20rodfrey.%26nbsp%3B%20But%20I%20don't%20have%20access%20to%20the%20sharepoint%20server%20or%20our%20company's%20Project%20Online%20(PWA%3F)%20console.%26nbsp%3B%20Our%20current%20admin%20inherited%20it.%3C%2FP%3E%3CP%3EWhen%20you%20say%20%22%3CSPAN%3E%3CEM%3EGo%20to%20pwa%20settings%20and%20ensure%20you%20are%20in%20the%20administrators%20group%20as%20well.%26nbsp%3B%3C%2FEM%3E%22%20what%2C%20exactly%20does%20that%20entail%3F%20Where%20are%20the%20pwa%20settings%20found%20-%20where%20might%20I%20direct%20our%20admin%20and%20what%20to%20look%20for%20there%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3Ethank%20you%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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

2 Replies
Highlighted

@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

Highlighted

@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