How to grant site access to the user using the Bold BI REST API?
Authentication
All REST API endpoints are protected using OAuth 2.0. To access this API, you need to get an access token. Please refer to this article link to get the access token.
Authorization Header
Header Name | Header Value |
Authorization | Bearer <access_token> |
Parameter Name | Type | Required | Comments |
tenant_id | Guid | YES | Id of the tenant |
- In the Authorization header, pass the access token generated from the token endpoint.
You can grant access to the user by using the below API endpoint.
METHOD
POST
URL
/api/v2.0/tenant/{tenant_id}/grant-access
Note: Please refer to this document to get the tenant ID.
- Include any one of the following details in the body of the request in JSON format.
Parameter Name
Type
Required
Comments
user_id
Guid
No
Id of the user
Refer to this document to get the tenant ID
email
String
No
Email address of the user
username
String
No
Username of the user
Note: The username or email should already be in the application. If not, create a new user and then provide access to the user.
You will get response message as shown below.
{
"api_status": true,
"data": {
"tenant": {
"id": "9f5ab5ae-aa0a-402e-b5b7-ae173906f10a",
"tenant_name": "production",
"url": "http://localhost:49709/bi/site/productionsite",
"tenant_type": "Embedded BI",
"created_date": "2023-03-14T11:25:35",
"modified_date": "2023-03-14T11:25:39",
"tenant_status": "Active",
"use_site_identifier": true,
"is_master": false,
"client_secret": "lI0GkhiGuvZa1o0aOrg0VaX8Pw7Dmiv4HfVajvPDy7ZMKSLjH3K8ak1d0gjM01uI"
},
"user": {
"user_id": "539162ac-fe1c-4a8f-bf4c-4ce126b3d0ae",
"user_name": "john.doe",
"email": "joh.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"display_name": "John Doe",
"contact": "",
"directory_type": {
"id": 1,
"name": "Local"
},
"email_verified": false,
"user_status": "Active",
"avatar_url": null
}
},
"status": true,
"status_message": "Granted site access to the user successfully"
}
Error Messages
Http Status Code |
Description |
Error Message |
401 |
Unauthorized |
- |
400 |
Bad Request |
Current request is empty. |
412 |
Precondition Failed |
Tenant Id is invalid or empty. |
404 |
Not Found |
Tenant is deleted. |
404 |
Not Found |
Tenant is invalid. |
412 |
Precondition Failed |
Invalid user id. |
412 |
Precondition Failed |
User account has been deleted. |
412 |
Precondition Failed |
User already have access to this site. |
404 |
Bad Request |
User detail not found. |
Related links
How to Generate Access Token from User Management Server using Bold BI REST API
- How to Add a new User to the user management server using Bold BI REST API
How to Remove Site Access to the User in user management server using Bold BI REST API
How to Delete the User from the user management server using Bold BI REST API