Poll eventstream
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/eventstream
Description
Poll the eventstream.
Example
Request
1use Ticketmatic\Endpoints\Eventstream;
2
3$result = Eventstream::eventstream($client, array(
4 "id" => "0",
5 "eventtypes" => "webshop:add_tickets,webshop:add_products",
6 "ts" => "2022-09-26T09:00:00+0000",
7));
8
9// The parameters array is optional, it can be omitted when empty.
10$result = Eventstream::eventstream($client);
Response
1object(\Ticketmatic\Model\EventstreamResult) (3) {
2 ["moreresults"]=>
3 bool(false)
4 ["nextid"]=>
5 string(1) "0"
6 ["results"]=>
7 NULL
8}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/eventstream"
4)
5
6result, err := eventstream.Eventstream(client, &ticketmatic.EventstreamRequest{
7 Id: "0",
8 Eventtypes: "webshop:add_tickets,webshop:add_products",
9 Ts: "2022-09-26T09:00:00+0000",
10})
11
12// The query object is optional, it can be omitted when empty.
13result, err := eventstream.Eventstream(client, nil)
Response
1result := &ticketmatic.EventstreamResult{
2 Moreresults: false,
3 Nextid: "0",
4 Results: nil,
5}
Request
1GET /api/1/{accountname}/eventstream HTTP/1.1
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "moreresults": false,
6 "nextid": "0",
7 "results": null
8}
Parameters
Field | Description |
---|---|
id required | Minimum id to start reading the stream Example value:"0" |
eventtypes required | Comma separated list of event types to filter on Example value:"webshop:add_tickets,webshop:add_products" |
ts required | Timestamp in ISO-8601 format to start reading the stream, mutually exclusive with the id Example value:"2022-09-26T09:00:00+0000" |
Type reference: EventstreamRequest
Result fields
Field | Description |
---|---|
moreresults bool | The stream possibly contains more events, polling might need to catch up |
nextid string | Id to use as startid in next poll Example value:"0" |
results | The results of polling the stream |
Type reference: EventstreamResult