iotoms Docs

Create a role

POST
/api/v1/management/roles

Creates a new user role. The role key is built from the name if not given and stored in upper case with underscores. Assign its features separately with Update features assigned to a role.

How to use it

  1. Send a unique name and, optionally, a roleKey and status.
  2. The role is created with no features; grant them with Update features assigned to a role.
  3. Give users the role with Create a user or Update a user.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

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 POST 'https://beta.iotoms.com/api/v1/management/roles' \  -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"}