4

I'm trying to get data out of a O365 Sharepoint Project Online (PWA) enviroment.

When I login to the O365/Sharepoint environment and navigate in the browser to: https://my.sharepoint.com/sites/pwa/_api/ProjectData/Projects

I get a large XML with the data I can request in /ProjectData/Projects

That works fine. Now I want to query this data in Chrome Postman but that doesn't work

In Postman:

  1. When I choose GET and insert the link (above), select No Auth I recieve

    <?xml version="1.0" encoding="utf-8"?>
    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
        <m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.</m:message>
    </m:error>
    
  2. When I choose GET and insert the link (above), select Basic Auth and give my credentials I have used to login on, the then again I recieve

    <?xml version="1.0" encoding="utf-8"?>
    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
        <m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.</m:message>
    </m:error>
    

After some search I've found that this could be due to a missing authentication token (oAuth2), so I tried to request that token using this nice tutorial Sharepoint Online oAuth.

After following the tutorial I got an access token.

  1. When I choose GET and insert the link (above), select OAuth 2.0 and choose to add token to the header. In the Headers tab insert Key -> Authorization and Value -> Bearer ************* (Access token) then again

    <?xml version="1.0" encoding="utf-8"?> 
    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
        <m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.
        </m:message>
    </m:error>
    

What am I doing wrong? Is it so hard to get data out of Projects Online?

3 Answers 3

0

Change /ProjectData/Projects to /ProjectServer/Projects

Here is some code to work with: Use REST odata webservice to update a project in Project server

I just verified that it works in Postman as expected. So I think moving to the correct end point is all you need.

1
  • Wow, thx! I gave up but now i could try it again. I will keep you in touch. Thx for the effort!
    – Peter
    Aug 11, 2016 at 8:38
0

I used to be a BI PM on the Project Engineering team. The correct OData url is https://my.sharepoint.com/sites/pwa/_api/ProjectData The REST API as suggested in the last answer is generally not intended for reporting.

Once you have access, you can select which specific feed to access. If you are in Power BI, you can select multiple OData feeds at one time.

The issue seems to be that you don't have access to Project data, because either you are not signed into Project Online or that the Project Administrator has not given you access to the Reporting Service. Project security is separate from SharePoint security, generally. Any guidance you find on SharePoint reporting likely won't apply here due to architectural differences. My blog has more posts on using Project and Power BI together if you are interested.

0

Following a the answer in this post, it's only possible to authenticate to project online using app-registration: https://stackoverflow.com/questions/74049708/project-online-authenticate-odata-feed-using-azure-ad-and-postman

For this you need to be an tenant-admin or need help from a tenant admin.

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.