I am using a workflow to create a project in project server 2013. This seems like a fairly common operation, but I need to set a few pieces of information when I create the project that are not available in the constructor.
Process Outline
for my own purposes I am using Chrome app DHC for creating these requests.
I use headers:
Accept: application/json;odata=verbose Content-Type: application/json;odata=verbose
get the Context (X-RequestDigest):
dev1projects/PWA/_api/contextinfo [POST empty body]
Pick a Project:
dev1projects/PWA/_api/ProjectServer/Projects?$Top=1 [GET]
Check out the project:
dev1projects/PWA/_api/ProjectServer/Projects('theguidi-just-pick-from-theprojectabove')/checkOut() //Add Header X-RequestDigest:0xTheStringFromTheContextQuery(d/GetContextWebInformation/FormDigestValue) [POST empty body]
Update the Draft item:
dev1projects/PWA/_api/ProjectServer/Projects('projectid')/Draft/update() //Add Header X-RequestDigest:0xTheStringFromTheContextQuery(d/GetContextWebInformation/FormDigestValue) [POST] {"__metadata":{"type":"PS.DraftProject"},"Name":"Test 679"}
Check In the Draft:
dev1projects/PWA/_api/ProjectServer/Projects('theguidi-just-pick-from-theprojectabove')/Draft/checkIn() //Add Header X-RequestDigest:0xTheStringFromTheContextQuery(d/GetContextWebInformation/FormDigestValue) [POST empty body]