Working with Events

You can retrieve details of your events, venues and dates through the TicketSource API. This guide will go through the necessary calls to retrieve this information which can be used to build listings pages or to integrate with your own content management systems.

If you haven't already, you should go through our getting started guide for instructions on obtaining credentials and how to authenticate with the API.

Events

You can retrieve a list of the events on your TicketSource account by querying the /events endpoint.

Sample Request:

$curl = curl_init('https://api.ticketsource.io/events');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer '.'skl-xxxxxxxxxx'
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl);
$events = json_decode($response);

Sample Response:

{
    "data": [
        {
            "id": "evt-xxxxxxxxxx1",
            "type": "event",
            "attributes": {
                "name": "Sample Event: unallocated tickets",
                "reference": "SAMPLEEVENT1",
                "description": "<p>An event which demonstrates the sale of unallocated (i.e. unnumbered) tickets.</p>",
                "comment": "Children must be accompanied by a paying adult",
                "keywords": null,
                "terms": null,
                "category": "livemusic",
                "genre": "dance",
                "images": [
                    {
                        "type": "thumbnail",
                        "src": "https://cdn.ticketsource.co.uk/images/promoter/banner/0001-CZBGTjQn.png"
                    }
                ],
                "third_party_consent": {
                    "capture": true,
                    "name": "Sample visiting group",
                    "show_consent": {
                        "email": true,
                        "post": false,
                        "sms": false
                    }
                },
                "activated": true,
                "archived": false,
                "public": true,
                "created_at": "2019-02-12T10:58:34+00:00",
                "updated_at": null
            },
            "links": {
                "self": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1",
                "venues": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1/venues",
                "dates": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1/dates"
            }
        },
        {
            ...
        }
    ],
    "links": {
        "first": "https://api.ticketsource.io/events?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.ticketsource.io/events?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.ticketsource.io/events",
        "per_page": 10,
        "to": 10
    }
}

Filtering events

You can filter events on the following properties:

Property Operators Notes
activated
  • eq
  • any
if using eq, value must be true or false.
archived
  • eq
  • any
if using eq, value must be true or false.
public
  • eq
  • any
if using eq, value must be true or false.
settled
  • eq
  • any
if using eq, value must be true or false.
Note: Requests that do not specify a settled filter default to filter[settled][operator]=eq and filter[settled][value]=false.
created_at
  • on
  • before
  • after
  • between
value must be a date (2019-01-01), value2 must also be provided if using between.
updated_at
  • on
  • before
  • after
  • between
value must be a date (2019-01-01), value2 must also be provided if using between.

Venues

You can retrieve a list of all Venues for a particular Event by querying the /events/evt-xxxxxxxxxx1/venues endpoint for a particular Event resource.

Sample Request:

$curl = curl_init('https://api.ticketsource.io/events/evt-xxxxxxxxxx1/venues');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer '.'skl-xxxxxxxxxx'
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl);
$venues = json_decode($response);

Sample Response:

{
    "data": [
        {
            "id": "ven-xxxxxxxxxx1",
            "type": "venue",
            "attributes": {
                "name": "TicketSource Theatre",
                "address": {
                    "line_1": "Off Edge",
                    "line_2": "Station Approach",
                    "line_3": "Penarth",
                    "line_4": "",
                    "postcode": "CF64 3EE"
                },
                "boxoffice": {
                    "telephone": "03336664466",
                    "email": "support@ticketsource.co.uk"
                },
                "created_at": "2019-02-12T10:58:34+00:00",
                "updated_at": null
            },
            "links": {
                "self": "https://api.ticketsource.io/venues/ven-xxxxxxxxxx1",
                "dates": "https://api.ticketsource.io/venues/ven-xxxxxxxxxx1/dates"
            }
        }
    ],
    "links": {
        "first": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1/venues?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1/venues",
        "per_page": 10,
        "to": 1
    }
}

Dates

You can retrieve a list of all Dates for a particular Venue by querying the /venues/ven-xxxxxxxxxx1/dates endpoint for that Venue resource.

Sample Request:

$curl = curl_init('https://api.ticketsource.io/venues/ven-xxxxxxxxxx1/dates');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer '.'skl-xxxxxxxxxx'
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl);
$dates = json_decode($response);

Sample Response:

{
    "data": [
        {
            "id": "dat-xxxxxxxxxx1",
            "type": "date",
            "attributes": {
                "doors_open": "2021-12-28T14:00:00+00:00",
                "start": "2021-12-28T14:30:00+00:00",
                "end": null,
                "on_sale": true,
                "on_sale_start": "2020-03-20T10:00:00+00:00",
                "on_sale_end": "2021-12-27T22:00:00+00:00",
                "cancelled": false,
                "created_at": "2020-02-12T10:58:34+00:00",
                "updated_at": "2020-02-14T11:42:57+00:00"
            },
            "links": {
                "self": "https://api.ticketsource.io/dates/dat-xxxxxxxxxx1",
                "book_now": "https://www.ticketsource.co.uk/booking/penarth/ticketsource-hq/test-event/2020-02-12/14:30",
                "bookings": "https://api.ticketsource.io/dates/dat-xxxxxxxxxx1/bookings",
                "event": "https://api.ticketsource.io/events/evt-xxxxxxxxxx1",
                "venue": "https://api.ticketsource.io/venues/ven-xxxxxxxxxx1"
            }
        }
    ],
    "links": {
        "first": "https://api.ticketsource.io/venues/ven-xxxxxxxxxx1/dates?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.ticketsource.io/venues/ven-xxxxxxxxxx1/dates",
        "per_page": 10,
        "to": 1
    }
}

Filtering dates

You can filter dates on the following properties:

Property Operators Notes
start
  • on
  • before
  • after
  • between
value must be a date (2019-01-01), value2 must also be provided if using between.
created_at
  • on
  • before
  • after
  • between
value must be a date (2019-01-01), value2 must also be provided if using between.
updated_at
  • on
  • before
  • after
  • between
value must be a date (2019-01-01), value2 must also be provided if using between.
Menu