Update Delegation

API Type

REST

HTTP Method

POST

Description

Updates a delegation object that has already been created.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Admin/UpdateDelegation

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Admin/UpdateDelegation

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

DelegationID

Definition:
The unique ID of a delegation object.
Type
string
Allowed Values:
A valid delegation ID.

FromUser

Definition:
Specifies a user from whom to delegate tasks.
Type
string
Allowed Values:
A valid user name.

ToUser

Definition:
Specifies the user who will receive the delegated tasks.
Type
string
Allowed Values:
A valid user name.

StartDate

Definition:
>The start date of delegation.
Type
DateTime
Allowed Values:
A valid DateTime value.

EndDate

Definition:
Specifies the completion date of delegation.
Type
DateTime
Allowed Values:
A valid DateTime value.

Description

Definition:
A free text description of a delegation.
Type
string
Allowed Values:
A string that can contain spaces and special characters.

Status

Definition:
The status of the delegation.
Type
string
Allowed Values:
A valid status.

JavaScript Code Example

$("#btnUpdateDelegation").click(function () {
                  
  var JSONObject = { 
    DelegationID: "77F9A9946CF74545B4C8A27956CDA036",
    FromUser: "demo3\\brian.lucas",
    ToUser: "demo3\\lilly.allen", 
    StartDate: '\/Date(' + new Date().getTime() + '-0000)\/',
    EndDate: '\/Date(' + new Date().getTime() + '-0000)\/', 
    Description: "Test", 
    Status: "Created"
  }; 
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Admin/UpdateDelegation",
    data: JSON.stringify(JSONObject)
  });
});

Java Code Example

public String UpdateDelegation(String DelegationID, String FromUser,
  String ToUser, String StartDate, String EndDate,
  String Description, String Status) {

  String URI = "http://mydomain:9011/AgilePointServer/Admin/UpdateDelegation";

  HTTPOperations ops = new HTTPOperations(domain, this.userName,
                       password, appID, locale);

  JSONObject postData = new JSONObject();
  try {
    postData.put("DelegationID", DelegationID);
    postData.put("FromUser", FromUser);
    postData.put("ToUser", ToUser);
    postData.put("StartDate", StartDate);
    postData.put("EndDate", EndDate);
    postData.put("Description", Description);
    postData.put("Status", Status);

    return ops.POSTMethod(URI, postData.toString());
  } catch (JSONException e1) {
    e1.printStackTrace();
  }
  return "";
	}

C# Code Example

public string UpdateDelegation(string username, string username1)
  {
    string gh = @"\/Date(928149600000+0000)\/";
    string jsonRequestData = "{
    \"FromUser\":\"" + username + "\",
    \"ToUser\":\"" + username1 + "\",
    \"StartDate\":\"" + "\\/Date(928149600000+0000)\\/"+ "\",
    \"EndDate\":\"" + "\\/Date(928149600000+0000)\\/" + "\",
    \"Description\":\"" + "Milind ReTest" + "\",
    \"Status\":\"" + "Created" + "\"}";

    string URI = "http://mydomain:9011/AgilePointServer/Admin/UpdateDelegation";

    HTTPOperations ops = new HTTPOperations(domain, this.userName, 
                         password, appID, locale);

    return ops.POSTMethod(URI, jsonRequestData);
  }

Output

Returns an updated instance of WFDelegation.

JSON Response Body Example

{
  "CancelledBy": null,
  "CancelledDate": "\/Date(928149600000+0000)\/",
  "CreatedBy": null,
  "CreatedDate": "\/Date(1394154711507+0000)\/",
  "DelegationID": "77F9A9946CF74545B4C8A27956CDA036",
  "Description": "Test",
  "EndDate": "\/Date(28799000+0000)\/",
  "FromUser": "demo3\\brian.lucas",
  "LastUpdatedBy": "demo3\\brian.lucas",
  "LastUpdatedDate": "\/Date(1394155684428+0000)\/",
  "ProcDefIDS": "",
  "RecWeekdaysString": "",
  "StartDate": "\/Date(-57600000+0000)\/",
  "Status": "Created",
  "ToUser": "demo3\\lilly.allen"
}

Supported Versions

AgilePoint BPMS v5.0 R2 and higher