Role API
{ urn:com.soa.role.api } RoleAPI
The Roles API service provides operations for managing users in roles in a scope of a Resource(Business).
Note: All of these operations take the Resouce ID as a parameter. For example Business ID. To find out what the Business ID is for your installation, you can run the GET /api/properties operation (TenantBusinessID parameter in the response).
POST/rolesaddRole
Creates a new Role
Request:
POST /api/roles HTTP/1.1
Content-Type: application/json or application/vnd.soa.v83+json
Accept: application/json or application/vnd.soa.v83+json
Sample Request Body (application/json):
{
"roleName" : "TestRole",
"rolePrivileges":[
{
"type": "api",
"deny": "false",
"actions" : ["FullControl"]
},
{
"type": "group",
"deny": "false",
"actions": ["Read", "Add", "Modify", "Delete"]
}
]
}
Response:
HTTP/1.1 200 OK
{
"roleName" : "TestRole",
}
Parameters
rolePrivilege {
Reponse
GET/roles/{resourceID}getRoles
Returns the roles available in the system.
Request:
GET /api/roles/{ResourceDN} HTTP/1.1
Content-Type: application/json or application/vnd.soa.v83+json
Accept: application/json or application/vnd.soa.v83+json
Response:
HTTP/1.1 200 OK
[{
"roleName" : "2FA-exempt users",
"resourceID" : "tenantbusiness.eap",
"Link" : {
"rel" : "self",
"href" : "http://{hostname}/api/roles/{ResourceDN}/2FA-exempt%20users"
}
}, {
"roleName" : "API Administrator",
"resourceID" : "tenantbusiness.eap",
"Link" : {
"rel" : "self",
"href" : "http://{hostname}/api/roles/{ResourceDN}/API%20Administrator"
}
}, {
"roleName" : "API Developer",
"resourceID" : "tenantbusiness.eap",
"Link" : {
"rel" : "self",
"href" : "http://{hostname}/api/roles/{ResourceDN}/API%20Developer"
}
},
{
"roleName" : "Tenant Manager",
"resourceID" : "tenantbusiness.eap",
"Link" : {
"rel" : "self",
"href" : http://{hostname}/api/roles/{ResourceDN}/Tenant%20Manager"
}
} ]
Parameters
Reponse
DELETE/roles/{roleName}deleteRole
Deletes a role
Request:
DELETE /api/roles/{roleName} HTTP/1.1
Content-Type: */*
Accept: text/plain
Response:
HTTP/1.1 200 OK
TestRole
Parameters
Reponse
PUT/roles/{resourceID}/{roleName}updateUsersAssignedToRole
Replaces users assigned to a role.
Request:
PUT /api/roles/{ResourceDN}/{roleName} HTTP/1.1
Content-Type: application/json or application/vnd.soa.v83+json
Accept: application/json or application/vnd.soa.v83+json
Sample Request Body (application/json):
{
"users":[
{
"userID": "d3f5e5b3-8f63-41ad-a990-be6aaa1cb07d.eap"
},
{
"userID": "be327b61-789e-4fae-a165-a34010635fab.eap"
}
]
}
Response:
HTTP/1.1 200 OK
{
"roleName" : "Guest",
"resourceID" : "tenantbusiness.eap",
"users" : [ {
"userID" : "d3f5e5b3-8f63-41ad-a990-be6aaa1cb07d.eap",
"fullName" : "admin eap"
}, {
"userID" : "be327b61-789e-4fae-a165-a34010635fab.eap",
"fullName" : "Stephan Poachman"
} ],
"Link" : {
"rel" : "self",
"href" : "http://localhost:9900/api/roles/tenantbusiness.eap/Guest"
}
}
Parameters
Reponse
GET/roles/{resourceID}/{roleName}getRole
Returns the information about a given business type including its avatar.
Request:
GET /api/roles/{ResourceDN}/{roleName} HTTP/1.1
Content-Type: application/json or application/vnd.soa.v83+json
Accept: application/json or application/vnd.soa.v83+json
Response:
HTTP/1.1 200 OK
{
"roleName" : "{RoleName}",
"resourceID" : "{ResourceDN}",
"users" : [ {
"userID" : "d3f5e5b3-8f63-41ad-a990-be6aaa1cb07d.eap",
"fullName" : "admin eap"
}, {
"userID" : "be327b61-789e-4fae-a165-a34010635fab.eap",
"fullName" : "Stephan Poachman"
} ],
"Link" : {
"rel" : "self",
"href" : "http://{hostName}/api/roles/{ResourceDN}/{RoleName}"
}
}