Category / Section
How to check the user existence in BI site using API
Published:
Bold BI provides a RESTful web API that allows other third-party applications to interact with Bold BI programmatically. This topic explains to check the particular user existence in Bold BI Analytics Server.
Steps to check the user existence in Bold BI Server using API
NOTE: When you sign into the 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.
Follow the steps below to check whether the user exists or not in Bold BI server:
- Set up and use the Bold BI URL as below:
a. Embed BI: If http://{domain_name}/bi/site/{site_identifier} is the Bold BI Embed site URL, then the API end of this site will be accessed by http://{domain_name}/bi/api/site/{site_identifier}
b. Cloud BI: If https://{domain_name}/bi is the Bold BI cloud site URL, then the API end of this site will be accessed by https://{domain_name}/bi/api - Add the following endpoint (/v4.0/users/{username or email}) to the site URL and use the request HTTP method GET in request Postman to get the user details. Set up the URL as shown below:
a. Embed BI: http://{domain_name}/bi/api/site/{site_identifier}/v4.0/users/{username or email}
b. Cloud BI: https://{domain_name}/bi/api/v4.0/users/{email} - Add authorization header with a generated access token
- Successful status code of 200 returns user detail with the response body as shown below:
{
"ContactNumber": "",
"DisplayName": "Test",
"Email": "test@boldbi.com",
"FirstName": "Test",
"IsActive": true,
"Lastname": "",
"UserStatus": 0,
"UserId": 2,
"Username": "test",
"DirectoryType": 1,
"Avatar": "iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAFLBkF0AAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAlqADAAQAAAABAAAAlgAAAAA0g2oaAAABoElEQVR4Ae3QgQAAAADDoPlTH+SFUGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDXwMDYLkAAWcPVEUAAAAASUVORK5CYII="
}
- If the user is not found, then the API returns a 404 (Not Found) HTTP status code with the message “User Detail not found.” like below.
{ "Message": "User detail not found.", "StatusCode": 1002 }