Articles in this section
Category / Section

How to Grant Data Source Permissions with Bold BI REST API

Published:
This article will explain about granting permissions for data sources using the REST API in Bold BI. This can be achieved by providing permission to the user or to any of the groups where the user exists.

Authentication

When you sign into Bold BI, an authentication token is provided that should be attached in the request header (Authorization) for all subsequent API calls to authenticate the requests. To get the authorized token, refer to the document How to generate access token to authenticate users | Bold BI Docs

API Endpoint

To provide permission for the data sources, use the following API endpoint:


MethodEndpoint

User Permission

POST

/v5.0/permissions/users

Group Permission

/v5.0/permissions/groups

Embedded Bold BI: {domain_name}/bi/api/site/{site_identifier}/v5.0/permissions/users
Cloud Bold BI: {domain_name}/bi/api/v5.0/permissions/users

Request Body

For User Permission API:

NameRequiredTypeDescription
PermissionAccess
Yes
String
Specify an access type for item.

Values allowed are,
  • Create,
  • Read,
  • ReadWrite,
  • ReadWriteDelete 
UserId
Yes
IntUser ID to whom the permission needs to be provided. To get user ID use the API Get Specific User Detail.
PermissionEntity
YesStringSpecify an entity of item for permission.

Values allowed are,
  • AllDatasources
  • SpecificDataSource
ItemId
NoGuidSpecify the data source ID while assigning permission to particular item. To get the data source use the API Get Data Source Details by filtering the specific data source using its name in the query parameter q.

This ID needs to be provided when PermissionEntity has the value SpecificDataSource.

For Group Permission API:

NameRequiredTypeDescription
PermissionAccess
Yes
String
Specify an access type for item.

Values allowed are,
  • Create,
  • Read,
  • ReadWrite,
  • ReadWriteDelete 
GroupId
Yes
IntGroup ID to where permission needs to be provided. To get group ID use the API Get Groups Detail by filtering the specific group using its name in the query parameter q.
PermissionEntity
YesStringSpecify an entity of item for permission.

Values allowed are,
  • AllDatasources
  • SpecificDataSource
ItemId
NoGuidSpecify the data source ID while assigning permission to particular item. To get the data source use the API Get Data Source Details by filtering the specific data source using its name in the query parameter q.

This ID needs to be provided when PermissionEntity has the value SpecificDataSource.

Step-by-Step Guide:

  1. AllDatasources Permission Entity:
    The AllDatasources permission entity enables you to provide access to all data sources of the tenant site.

  2. SpecificDataSource Permission Entity:
    The SpecificDataSource permission entity allows you to grant access to a particular data source of the tenant site.
  3. Request and Response:
    When sending API requests to grant data source permissions, you need to structure the necessary information in the request body. Correspondingly, the API will respond with feedback on the success or failure of the permission update.


Sample Request Body:

{
 "PermissionAccess": "Create", // or "Read" or "ReadWrite" or "ReadWriteDelete"
 "UserId": "user_id_here",
 "PermissionEntity": "AllDatasources", // or "SpecificDataSource"
 "ItemId": "data_source_id_here" // Only required for SpecificDataSource permission entity.
}

Sample Response:

{
 "ApiStatus": true,
 "Status": true,
 "StatusMessage": "User Permission has been added successfully"
}

Related Links

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
NM
Written by Nihal Mohamed Ali
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied