Articles in this section
Category / Section

How to get the list of users using REST API?

Published:
This article will guide you through the process of retrieving the existing users using the REST API in Bold BI.

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 document to get the authentication token.

Authorization

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>

Steps to get users using the REST API

  1. Pass the access token generated from the token endpoint in the Authorization header.
  2. List all the active users using the following API endpoint.

    METHOD

    GET

    URL

    https://{yourdomain}/api/v2.0/users

    Note: By default, this API returns the list of 25 users. You can get more users using pagination by passing the page and page_size parameters in the request URL. For example, refer to the URL below.
    /api/v2.0/users?page_size=30 returns the first 30 users.

    /api/v2.0/users?page=2&page_size=30 returns the 2nd group of 30 users.

  3. You will get a response message with the user information as follows.​
    {
        "data": [
            {
                "user_id": "fd39e677-b5c8-49c5-b139-aa75c99e9770",
                "user_name": "John",
                "email": "john@example.com",
                "first_name": "John",
                "last_name": "Soundar",
                "display_name": "John Soundar",
                "contact": "",
                "directory_type": {
                    "id": 1,
                    "name": "Local"
                },
                "role": "Admin",
                "email_verified": true,
                "user_status": "Active"
            },
            {
                "user_id": "042e67f9-4e09-4d5e-ba46-ac4c023e7f3c",
                "user_name": "sivabalan",
                "email": "sivabalan@example.com",
                "first_name": "Sivabalan",
                "last_name": "Ganesan",
                "display_name": "Sivabalan Ganesan",
                "contact": "",
                "directory_type": {
                    "id": 1,
                    "name": "Local"
                },
                "role": "Admin",
                "email_verified": true,
                "user_status": "Active"
            },
            {
                "user_id": "539162ac-fe1c-4a8f-bf4c-4ce126b3d0ae",
                "user_name": "tamil",
                "email": "tamil@example.com",
                "first_name": "Tamil",
                "last_name": "Selvan",
                "display_name": "Tamil Selvan",
                "contact": "",
                "directory_type": {
                    "id": 1,
                    "name": "Local"
                },
                "role": "",
                "email_verified": true,
                "user_status": "Active"
            }
        ],
        "total_results": 3,
        "links": [
            {
                "link": "http://localhost:49709/api/v2.0/users?page=1&page_size=25",
                "rel": "first",
                "type": "GET"
            },
            {
                "link": "http://localhost:49709/api/v2.0/users?page=1&page_size=25",
                "rel": "last",
                "type": "GET"
            }
        ],
        "status_message": null
    }

Error Messages

These are the possible error messages you may receive from this API.

HTTP Status Code

Description

Error Code

Error Message

               401

      Unauthorized

                -

                 -

               500

Internal Server Error

                -

                 -

Related Links









Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
IJ
Written by Israel Jebaraj Chandirakumar
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied