Get template queries list
Description
Retrieves template queries list.
Request URL
Method: POST
https://example.com/api/v1.1/datatables/query_templates/list
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| from_id | int | 1 | No | First mailing in the list ID. By default – 1 |
| groups | []String | [ "group1", "group2" ] | No | List of access groups |
| groups_id | []int | [ 0, 1 ] | No | List of access groups IDs |
Request example
- JSON
- XML
{}
<xml>
</xml>
Response example
- JSON
- XML
{
"data": {
"id": 2,
"name": "QueryforextDB",
"shortname": "query",
"description": "External DB segment",
"sql": "SELECT * FROM table",
"connector_id": 1,
"batch_enabled": true,
"batch_size": 50,
"batch_timeout": 5,
"batch_mapping_column": "crm_id"
},
"error": 0,
"error_text": "Successful operation",
}
<xml>
<data>
<connector_id>1</connector_id>
<description>External DB segment</description>
<id>2</id>
<name>QueryforextDB</name>
<shortname>query</shortname>
<sql>SELECT * FROM table</sql>
<batch_enabled>true</batch_enabled>
<batch_size>50</batch_size>
<batch_timeout>5</batch_timeout>
<batch_mapping_column>crm_id</batch_mapping_column>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| id | int | Query ID |
| name | string | Query name |
| shortname | string | Query shortname |
| description | string | Query description |
| connector_id | int | External DB ID |
| sql | string | SQL query |
| groups_id | []int | List of group IDs to search for default – [] |
| batch_enabled | bool | Whether batch mode is enabled |
| batch_size | int | Batch size: the number of profiles combined into one SQL query |
| batch_timeout | int | Batch timeout in seconds |
| batch_mapping_column | string | The query result column by which the platform distributes rows between profiles |