Get template query information
Description
Retrieves detailed template query information.
Request URL
Method: POST
https://example.com/api/v1.1/datatables/query_templates/get
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| id | int | 1 | Yes, if shortname is not specified | Query ID |
| shortname | string | "query1" | Yes, if id is not specified` | Query shortname |
Request example
- JSON
- XML
{
"id": 2,
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<id>2</id>
<token>abcdefghijklmnqrstuvwxyz</token>
</xml>
Response example
- JSON
- XML
{
"data": {
"id": 2,
"name": "QueryforextDB",
"shortname": "query",
"description": "External DB segment",
"sql": "SELECT * FROM table",
"connector_id": 1
},
"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>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response example
| 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 – [] |