Category / Section
Creating Custom Connector via API calls in On-Premises using Postman
Published:
This article explains how to create custom connector using API calls in Bold BI On-Premises using Postman.
Overwrite Custom Connector via API
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 below endpoint in postman with POST method
http://localhost:{your port number}/bi/api/site/site1/v4.0/data-sources -
Then add this token in postman Headers with key as Authorization and values as Bearer {Your_token}
-
Add the following format in the Raw Body for Custom connectors:
Syntax
{
"CustomConnectorName": "CC_Name",
"Name": "DS_Name",
"Type": "Web",
"Connection": {
"Url": "Web_Url",
"Method": "Get/Post",
"Parameters": [
{
"key": "Param1",
"value": "Param_value1"
},
{
"key": "Param2",
"value": "Param_value2"
}
],
"RawData": "",
"Headers": [
{
"key": "Header_Key1",
"value": "Key_value1"
},
{
"key": "Header_Key2",
"value": "Key_value2"
}
],
"DataFormat": "Json/Xml",
"AuthenticationType": "BasicHttpAuthentication/None",
"Username": "U_Name",
"Password": "******",
"Variables": [
{
"Name": "variable1",
"Value": "value_one"
},
{
"Name": "variable2",
"Value": "value_two"
}
],
"OpenAPI": {
"URL": "url",
"AuthenticationType": "BasicHttpAuthentication/None",
"UserName": "U_name",
"Password": "******"
},
"IsTableSchemaHidden": "true/false"
}
}
Sample
{
"CustomConnectorName":"OpenAPIOrigiNal",
"Name": "OpenAPIdata",
"Type": "Web",
"Connection": {
"Url": "https://raw.githubusercontent.com/<<:a1>>/<<:a2>>/<<:a3>>/pet/pet",
"Method": "Get",
"DataFormat": "Json",
"AuthenticationType": "BasicHttpAuthentication",
"Username": "syncuser123",
"Password": "##########",
"Variables": [
{
"Name": "variable1",
"Value": "syncuser123"
},
{
"Name": "variable2",
"Value": "MockAPI"
},
{
"Name": "variable3",
"Value": "main"
}
],
"OpenAPI": {
"AuthenticationType": "BasicHttpAuthentication",
}
}
}
- You will get the response like below if the data source is created successfully.
Once the success message is received, the data source will be created and listed in the data source page in Bold BI.
Note
For Custom Connectors,
- If any custom connector JSON property has IsHidden true, you cannot override those properties’ values from the input JSON in the API request.
- Except CustomConnectorName and Name property, every other property is optional provided the Custom Connector JSON has the required properties. You can override the values from the Custom Connector using the input JSON in the API request.
- You cannot add adddtional properties other than the ones available in Custom Connector JSON.
- To enable the TableSchema for the custom connector add “IsTableSchemaHidden” : false.
- There is no IsHidden property for the TableSchema
- The Schema given in the TableSchema will only be considered when the URL/Open API URL given in the Custom Connector returns an empty response (200 OK).