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


in order to get the ID of the related project so that I can then use


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


Is there a way I can get the GUID without resorting to scraping the page?


1 Answer 1


This applies for SharePoint Online/Project Online, however assuming it's the same for on-prem.

The Project GUID is stored as a site property called MSPWAPROJUID for the Project Site.

This is accessible using the /_api/Web/AllProperties end point.

ie. http://servername/pwa/MyProjects/Project1/_api/Web/AllProperties

Using JS

 var ProjectUID;
 ExecuteOrDelayUntilScriptLoaded(getProjectUIDProperty, "sp.js");

 function getProjectUIDProperty() { 
            var ctx = new SP.ClientContext.get_current(); 
            this.web = ctx.get_web(); 
            this.props =  this.web.get_allProperties(); 
            ctx.executeQueryAsync(Function.createDelegate(this, gotProperty), Function.createDelegate(this, failedGettingProperty)); 
function gotProperty() {                
             ProjectUID = this.props.get_item('MSPWAPROJUID');
function failedGettingProperty() { 
            alert('Error: ' + args.get_message());

Using SPD

Set Variable:ps to [%Workflow Context:Current Site URL%]_api/Web/AllProperties/


Accept: application/json; odata=nometadata
Content-Type: application/json; odata=nometadata


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.