List Available Queries

Sample Request

curl -s "https://api.talkdeskapp.com/live-queries" \
     -H 'Authorization: Bearer Eq50QzrNj3n2udPdX0NlZ7yL4thiXHj7=' \
     -H 'Content-Type: application/json'
const axios = require('axios');

const AUTH_TOKEN = 'Eq50QzrNj3n2udPdX0NlZ7yL4thiXHj7=';
const URL = 'https://api.talkdeskapp.com/styx-queries';

let authStr = 'Bearer '.concat(AUTH_TOKEN);

axios.get(URL, { headers: { Authorization: authStr } })
  .then(response => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log('error ' + error);
  });
  • Each object in the queries array represents a metric available for subscription. The exact semantics of each query object depends on its underlying business logic.

  • The id field on each query object is required for creating a subscription on the corresponding metric.

  • The filters field dictates the rules for identifying the subset of data to be used for calculation.

  • params is a list of query parameters. Each one may have a default value and, if applicable, a hard limit. If a parameter does not have a default value, the hard limit is mandatory.

Example of a filters Descriptor

...
"filters": [
  {
    "name": "ring_groups",
    "json_map": true,
    "default": null
  },
  {
    "name": "range__from",
    "default": null
  },
  {
    "name": "range__interval",
    "default": null
  }
]
...

Example of a Valid Corresponding filters Field in a Subscription Request

...
"filters": {
  "range": {
    "type": "from",
    "from": "2019-04-29 14:39:43.000"
  },
  "ring_groups": ["agents"]
}
...
  • Types: from or interval.
  • Filters with attribute "json_map": true expect JSON objects in the subscription creation request. In the example above, a JSON array of ring_groups is passed.
  • range filters support two types of ranges: from and interval.
"range": {
  "type": "from",
  "from": "2019-04-29 14:39:43.000"  // selects records after this date up until now
}

or

"range": {
  "type": "interval",
  "interval": 3600      // selects records of the last 3600 seconds
}

Example of the params Descriptor

...
"params": [
  {
    "name": "result_size",
    "limit": 300,
    "default": 300
  }
]
...

Example of a Valid Corresponding params Field in a Subscription Request

...
"params": {
  "result_size": 50        //first 50 records from the query
}
...

Scope

live-queries:read

Language
Click Try It! to start a request and see the response here!