Skip to main content

Access Control (REST) API - Users

This section includes REST APIs for working with Access Control User tasks.

Get All Users - GET /Users

Get details of all users.

Usage:

  1. GET /Users and get details of all users

  2. DELETE /Users/{id} and delete a user

URL

/cxrestapi/auth/Users

Method:

GET

Media Type (header):

Authorization: Bearer <access token value>

Accept: application/json;v=1.0

Parameters

None

Success Response:

Code: 200 Success

Error Response:

Code: 401 Unauthorized

Code: 403 Forbidden

Sample Response:

[
  {
    "id": 1,
    "userName": "admin",
    "lastLoginDate": "2018-07-17T13:48:06.6800933Z",
    "roleIds": [
      1
    ],
    "teamIds": [
      1,
      11,
      12
    ],
    "authenticationProviderId": 1,
    "firstName": "Inbal",
    "lastName": "Mon",
    "email": "admin@check.org",
    "phoneNumber": "",
    "cellPhoneNumber": "",
    "jobTitle": "Admin",
    "other": "",
    "country": "Algeria",
    "active": true,
    "expirationDate": "2021-03-04T07:55:58.0201439Z",
    "allowedIpList": [],
    "localeId": 1
  },
  {
    "id": 10,
    "userName": "Marci",
    "lastLoginDate": "2018-06-14T07:39:15.503093Z",
    "roleIds": [
      2
    ],
    "teamIds": [
      1,
      11,
      12,
      18
    ],
    "authenticationProviderId": 3,
    "firstName": "Marci",
    "lastName": "Mar",
    "email": "marci@check.org",
    "phoneNumber": "",
    "cellPhoneNumber": "",
    "jobTitle": "",
    "other": "",
    "country": "",
    "active": true,
    "expirationDate": null,
    "allowedIpList": [],
    "localeId": 1
  }
}

Notes:

Retrieves details of all users. Role Id (roleIds) is used in the Roles API, Team Id (teamIds) is used in the Teams API, Authentication Provider Id (authenticationProviderId) is used in the Authentication Providers API and Locale Id (localeId) is used in the System Locales API. If the request fails, it returns an error response.

Create New User - POST /Users

Create a new user.

Notice

The ‘Manage Users’ permission is required to execute this API.

Usage:

  1. GET /Users and get details of all users

  2. POST /Users and create a new user

URL

/cxrestapi/auth/Users

Method:

POST

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

createUserModel=[body]: Specifies the user details

username=[string] - User name

password=[string] - User password

roleIds=[integer] - User related role(s) Id(s)

teamIds=[integer] - User related team(s) Id(s)

authenticationProviderId=[integer] - User authentication provider Id

firstName=[string] -User first name

lastName=[string] - User last name

email=[string] - User email address

phoneNumber=[string] - User phone number

cellPhoneNumber=[string] - User cellular phone number

jobTitle=[string] - User job title

other=[string] - User other information

country=[boolean] - User country

active=[string] - User active/inactive state (true/false)

expirationDate=[string] - User expiration date (date-time)

allowedIpList=[string] - User allowed IPs

localeId=[integer] - User Locale (Id)

Success Response:

Code: 201 Success

Error Response:

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Sample Response:

no content

Notes:

Returns the location of the created user in the response header. If the request fails, it returns an error response.

Get User by Id - GET /Users/{id}

Get details of a user according to User Id.

Usage:

  1. GET /Users/{id} and get details of a user

  2. PUT /Users/{id} and update user details

URL

/cxrestapi/auth/Users/{id}

Method:

GET

Media Type (header):

Authorization: Bearer <access token value>

Accept: application/json;v=1.0

Parameters

Required:

id=[integer] – Unique Id of the User

Success Response:

Code: 201 Success

Error Response:

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

Sample Response:

{
  "id": 1,
  "userName": "admin",
  "lastLoginDate": "2018-07-17T13:48:06.6800933Z",
  "roleIds": [
    1
  ],
  "teamIds": [
    1,
    11,
    12
  ],
  "authenticationProviderId": 1,
  "firstName": "Inbal",
  "lastName": "Mon",
  "email": "admin@check.org",
  "phoneNumber": "",
  "cellPhoneNumber": "",
  "jobTitle": "Admin",
  "other": "",
  "country": "Algeria",
  "active": true,
  "expirationDate": "2021-03-04T07:55:58.0201439Z",
  "allowedIpList": [],
  "localeId": 1
}

Notes:

Retrieves user details according to the specified User Id. If the request fails, it returns an error response.

Update a User - PUT /Users/{id}

Update user details according to User Id.

Notice

The ‘Manage Users’ permission is required to execute this API.

Usage:

  1. GET /Users/{id} and get details of a user

  2. PUT /Users/{id} and update user details

URL

/cxrestapi/auth/Users/{id}

Method:

PUT

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

Required:

id=[integer] - Unique Id of the User

updateUserModel=[body]: Specifies the user details to update

roleIds=[integer] - User related role(s) Id(s)

teamIds=[integer] - User related team(s) Id(s)

firstName=[string] - User first name

lastName=[string] – User last name

email=[string] - User email address

phoneNumber=[string] - User phone number

cellPhoneNumber=[string] - User cellular phone number

jobTitle=[string] - User job title

other=[string] - User other information

country=[boolean] - User country

active=[string] – User active/inactive state (true/false)

expirationDate=[string] – User expiration date (date-time)

allowedIpList=[string] - User allowed IPs

localeId=[integer] - User locale

Success Response:

Code: 204 Success

Error Response:

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

Sample Response:

no content

Notes:

Updates the user details according to the defined parameters. Once the request is successful, it does not return any content. If the request fails, it returns an error response.

Delete a User – DELETE /Users/{id}

Delete a user according to User Id.

Notice

The ‘Manage Users’ permission is required to execute this API.

Usage:

  1. GET /Users and get details of all users

  2. DELETE /Users/{id} and delete a user

URL

/cxrestapi/auth/Users/{id}

Method:

DELETE

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

Required:

id=[integer] – Unique Id of the User

Success Response:

Code: 204 Success

Error Response:

Code: 400 Returns error messages

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 User not found

Sample Response:

no content

Notes:

Delete a user according to the User Id. Once the request is successful, it does not return any content. If the request fails, it returns an error response.

Migrate Existing User - POST /Users/migration (v2.0 - v9.2.0)

Migrate an existing user.

Notice

The ‘Manage Users’ permission is required to execute this API.

Usage:

  1. GET /Users and get details of all users

  2. POST /Users/migration and migrate an existing user

URL

/cxrestapi/auth/Users/migration

Method:

POST

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

migrationUserModel=[body]: Specifies the user details:

creationDate=[integer] – creation date

username=[string] - User name

password=[string] - User password

roleIds=[integer] - User related role(s) Id(s)

teamIds=[integer] - User related team(s) Id(s)

authenticationProviderId=[integer] - User authentication provider Id

firstName=[string] -User first name

lastName=[string] - User last name

email=[string] - User email address

phoneNumber=[string] - User phone number

cellPhoneNumber=[string] - User cellular phone number

jobTitle=[string] - User job title

other=[string] - User other information

country=[boolean] - User country

active=[string] - User active/inactive state (true/false)

expirationDate=[string] - User expiration date (date-time)

allowedIpList=[string] - User allowed IPs

localeId=[integer] - User Locale (Id)

Success Response:

Code: 201 Success

Error Response:

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Sample Response:

no content

Notes:

Migrates an existing user. Returns the location of the newly created user in the response header. If the request fails, it returns an error response.