Execute a query on the public data model

Content

Resource URL

https://apps.ticketmatic.com/api/1/{accountname}/tools/queries

Description

Use this method to execute random (read-only) queries on the public data model. Note that this is not meant for long-running queries or for returning large resultsets. If the query executes too long or uses too much memory, an exception will be returned.

Example

Request

1use Ticketmatic\Endpoints\Tools;
2
3$result = Tools::queries($client, array(
4    "limit" => 250,
5    "offset" => 500,
6    "query" => "SELECT * FROM tm.paymentscenario",
7));

Response

 1object(\Ticketmatic\Model\QueryResult) (2) {
 2  ["nbrofresults"]=>
 3  int(0)
 4  ["results"]=>
 5  array(2) {
 6    [0]=>
 7    array(2) {
 8      ["id"]=>
 9      float(123.000000)
10      ["name"]=>
11      string(4) "Cash"
12    }
13    [1]=>
14    array(2) {
15      ["id"]=>
16      float(124.000000)
17      ["name"]=>
18      string(11) "Credit Card"
19    }
20  }
21}

Request body fields

FieldDescription
limit
int 
(required)

Optional limit for the result. Default 100

Example value:250
offset
int 
(required)

Optional offset for the result. Default 0

Example value:500
query
string 
(required)

Actual query to execute

Example value:"SELECT * FROM tm.paymentscenario"

Type reference: QueryRequest

Result fields

FieldDescription
nbrofresults
int

The number of rows in the result

Example value:723
results
map<string, mixed>[]

The actual resulting rows

Example value:[ { "id": 123.000000, "name": "Cash" }, { "id": 124.000000, "name": "Credit Card" } ]

Type reference: QueryResult