I'm new to SharePoint, I have been trying to retrieve a single Project and all its Tasks by doing the following:
https://servername.sharepoint.com/sites/pwa/_api/ProjectServer/Projects('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')/Tasks
I have also tried to retrieve a Project by doing this:
https://servername.sharepoint.com/sites/pwa/_api/ProjectServer/Projects('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
This is the error that I receive:
{
"error": {
"code": "1000, Microsoft.ProjectServer.PJClientCallableException",
"message": {
"lang": "en-US",
"value": "This project either does not exist, or has been deleted. Only QueueJobs can be accessed from a deleted project."
}
} }
Which is not true because I'm able to get all the projects by doing this:
https://servername.sharepoint.com/sites/pwa/_api/ProjectServer/Projects?$top=100
Also, if I don't use the $top
this is what the query returns:
{
"d": {
"results": []
}
}
why is that?
I'm doing this in Postman. I have looked through the documentation and haven't come across anything. Any help is appreciated!
$top
query returning nothing, but at least as far as your main queries go, the syntax looks correct. Have you verified that you have the correct GUID for the project ID? Also, are these projects published? If so, have you considered using the/_api/ProjectData/
endpoint?ProjectData
endpoint, you need to be in the Portfolio Managers group. If you're getting the ID from the results of the 'all projects' query, that certainly is odd. I wonder if you could flip the query around to use the ID as a filter, so something like/_api/ProjectServer/Projects?$filter=Id eq guid'xxxxxxx'&$select=Tasks&$expand=Tasks
?