Roles Resource

GET /roles

Returns the list of all the Roles associated to the account of the currently connected user.

Response Body
media type data type description
application/json RolesResult (JSON) The list of requested Role objects.
application/xml rolesResult (XML)

Example

Request
GET /roles
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "Role" : [ {
    "id" : 12345,
    "accountId" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "tags" : "...",
    "permissions" : [ "...", "..." ],
    "optlock" : 12345
  }, {
    "id" : 12345,
    "accountId" : 12345,
    "name" : "...",
    "createdOn" : 12345,
    "createdBy" : 12345,
    "modifiedOn" : 12345,
    "modifiedBy" : 12345,
    "tags" : "...",
    "permissions" : [ "...", "..." ],
    "optlock" : 12345
  } ]
}
                
              

POST /roles

Creates a new Role based on the information provided in RoleCreator parameter.

Request Body
media type data type description
application/xml roleCreator (XML) Provides the information for the new Role to be created.
Response Body
media type data type description
application/xml role (XML) The newly created Role object.

Example

Request
POST /roles
Content-Type: application/xml
Accept: application/xml

                
<roleCreator xmlns="http://eurotech.com/edc/2.0">
  <accountId>...</accountId>
  <name>...</name>
  <tags>...</tags>
  <permissions>
    <permission>...</permission>
  </permissions>
</roleCreator>

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/xml

                
<role xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <tags>...</tags>
  <permissions>
    <permission>...</permission>
  </permissions>
  <optlock>...</optlock>
</role>

                
              

GET /roles/administrator

Returns the Administrator Role for the current account.

Response Body
media type data type description
application/json Role (JSON) The requested Administrator Role object.
application/xml role (XML)

Example

Request
GET /roles/administrator
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "accountId" : 12345,
  "name" : "...",
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "tags" : "...",
  "permissions" : [ "...", "..." ],
  "optlock" : 12345
}
                
              

DELETE /roles/{roleId}

Deletes the Role specified by the "id" path parameter.

Request Parameters
name type description constraints
roleId path The id of the Role to be deleted. required

Example

Request
DELETE /roles/{roleId}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /roles/{roleId}

Returns the Role specified by the "id" path parameter.

Request Parameters
name type description constraints
roleId path The id of the Role requested. required
Response Body
media type data type description
application/json Role (JSON) The requested Role object.
application/xml role (XML)

Example

Request
GET /roles/{roleId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "accountId" : 12345,
  "name" : "...",
  "createdOn" : 12345,
  "createdBy" : 12345,
  "modifiedOn" : 12345,
  "modifiedBy" : 12345,
  "tags" : "...",
  "permissions" : [ "...", "..." ],
  "optlock" : 12345
}
                
              

PUT /roles/{roleId}

Updates the Role specified by the "id" path parameter based on the information provided in the Role parameter.

Request Parameters
name type description
roleId path The id of the Role to be updated.
Request Body
media type data type
application/xml role (XML)
Response Body
media type data type description
application/xml role (XML) The updated role.

Example

Request
PUT /roles/{roleId}
Content-Type: application/xml
Accept: application/xml

                
<role xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <tags>...</tags>
  <permissions>
    <permission>...</permission>
  </permissions>
  <optlock>...</optlock>
</role>

                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/xml

                
<role xmlns="http://eurotech.com/edc/2.0">
  <id>...</id>
  <accountId>...</accountId>
  <name>...</name>
  <createdOn>...</createdOn>
  <createdBy>...</createdBy>
  <modifiedOn>...</modifiedOn>
  <modifiedBy>...</modifiedBy>
  <tags>...</tags>
  <permissions>
    <permission>...</permission>
  </permissions>
  <optlock>...</optlock>
</role>