Home

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%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
rodfrey
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

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies