none
Add/Edit enterprise resource components through REST API

    Question

  • I can successfully add an enterprise resource via a POST to http://<pwaserver>/_api/ProjectServer/EnterpriseResources/Add with the following JSON block:

    { "parameters" : { "Id" : "<UUID>", "Name" : "<name of resource>" } }

    However, when I try to add the Email address or the CostCenter it gets denied:

    { "parameters" : { "Id" : "<UUID>", "Name" : "<name of resource>", "CostCenter" " "<cc>", "Email" : "<email>" } }

    I'm also trying to modify a Enterprise Custom 
    Field tied to the resource once it's created (I have no problems editing custom fields for projects via REST). Does anyone have an example of what the JSON packet should contain or what I'm doing wrong?

    Note that I've also tried checkout/in/publish of the enterprise resource and those calls also failed.

    Tuesday, October 31, 2017 4:32 PM

All replies

  • Here's what I've found out (so far):

    A POST to http://<pwaserver>/_api/ProjectServer/EnterpriseResources with the following JSON block:

    { { "__metadata" : "PS.EnterpriseResource" }, "Name" : "name", "Email" : "<email>", "CostCenter", "<cc>", "Group" : "<grp>" }
    Along with the following headers:
    "Accept", "application/json;odata=verbose"
    "Content-Type", "application/json;odata=verbose;charset=utf-8"
    "X-RequestDigest", "<digestvalue>"

    will add the resource and fill in the "standard" resource fields. I still haven't found a way to successfully add the resource custom field values.

    Wednesday, November 1, 2017 7:17 PM
  • Do u know how could I update the base calendar of a enterprise resource using REST API? What would be the structure?

    { { "__metadata" : "PS.EnterpriseResource" }, "Name" : "name", "Email" : "<email>", "CostCenter", "<cc>",

    "BaseCalendar" : "<CalendarId>" }

    Monday, February 11, 2019 12:28 PM