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>",
                "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
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": "2018-12-28T14:00:00+00:00",
                "start": "2018-12-28T14:30:00+00:00",
                "end": null,
                "on_sale": true,
                "cancelled": false,
                "created_at": "2019-02-12T10:58:34+00:00",
                "updated_at": null
            },
            "links": {
                "self": "https://api.ticketsource.io/dates/dat-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
    }
}
Menu