Category / Section
How to Get and Update User detail using Bold BI REST API
Published:
This article explains how to get and update a user detail associated with your tenant/site via REST API calls. These APIs are authenticated using client credentials (client id and secret) and hence don't require an admin account in the Bold ID server.
How to get a user detail
You can get a specific user detail by using the following API.
METHOD | URL |
GET | /v2.0/user/{userId} |
Follow the steps to get the user ID from Bold BI User Management Server (UMS) page
- Navigate to the following URL.
https://<your-domain>/ums/administration/user-management/users
- You can find all the users here and select the user for whom you want to get the user ID.
List of all users in the Bold BI user management server
- Here, you can find the user ID, as shown in the image below.
Specific user details in the Bold BI user management server
Authentication
Refer to this link to learn how to get the authentication token. You need to pass the access token in the request header, as mentioned below.
Header Name | Header Value |
Authorization | Bearer <access_token> |
Sample request
Sample request in Postman to get a user detail in Bold BI user management server
Sample response
{
"api_status": true,
"data": {
"user_id": "d7b8049a-2087-4a60-811b-b69253bca096",
"user_name": "john.doe",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"display_name": "John Doe",
"contact": "",
"directory_type": {
"id": 1,
"name": "Local"
},
"email_verified": true,
"user_status": "Active"
},
"status": true,
"status_message": null
}
Error Messages
HTTP status code | Description | Error message |
---|---|---|
401 | Unauthorized | - |
412 | Precondition Failed | Invalid user ID. |
412 | Precondition Failed | User account has been deleted. |
For more information about how to get specific users via API, refer to this help document link.
How to update a user detail
You can update the user detail using the following API.
METHOD | PUT |
URL | /v2.0/user/{userId} |
Request header
Same as the previous API request (how to get a user detail), you need to pass the authentication token in the request header.
Request body
Pass all the below parameters with new/existing values.
Parameter name | Type | Required | Comments |
---|---|---|---|
UserName | String | Yes | Username of the user |
Email | String | Yes | Email address of the user |
FirstName | String | Yes | First name of the user |
LastName | String | Yes | Last name of the user |
Contact | String | Yes | Contact of the user |
Sample request:
Sample request in Postman to update a user detail in Bold BI user management server
Sample response:
{
"api_status": true,
"data": {
"user_id": "d7b8049a-2087-4a60-811b-b69253bca096",
"user_name": "update_name",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"display_name": "John Doe",
"contact": "",
"directory_type": {
"id": 1,
"name": "Local"
},
"email_verified": true,
"user_status": "Active"
},
"status": true,
"status_message": "User has been updated successfully"
}
Error messages:
HTTP status code | Description | Error message |
---|---|---|
401 | Unauthorized | - |
412 | Precondition Failed | Invalid user id. |
412 | Precondition Failed | User account has been deleted. |
400 | Bad Request | Email address already exists. |
400 | Bad Request | Username already exists. |
For more information about how to update user details via API, refer to this document link.
Related links:
- How to Add a New User to the User Management Server Using Bold BI REST API
- How to delete a user via REST API