Skip to main content

Update template query

Description

Update template query.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
idint1YesQuery ID
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",
"id": 1,
"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_idintUpdated query ID