Skip to main content

Add template query

Description

Add template query to external datatables.

Request URL

Method: POST

https://example.com/api/v1.1/datatables/query_templates/add/

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
namestring"Main query"YesQuery name
shortnamestring"query1"YesQuery shortname
descriptionstring"query to the DB"NoQuery description
connector_idint2YesExternal DB ID
sqlstring"SELECT * FROM table"NoSQL query
groups_id[]int[ 0, 1 ]NoList of group IDs to search for
default – []

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"name": "Main Query",
"shortname": "query1",
"sql": "SELECT * FROM table",
"connector_id": 1
}

Response example

{
"data": {
"saved_id": 1
},
"error": 0,
"error_text": "Successful operation",
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idintCreated query ID