- Our server has Single-Sign-On, when I manually login, and go to below URL (in chrome) I am to get Projects XML OData Feed https://{server}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects
- I need to take this data and manually save the file to run my python scripts. This becomes a nightmare as I need to download all the relational data (resources, assignment, etc. ) to get the full scope of things
- I would like to do this via python GET requests. I have done the below steps, but now stuck with the following error and do not know how to overcome it: HTTP RESPONSE: 403
{'odata.error': {'code': '-2147024891, Microsoft.Office.Project.Server.Exceptions.ProjectServerUnauthorizedAccessException', 'message': {'lang': 'en-US', 'value': 'User could not be authenticated because logon permission has not been granted'}}}
Steps I've taken to get REST API Access:
- PWA is set to "Project Permission Mode"
Use the following site to create AppId: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx
- Register the application and define the scope using the following url: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appinv.aspx
The Request XML I used is the following: <AppPermissionRequests AllowAppOnlyPolicy="true"><AppPermissionRequest Scope="http://sharepoint/projectserver" Right="Manage" /></AppPermissionRequests>
however, when I press CREATE, I am presented with the following landing page: "Sorry, you don't have access"
- I tried scopes: Scope="http://sharepoint/projectserver/project" Right="Read", same issue as above
- Finally, I applied:
<AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/projectserver" Right="Manage"/><AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Manage"/></AppPermissionRequests>
and the App was registered (Note, I did not use AllowAppOnly=True)
- However when it came time to accessing the URL for the project. I am presented with the HTML response I outline above. (Please note that I am getting the Bearer Token successfully, as I am able to hit the following url and get the web list: https://{server}.sharepoint.com/sites/pwa/_api/web Response: 200)
- Is there something I need to send in the GET header that specifies my Username? (Since I am using Bearer Token, not sure why this would be needed)
- Is there something on the sharepoint admin pages that I need to enable for my User? (I have Sharepoint Admin/Owner privileges)