Set Custom Attributes

API Type

REST

HTTP Method

POST

Description

Sets names and values for multiple custom attributes for a specified custom ID.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/SetCustomAttrs/[customID]

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/SetCustomAttrs/[customID]

Request Parameters

Name Description

customID

Definition:
A work object ID specified within a process instance.
Type
string
Allowed Values:
One valid work object ID.

Request Body Properties

Name Description

attributes

Definition:
Name-value pairs associated with a custom ID.
Type
NameValue
Allowed Values:
A valid custom ID with an associated name.

JavaScript Code Example

$("#btnSetCustomAttrs").click(function () {
  var JSONObject = {
    attributes: [{ Name: "test1", Value: "test123" },
                     { Name: "test2", Value: "test1234"}]
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/
                SetCustomAttrs/C09EA09523C84E458A09E4101FCE6E1F",
    data: JSON.stringify(JSONObject)
  });
});

Java Code Example

public String SetCustomAttrs(String customID, 
  String[] Name, String[] Value) {

  String URI = "http://mydomain:9011/AgilePointServer/Workflow/SetCustomAttrs/"
                       + customID;

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

  JSONObject postMainObject = new JSONObject();
  JSONArray postArray = new JSONArray();
  try {
    for (int i = 0; i < Name.length; i++) {
      JSONObject postData = new JSONObject();
      postData.put("Name", Name[i]);
      postData.put("Value", Value[i]);

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

C# Code Example

public string btnSetCustomAttrs()
  {
    string URL = "http://mydomain:9011/AgilePointServer/Workflow/
                         SetCustomAttrs/FE6F63E224174FE9BD8B30A8ADCB0434";

    string jsonRequestData = "{
      \"attributes\":[ {\"Name\":\"test1\",
      \"Value\":\"test123\"},
      {\"Name\":\"test2\",
      \"Value\":\"test1234\"}]}";

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

    return ops.POSTMethod(URL,jsonRequestData);
  }

Output

None.

JSON Response Body Example

The response body is empty.

Supported Versions

AgilePoint BPMS v5.0 R2 and higher