Add Role Member

API Type

REST

HTTP Method

POST

Description

Adds a user or group to the specified role.

Good to Know

  • This user or group inherits the access right specified at the role level.

URL Format (OnPremises, Private Cloud)

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

URL Format (OnDemand)

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

Request Parameters

NameDescription
NoneNot Applicable

Request Body Properties

NameDescription

Assignee

Description:
The name of the assignee.
Type
string
Allowed Values:
A valid user name or group name, depending upon the assignee type.

AssigneeType

Description:
The type for the assignee for the task.
Type
string
Allowed Values:
  • User - Assigns the task to a user.
  • Group - Assigns the task to a group.

ClientData

Description:
Specifies the client data, which identifies a client for AgilePoint Server.
Type
string
Allowed Values:
A string that contains the client data.

If this value is null, the system will keep existing client data. Otherwise the relevant data is overwritten.

ObjectID

Description:
Reserved for future use.
Type
string
Allowed Values:
A null value.

ObjectType

Description:
Reserved for future use.
Type
string
Allowed Values:
A null value.

RoleName

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

These properties are based on the class AddRoleMemberHelper

JavaScript Code Example

$("#btnAddRoleMember").click(function () {
  
  var JSONObject = { 
    RoleName: "Administrators", Assignee: "mydomain\HR", 
    AssigneeType: "User", 
    ClientData: null, ObjectID: "00000000000000000000000000000000", 
    ObjectType: "All"
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Admin/AddRoleMember",
    data: JSON.stringify(JSONObject)
  });
  
});

Java Code Example

public String AddRoleMember() {

  String URI = "https://mydomain:9011/AgilePointServer/Admin/AddRoleMember";

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

  
    JSONObject postData = new JSONObject();
    postData.put("RoleName", "Regional Managers");
    postData.put("Assignee", "mydomain\\HR");
    postData.put("AssigneeType", "User");
    postData.put("ClientData", "");
    postData.put("ObjectID", "00000000000000000000000000000000");
    postData.put("ObjectType", "All");

    return ops.POSTMethod(URI, postData.toString());
  return "";
}

C# Code Example

public string AddRoleMember()
  {
    string URL = "https://mydomain:9011/AgilePointServer/Admin/AddRoleMember";

    string jsonRequestData = "{
      \"RoleName\":\"" + "Administrators" + "\",
      \"Assignee\":\"" + "mydomain\\\\brian.lucas" + "\",
      \"AssigneeType\":\"" + "User" + "\",
      \"clientData\":\"" + null + "\",
      \"ObjectID\":\"" + "00000000000000000000000000000000" + "\",
      \"ObjectType\":\"" + "All" + "\"}"

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

    return ops.POSTMethod(URL, jsonRequestData);
  }

cURL Code Example

Note: The authorization code is an example. You must generate your own authorization code in base64 encoded format with the syntax Domain\Username:Password.
curl --header "Content-Type: application/json" 
                         --header "Authorization:Basic QVAtNDI0XEFkbWluOnBhc3M=" 
                         --request POST 
                         --data {\"RoleName\":\"Administrators\",
                         \"Assignee\":\"mydomain\\brian.lucas\",
                         \"AssigneeType\":\"User\",
                         \"ClientData\":\"\",
                         \"ObjectID\":\"00000000000000000000000000000000\",
                         \"ObjectType\":\"All\"} 
                         https://mydomain:9011/AgilePointServer/Admin/AddRoleMember

Output

WFRoleMember object.

JSON Response Body Example

{
  "Assignee": "mydomain\HR"
  "AssigneeType": "User"
  "ClientData": null
  "CreatedBy": "mydomain\\brian.lucas"
  "CreatedDate":" \/Date(928149600000)\/", 
  "ObjectID": "00000000000000000000000000000000"
  "ObjectName": null
  "ObjectType": "All"
  "RoleName": "Administrators"
}

Supported Versions

AgilePoint v5.0 R2 and higher

Code Examples in the AgilePoint NX Documentation

The AgilePoint NX Product Documentation is intended as a basic reference to help you understand how to complete basic coding tasks, such as make API or JavaScript method calls. Code examples that show specific use cases, the solutions to specific business problems, or detailed implementation scenarios are outside the scope of the AgilePoint NX Product Documentation. For specific and/or advanced types of examples that may better meet your requirements, AgilePoint provides several resources:

  • AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
  • Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
  • Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.