Articles in this section
Category / Section

How to create a new tenant/site using Bold BI REST API?

Published:

Tenant Creation API allows users to automate the process of creating and configuring new sites for their customers. This REST API is useful for those who need to create multiple sites for their customers in a streamlined and efficient manner.

Note : This API is applicable for On-Premise only.

Endpoint

METHOD
URL
POST

https://<your-domain>/api/v2.0/tenants

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 to get the access token. You need to pass the authorization in the request header.

Header Name
Header Value
Authorization
Bearer <authentication_token>
  • Set the content type as application/json.
Sample request header in Postman to create new tenant using APISample request header in Postman to create new tenant using API

Request body

Pass the below parameters to create a new tenant in Bold BI. Also, refer to this help document link to know more about these parameter details.

{
  "Email": "string",
  "ServerConfiguration": {
    "Database": {
      "ServerName": "string",
      "DatabaseName": "string",
      "UserName": "string",
      "Password": "string",
      "IsNewDatabase": "false",
      "MaintenanceDatabase": "string",
      "Port": "string",
      "ServerType": 0,
      "SslEnabled": "false",
      "AdditionalParameters": "string"
    },
    "Storage": {
      "StorageType": 0,
      "AzureBlob": {
        "AzureBlobStorageContainerName": "string",
        "AzureBlobStorageUri": "string",
        "ConnectionString": "string",
        "ConnectionType": "string",
        "AccountName": "string",
        "AccessKey": "string"
      }
    },
    "Site": {
      "TenantName": "string",
      "TenantIdentifier": "string",
      "UseSiteIdentifier": true,
      "TenantType": 3,
      "UseCustomBranding": true,
      "CustomAttribute": [
        {
          "Name": "string",
          "Value": "string",
          "Description": "string",
          "CanEncrypt": true
        }
      ],
      "TenantIsolation": {
        "IsEnabled": true,
        "IsolationCode": "string"
      }
    }
  },
  "DataStoreConfiguration": {
    "ServerName": "string",
    "DatabaseName": "string",
    "UserName": "string",
    "Password": "string",
    "IsNewDatabase": "false",
    "MaintenanceDatabase": "string",
    "Port": "string",
    "ServerType": 0,
    "SslEnabled": "false",
    "AdditionalParameters": "string"
  }
}

Sample request for MS SQL Database

Set ServerType as 0 to mention the type of database is MS SQL and pass other required parameters.
{
  "Email": "john.doe@example.com",
  "ServerConfiguration": {
    "Database": {
      "ServerName": ".",
      "DatabaseName": "bold_bi_19_04",
      "UserName": "sa",
      "Password": "sa@1234",
      "IsNewDatabase": "true",
      "ServerType": 0,
      "SslEnabled": "false"
    },
    "Storage": {
      "StorageType": 0
    },
    "Site": {
      "TenantName": "ABC Production",
      "TenantIdentifier": "abc",
      "UseSiteIdentifier": true,
      "TenantType": 3,
      "UseCustomBranding": true
    }
  },
  "DataStoreConfiguration": {
    "ServerName": ".",
    "DatabaseName": "bold_bi_19_04",
    "UserName": "sa",
    "Password": "sa@1234",
    "IsNewDatabase": "true",
    "ServerType": 0,
    "SslEnabled": "false"
  }
}

Sample request for PostgreSQL

Set ServerType as 4 to mention the type of database is PostgreSQL. Pass the maintenance database, port number, and other required parameters.
{
  "Email": "john.doe@example.com",
  "ServerConfiguration": {
    "Database": {
      "ServerName": "localhost",
      "DatabaseName": "bold_bi_19_04",
      "UserName": "postgres",
      "Password": "sa@1234",
      "IsNewDatabase": "true",
      "MaintenanceDatabase": "postgres",
      "Port": "5432",
      "ServerType": 4,
      "SslEnabled": "false"
    },
    "Storage": {
      "StorageType": 0
    },
    "Site": {
      "TenantName": "Sales",
      "TenantIdentifier": "sales",
      "UseSiteIdentifier": true,
      "TenantType": 3,
      "UseCustomBranding": true
    }
  },
  "DataStoreConfiguration": {
    "ServerName": "localhost",
    "DatabaseName": "bold_bi_19_04",
    "UserName": "postgres",
    "Password": "sa@1234",
    "IsNewDatabase": "true",
    "MaintenanceDatabase": "postgres",
    "Port": "5432",
    "ServerType": 4,
    "SslEnabled": "false"
  }
}

Sample request for MySQL 

Set ServerType as 1 to mention the type of database is MySQL. Also, pass the port number and other required parameters.
{
  "Email": "john.doe@example.com",
  "ServerConfiguration": {
    "Database": {
      "ServerName": "localhost",
      "DatabaseName": "bold_bi_19_apr_2",
      "UserName": "root",
      "Password": "John@1234",
      "IsNewDatabase": "true",
      "Port": "3306",
      "ServerType": 1,
      "SslEnabled": "false"
    },
    "Storage": {
      "StorageType": 0
    },
    "Site": {
      "TenantName": "Syncfusion",
      "TenantIdentifier": "sync",
      "UseSiteIdentifier": true,
      "TenantType": 3,
      "UseCustomBranding": true
    }
  },
  "DataStoreConfiguration": {
    "ServerName": "localhost",
    "DatabaseName": "bold_bi_19_apr_2",
    "UserName": "root",
    "Password": "John@1234",
    "IsNewDatabase": "true",
    "Port": "3306",
    "ServerType": 1,
    "SslEnabled": "false"
  }
}

Sample response

Refer to the below sample response on creating a new tenant/site in Bold BI.
{
    "api_status": true,
    "data": "959b4acf-5db6-4cae-97d3-5289494d3e7e",
    "status": true,
    "status_message": "Tenant added successfully"
}

In the above sample response, the data represents the newly created tenant ID.

Frequently Asked Questions (FAQs)

  1. How to set the port number for MS SQL?
    For MS SQL, you need to pass the port number in ServerName with hostname under ServerConfiguraton.Database and DataStoreConfiguration objects as shown below.
  2. "ServerConfiguration": {
        "Database": {
          "ServerName": "localhost,3306",
          "DatabaseName": "bold_bi_19_04",
          "UserName": "sa",
          "Password": "sa@1234",
          "IsNewDatabase": "true",
          "ServerType": 0,
          "SslEnabled": "false"
        }
      },
      "DataStoreConfiguration": {
        "ServerName": "localhost,3306",
        "DatabaseName": "bold_bi_19_04",
        "UserName": "sa",
        "Password": "sa@1234",
        "IsNewDatabase": "true",
        "ServerType": 0,
        "SslEnabled": "false"
      }
  3. How to use the new database?
    Set IsNewDatabase as true under ServerConfiguraton.Database and DataStoreConfiguration objects as shown below and provide the new database credentials.

    {
      "ServerConfiguration": {
        "Database": {
          "ServerName": "localhost,3306",
          "DatabaseName": "bold_bi_19_04",
          "UserName": "sa",
          "Password": "sa@1234",
          "IsNewDatabase": "true",
          "ServerType": 0,
          "SslEnabled": "false"
        }
      },
      "DataStoreConfiguration": {
        "ServerName": ".",
        "DatabaseName": "bold_bi_19_04",
        "UserName": "sa",
        "Password": "sa@1234",
        "IsNewDatabase": "true",
        "ServerType": 0,
        "SslEnabled": "false"
      }
    }
  4. How to use an existing database?
    Set IsNewDatabase as false and provide the corresponding database credentials.

  5. How to use Local Storage?
    Set StorageType as 0 in the Storage object to mention the local file storage as shown below."Storage":

    {
        "StorageType":0,​​
    }
  6. How to use Azure Blob Storage?
    Set StorageType as 1 in the Storage object to mention the type of storage is Azure blob and provide the credentials.

    "Storage" :

    {

        "StorageType":1,

        "AzureBlob":

        {

            "AzureBlobStorageContainerName": "string",

            "AzureBlobStorageUri": "string",

            "ConnectionString": "string",

            "ConnectionType": "string",

            "AccountName": "string",

            "AccessKey": "string"

    }

    }

  7. Can I use the same database for Site and Data Store?
    Yes, you can use the same database for the site and Datastore.

  8. What are Custom Attributes? How to pass the custom attributes?
    Custom attribute is a piece of code that acts like a parameter, which is replaced anywhere in the query varied by the users. Refer to this help document link to know more information. You can pass the custom attribute in this API request as shown below.
  9. {
      "Site": {
        "TenantName": "Production",
        "TenantIdentifier": "production",
        "UseSiteIdentifier": true,
        "TenantType": 3,
        "UseCustomBranding": true,
        "CustomAttribute": [
          {
            "Name": "Name of the attribute",
            "Value": "Value of attribute",
            "Description": "Description of the attribute",
            "CanEncrypt": true
          }
        ]
      }
    }
  10. What is Isolation Code? How to pass the isolation code?
    Isolation code feature is to configure row-level security for the site level to apply all dashboards on the site. Refer to this link to know more information. You can pass the Isolation code in this API request as shown below.

    {
      "Site": {
        "TenantName": "Production",
        "TenantIdentifier": "production",
        "UseSiteIdentifier": true,
        "TenantType": 3,
        "UseCustomBranding": true,
        "TenantIsolation": {
          "IsEnabled": true,
          "IsolationCode": "Plac​e your code here"
        }
      }
    }
  11. What is the purpose of the AdditionalParameters parameter?
    In some cases, you may want to pass other parameters like TrustServerCertificate=true. So that you can pass the additional parameters as shown below.
{​
"ServerConfiguration": {
    "Database": {
      "ServerName": "string",
      "DatabaseName": "string",
      "UserName": "string",
      "Password": "string",
      "IsNewDatabase": "false",
      "MaintenanceDatabase": "string",
      "Port": "string",
      "ServerType": 0,
      "SslEnabled": "false",
      "AdditionalParameters": "Place your addtional parameter here"
    }
  },
  "DataStoreConfiguration": {
    "ServerName": "string",
    "DatabaseName": "string",
    "UserName": "string",
    "Password": "string",
    "IsNewDatabase": "false",
    "MaintenanceDatabase": "string",
    "Port": "string",
    "ServerType": 0,
    "SslEnabled": "false",
    "AdditionalParameters": "Place your addtional parameter here"
  }
}
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