Creating Live Data source via API calls in On-Premises using Postman
This article explains how to create live data sources using API calls in Bold BI On-Premises using Postman.
Creating Live Data Source via API Calls
Follow these steps to create a live data source using API calls:
-
Use the /token API for generating the access token.
Request Body Schema:
username - string (Email address of the user)
password - string (Password of the user)
grant_type - string
The type of credentials used to authorize the request for an access token.
Value allowed is password.
Request Sample
Response Sample
-
Use the following endpoint in Postman with the POST method - http://{your-host:your-port}/bi/api/site/site1/v4.0/datasources
-
Add the token generated above in Headers with the key as Authorization and values as Bearer {Your_token}.
-
Add the API request details in the Raw Body section of this API request in JSON format. Below are the available options:
{
"Name": "Data Source Name",
"Type": "Web",
"Connection": {
"MethodType": "Get" OR "POST",
"DataFormat": "Json", or "XML" OR "CSV",
"Url": "URL TO BE CONNECTED TO GET DATA",
"AuthenticationType": "None",
"Username": "UserName",
"Password": "Password",
"IsLiveWebMode": "true",
"Description": "ANY DESCRIPTION",
"Headers": "KEY-VALUE PAIRS",
"RefreshInterval": "Never",
"Provider": "WEB",
"ProviderType": "Web",
"Rows": "5000",
"Mode": "Live",
"DataProvider": "WEB",
"TableSchema": "Required columns in JSON string or JSON format"
}
}
-
Hit Send to trigger the API. You will receive the below response if the API call is successfully completed.
Once the success message is received, the data source will be created and listed in the data source page in Bold BI.
Sample API call
sample API using northwind
Add the format below in Raw Body section in of this API request in Json format (Web API datasource):
You will get the response like below if the data source is created successfully.