Update Role

API Type

REST

HTTP Method

POST

Description

Updates information for a role.

URL Format (On Premises)

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

URL Format (AgilePoint for Azure)

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

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

Description

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

Enabled

Definition:
Enables or disables an entity.
Type
bool
Allowed Values:
  • True - Enables the entity.
  • False - Disables the entity.

Rights

Definition:
Specifies the rights that are assigned to the Role.
Type
WFAccessRights
Allowed Values:
An array of index values. See the table for appropriate indexes.

WFAccessRights provides the enums for rights. See the sample code for more information.

RoleName

Definition:
The name of a role.
Type
string
Allowed Values:
A valid role name.

These properties are based on the class AddUpdateRoleHelper

JavaScript Code Example

$("#btnUpdateRole").click(function () {
  
  var JSONObject = {
    RoleName: "testasd12", 
    Description: "test", 
    Enabled: true, 
    Rights: ["InitiateProcessInstance", "CancelProcessInstance"]
  }; 
  
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Admin/UpdateRole",
    data: JSON.stringify(JSONObject)
  });
  
});

Java Code Example

public String UpdateRole(String RoleName, String Description,
  boolean Enabled, String[] Rights) {

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

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

  JSONObject postData = new JSONObject();
  try {
    postData.put("RoleName", RoleName);
    postData.put("Description", Description);
    postData.put("Enabled", Enabled);
    JSONArray rights = new JSONArray();
    for (String temp : Rights) {
      rights.put(temp);
    }
    postData.put("Rights", rights);
    return ops.POSTMethod(URI, postData.toString());
  } catch (JSONException e1) {
    e1.printStackTrace();
  }
  return "";
}

Output

An updated WFRole object.

JSON Response Body Example

{
  "CreatedBy": "DEMO3\\HR"
  "CreatedDate": "\/Date(928149600000)\/",
  "Description": "test"
  "Enabled": true
  "LastModifiedBy": "DEMO3\\administrator"
  "LastModifiedDate": "\/Date(928149600000)\/",
  "Name": "testasd12"
  "RightFlags": "YYNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
                NNNNNNNNN"
}

Supported Versions

AgilePoint BPMS v5.0 R2 and higher