Getting Events from Tixstock You Don't Currently Have

By default, when navigating our "Get Events" endpoint, you will notice events in our system with no ID's associated with them and a "mapped_status" of "false", these are events that have not yet been matched/mapped with your system.

{
    "data": [
        {
            "id": "",
            "name": "Dummy Event",
            "currency": "GBP",
            "commission_percentage_fee": null,
            "datetime": "2021-09-27T13:55:00+0000",
            "status": "Active",
            "venue": {
                "id": "",
                "name": "Old Trafford",
                "address_line_1": "Sir Matt Busby Way",
                "address_line_2": "Trafford",
                "city": "Greater Manchester",
                "state": "",
                "postcode": "M16 0RA",
                "country_code": "GB"
            },
            "use_tixstock_venue_details": "false",
            "venue_details": [
                {
                    "id": "",
                    "name": "East Stand Lower",
                    "sections": [
                        {
                            "id": "",
                            "name": "East Stand Lower A"
                        }
                    ]
                }
            ],
            "performers": [
                {
                    "id": "",
                    "name": "Manchester United FC"
                },
                {
                    "id": "",
                    "name": "Manchester City FC"
                }
            ],
            "category": {
              "name": "Football",
              "upcoming_events": 908,
              "parent": {
                "name": "Sport",
                "parent": []
              }
            },
            "mapped_status": "false"
        }
    ],
    "meta": {
        "mode": "Production",
        "type": "event.get",
        "current_page": 1,
        "from": 1,
        "path": "https://api.tixstock.com/v1/events/get",
        "per_page": 1,
        "to": 1,
        "bearer_token_id": "[Your Bearer Token ID]",
        "reseller_id": "[Your Reseller ID]",
        "ip": "[Your IP Address]",
        "request_id": "[Request ID]"
    },
    "links": {
        "self": "link-value",
        "first": "https://api.tixstock.com/v1/events/get?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.tixstock.com/v1/events/get?page=2"
    }
}

To match these events with your system, we require you to loop through the ones you require and take a copy of this data to input it into your system.

/*
*
* PHP code example for getting events from the Tixstock System.
*
*/

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.tixstock.com/v1/events/get?page=1');
$request->setRequestMethod('GET');
$request->setHeaders(
    array(
      'Content-Type' => 'application/json',
      'Authorization' => 'Bearer [Your Bearer Token]'
    )
);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

The above code example will bring back the first page of events, using this we will return a "links" array with a "next" page. On the Get Events endpoint you can send across a "page" argument in order to paginate these results, by default we will send 10 results per page.

When you have found an event that in not currently in your system we require you to take a copy of this data and send it back to us using the Add Event endpoint like below with you relevant ID's

/*
*
* PHP code example for adding events to the Tixstock System.
*
*/
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.tixstock.com/v1/v1/events/add/1');
$request->setRequestMethod('POST');

$body = new http\Message\Body;
$body->append('{
    "name": "Dummy Event",
    "currency": "GBP",
    "commission_percentage_fee": null,
    "datetime": "2021-09-27T13:55:00+0000",
    "status": "Active",
    "venue": {
        "id": "1",
        "name": "Old Trafford",
        "address_line_1": "Sir Matt Busby Way",
        "address_line_2": "Trafford",
        "city": "Greater Manchester",
        "state": "",
        "postcode": "M16 0RA",
        "country_code": "GB"
    },
    "use_tixstock_venue_details": 0,
    "venue_details": [
        {
            "id": "1",
            "name": "East Stand Lower",
            "sections": [
                {
                    "id": "1",
                    "name": "East Stand Lower A"
                }      
            ]
        }
    ],
    "performers": [
        {
            "id": "1",
            "name": "Manchester United FC"
        },
        {
            "id": "2",
            "name": "Manchester City FC"
        }
    ],
    "category": "Football"
}');

$request->setBody($body);

$request->setHeaders(array(
  'Authorization' => 'Bearer [Your Bearer Token]',
  'Content-Type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Once we receive this from you, navigating the "Get Events" endpoint again will now return the same results however we will now populate the ID's with your own.

{
    "data": [
        {
            "id": "1",
            "name": "Dummy Event",
            "currency": "GBP",
            "commission_percentage_fee": null,
            "datetime": "2021-09-27T13:55:00+0000",
            "status": "Active",
            "venue": {
                "id": "1",
                "name": "Old Trafford",
                "address_line_1": "Sir Matt Busby Way",
                "address_line_2": "Trafford",
                "city": "Greater Manchester",
                "state": "",
                "postcode": "M16 0RA",
                "country_code": "GB"
            },
            "use_tixstock_venue_details": "false",
            "venue_details": [
                {
                    "id": "1",
                    "name": "East Stand Lower",
                    "sections": [
                        {
                            "id": "1",
                            "name": "East Stand Lower A"
                        },
                    ]
                }
            ],
            "performers": [
                {
                    "id": "1",
                    "name": "Manchester United FC"
                },
                {
                    "id": "2",
                    "name": "Manchester City FC"
                }
            ],
            "category": {
                "name": "Football",
                "upcoming_events": 908,
                "parent": {
                    "name": "Sport",
                    "parent": []
                }
            },
            "mapped_status": "true"
        }
    ],
    "meta": {
        "mode": "Production",
        "type": "event.get",
        "current_page": 1,
        "from": 1,
        "path": "https://api.tixstock.com/v1/events/get",
        "per_page": 1,
        "to": 1,
        "bearer_token_id": "[Your Bearer Token ID]",
        "reseller_id": "[Your Reseller ID]",
        "ip": "[Your IP Address]",
        "request_id": "[Request ID]"
    },
    "links": {
        "self": "link-value",
        "first": "https://api.tixstock.com/v1/events/get?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.tixstock.com/v1/events/get?page=2"
    }
}

You will also now be able to search the API using your event ID's, venues, and performers.