Connector: Overview of Methods
The connector is a tool for integrating Bitrix24 with external data systems. It is responsible for connecting to third-party APIs and databases, importing data for analytics and reporting.
Each connector contains settings for working with a specific source:
- endpoints — URLs for sending HTTP requests,
- authorization parameters.
Quick navigation: all methods
Methods work only in the context of the application
Connector's Relationship with Sources and Datasets
The connector is the top level in the data hierarchy within the BIconnector module:
- Connector establishes a connection with an external data source.
- Source defines which specific data is available from the connected service.
- Dataset forms the final set of data that can be used in reports and analytics.
Description of Connector Fields
|
Name |
Description |
Read |
Write |
|
id |
Unique identifier of the connector |
✅ |
❌ |
|
title |
Name of the connector |
✅ |
✅ |
|
logo |
URL of the logo or base64 string |
✅ |
✅ |
|
description |
Description of the connector |
✅ |
✅ |
|
sort |
Sorting order |
✅ |
✅ |
|
urlCheck |
✅ |
✅ |
|
|
urlData |
✅ |
✅ |
|
|
urlTableList |
✅ |
✅ |
|
|
urlTableDescription |
✅ |
✅ |
|
|
settings |
✅ |
✅ |
|
|
dateCreate |
Date of connector creation |
✅ |
❌ |
Settings Field
The settings field contains an array of parameters necessary for configuring data sources. Each parameter is an object with the following structure:
code— parameter code, used as the identifier for the parameter, this is how parameters are passed to the external source.name— parameter name, which will be displayed in the interface, in the "Analyst's workspace" section.type— parameter type, currently onlySTRINGis supported.
{
"code": "code_value",
"name": "name_value",
"type": "type_value"
}
Connector Endpoints
urlCheck
The urlCheck endpoint performs two key functions:
- Checks the availability of the connection to the external source.
- Authenticates the user.
The endpoint is called:
- when creating a new connection,
- when editing an existing connection,
- when creating a dataset.
A POST request is sent to the endpoint with the following parameters:
setting_code_n— code of the connector's settings parameter.settings_value_n— value of this parameter related to the specific source.
{
"connection": {
"setting_code_1": "settings_value_1",
...,
"setting_code_n": "settings_value_n"
}
}
Depending on availability, the endpoint returns information about the status of the source. Requirements for the response format from the endpoint to the request from Bitrix24: the response must not be empty, HTTP status: 200. The response format is flexible.
A request to the endpoint for connection verification can be sent from the interface, in the "Analyst's workspace" section.
urlTableList
The urlTableList endpoint returns a list of available tables in JSON format. The endpoint will return tables that match the search query. The endpoint is called when creating a dataset through the interface.
A POST request is sent to the endpoint with the following parameters:
searchString— value of the search string, searches tables byexternalCode.setting_code_n— code of the connector's settings parameter.settings_value_n— value of this parameter related to the specific source.
{
"searchString": "search_value",
"connection": {
"setting_code_1": "settings_value_1",
...,
"setting_code_n": "settings_value_n"
}
}
The response returns an array of objects corresponding to the request, with the structure:
code— name of the dataset that will be used in Bitrix24.title— name of the dataset in the external source. The search is performed based on this field.
{
'code' => 'dataset_name',
'title' => 'externalName'
}
urlTableDescription
The urlTableDescription endpoint returns a list of fields for a specific table in JSON format. The endpoint is called when creating a dataset through the interface.
A POST request is sent to the endpoint with the following parameters:
table—externalCodeof the dataset for which the description is requested.setting_code_n— code of the connector's settings parameter.settings_value_n— value of this parameter related to the specific source.
{
"name": "entityName",
"connection": {
"setting_code_1": "settings_value_1",
...,
"setting_code_n": "settings_value_n"
}
}
The response returns an array of fields with the structure:
code— code of the dataset field.name— name of the dataset field.type— field type, supported values:int,string,double,date,datetime.
{
'code' => "code_value",
'name' => "title_value",
'type' => "type_value"
}
urlData
The urlData endpoint returns data from a specific table in JSON format.
The endpoint is called:
- when creating a dataset through the interface,
- when synchronizing dataset fields through the interface,
- when executing requests to retrieve data for the BI Builder.
A POST request is sent to the endpoint with the following parameters:
select— selection of dataset fields.filter— filter by dataset fields.limit— limit of dataset selection.table—externalCodeof the dataset for which data is requested.setting_code_n— code of the connector's settings parameter.settings_value_n— value of this parameter related to the specific source.
{
"select": **array**,
"filter": **object**,
"limit": **int**,
"table": "entityName",
"connection": {
"setting_code_1": "settings_value_1",
...,
"setting_code_n": "settings_value_n"
}
}
The response returns an array of fields with the structure:
FIELD_N— field code.VALUE_ROW_M_N— values of fieldNin rowM.
[
["FIELD_1","FIELD_2",...,"FIELD_N"],
[VALUE_ROW_1_1,VALUE_ROW_1_2,...,VALUE_ROW_1_N,],
[VALUE_ROW_2_1,VALUE_ROW_2_2,...,VALUE_ROW_2_N,]
...
,[VALUE_ROW_M_1,VALUE_ROW_M_2,...,VALUE_ROW_M_N,]
]
Field Parameters
|
Name |
Description |
|
title |
Field name |
|
type |
Field type |
|
isRequired |
Required field |
|
isReadOnly |
Field is read-only |
|
isImmutable |
Field value can only be set once and only when creating a new element. After that, the field value cannot be changed |
|
isMultiple |
Multiple field. If true, values in the field are passed as an array |
Overview of Methods
Scope:
biconnectorWho can execute methods: user with access to the "Analyst's workspace" section
|
Method |
Description |
|
Adds a new connector |
|
|
Updates an existing connector |
|
|
Returns information about the connector |
|
|
Returns a list of available connectors |
|
|
Deletes a connector |
|
|
Returns the description of the connector fields |