Articles in this section
Category / Section

How to grant site access to the user using the Bold BI REST API?

Published:
To grant access to user in the user management server (UMS) using REST API, you need to first authenticate yourself using the API access token. Once you have successfully authenticated, you must obtain your tenant ID and user ID before using the API to grant access to the user.
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
An Authorization header is an HTTP header that contains an authentication token or credentials sent by the client to the server
Header Name
Header Value
Authorization
Bearer <access_token>

URI Parameters

Parameter Name

Type

Required

Comments

tenant_id

Guid

YES

Id of the tenant


Steps to grant site access to the User
  1. In the Authorization header, pass the access token generated from the token endpoint.


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



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

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





Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SG
Written by Sivabalan Ganesan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied