iotoms Docs

Update a role

PUT
/api/v1/management/roles/{id}

Updates a user role's name, role key or status. A blank role key keeps the current one. Permissions are changed separately with Update features assigned to a role.

How to use it

  1. Get the role ID from List roles.
  2. Send the name and, if changing them, roleKey and status; a blank roleKey keeps the current key.
  3. The role key is upper-cased with spaces turned to underscores; users keep the role and its permissions.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

id*integer

ID of the record.

Formatint64

Request Body

application/json
  1. body
id?|

Role ID. Set by the server.

Formatint64
name*string

Role name, unique across the merchant. Required.

roleKey*string

Stable key for the role, e.g. CASHIER. Upper-cased with spaces turned to underscores; built from the name when left blank.

status*string

Role status text. Defaults to active.

modifiedTime*string

When the role was last changed. Set by the server.

Formatdate-time

Response Body

OK

*/*
  1. response
id?|

Role ID. Set by the server.

Formatint64
name*string

Role name, unique across the merchant. Required.

roleKey*string

Stable key for the role, e.g. CASHIER. Upper-cased with spaces turned to underscores; built from the name when left blank.

status*string

Role status text. Defaults to active.

modifiedTime*string

When the role was last changed. Set by the server.

Formatdate-time
Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/management/roles/0' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "roleKey": "string",  "status": "string",  "modifiedTime": "2019-08-24T14:15:22Z"}'
Example Response
{  "id": 0,  "name": "string",  "roleKey": "string",  "status": "string",  "modifiedTime": "2019-08-24T14:15:22Z"}