This is in SP2016 / Project Server 2016 on-prem. (Also, full disclosure, my first experience with Project Server / PWAs.)
Let's say I have a PWA set up at the URL http://servername/pwa/MyProjects
. I set up the "Connected SharePoint Sites" to automatically create a project site when a project is published to the PWA. Then I publish a project called "Project1".
Now I have a SharePoint site at the URL http://servername/pwa/MyProjects/Project1
.
Is there a way to get the Project ID of the published project from the related SharePoint site, via SharePoint REST API?
Meaning, I want to use
http://servername/pwa/MyProjects/Project1/_api/web/Some-endpoint-I-don't-know
in order to get the ID of the related project so that I can then use
http://servername/pwa/MyProjects/_api/ProjectServer/projects('use-the-ID-here')
to get access to the project through the Project Server REST API.
I know it is there somewhere because on the QuickLaunch of the SharePoint site, there is a link to "Project Details" that has a URL of
http://servername/pwa/MyProjects/ProjectDrilldown.aspx?ProjUid=GUID-is-here&ret=1
Is there a way I can get the GUID without resorting to scraping the page?