Skip to main content

Access Control (REST) API - My Profile

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

Get Logged-in Users - GET /MyProfile (v2.0 and up)

Get details of the currently logged-in users.

Usage:

  1. GET /MyProfile and get details of the currently logged-in users

  2. PUT /MyProfile and update the user details.

URL

/cxrestapi/auth/MyProfile

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",
  "firstName": "Inigo",
  "lastName": "Montoya",
  "email": "[email protected]",
  "phoneNumber": "",
  "cellPhoneNumber": "",
  "jobTitle": "",
  "other": "",
  "country": "",
  "localeId": 1,
  "teams": "Avengers1",
  "authenticationProviderId": 1
}

Notes:

Retrieves details of the currently logged-in users. Locale Id (localeId) is used in the System Locales API and the Authentication Provider Id (authenticationProviderId) is used in the Authentication Providers API. If the request fails, it returns an error response.

Update User - PUT /MyProfile (v2.0 and up)

Update existing user details.

Usage:

  1. GET /MyProfile and get details of the logged-in users

  2. PUT /MyProfile and update the user details.

URL

/cxrestapi/auth/MyProfile

Method:

PUT

Media Type (header):

Authorization: Bearer <access token value>

Content-Type: application/json;v=1.0

Parameters

Required:

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

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] - Additional user information

country=[string] - User country

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 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.