2017 © Pedro Peláez
 

library php-api-client

A PHP client to use the Ticketpark API

image

ticketpark/php-api-client

A PHP client to use the Ticketpark API

  • Wednesday, January 4, 2017
  • by ticketpark
  • Repository
  • 2 Watchers
  • 0 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

Ticketpark PHP API Client

Build Status, (*1)

A PHP client to consume the Ticketpark REST API., (*2)

Installation

Add this library to your composer.json:, (*3)

composer require ticketpark/php-api-client

Usage

Also see example.php., (*4)

Getting data (GET)

<?php

include('vendor/autoload.php');

$client = new \Ticketpark\ApiClient\TicketparkApiClient('yourApiKey', 'yourApiSecret');
$client->setUserCredentials('your@username.com', 'yourPassword');

$response = $client->get('/events/', ['maxResults' => 2]);

if ($response->isSuccessful()) {
    $data = $response->getContent();
}

Creating data (POST)

<?php

include('vendor/autoload.php');

$client = new \Ticketpark\ApiClient\TicketparkApiClient('yourApiKey', 'yourApiSecret');
$client->setUserCredentials('your@username.com', 'yourPassword');

$response = $client->post('/events/', [
    'host' => 'yourHostPid',
    'name' => 'Some great event',
    'currency' => 'CHF'
]);

if ($response->isSuccessful()) {
    $pidOfNewEvent = $response->getGeneratedPid();

    // if you created a collection of records, the response will contain a link instead
    // that can be used to fetch the data of the newly generated records.
    //
    // $path = $response->getGeneratedListLink();
    // $newResponse = $client->get($path);
}

Updating data (PATCH)

<?php

include('vendor/autoload.php');

$client = new \Ticketpark\ApiClient\TicketparkApiClient('yourApiKey', 'yourApiSecret');
$client->setUserCredentials('your@username.com', 'yourPassword');

$response = $client->patch('/events/yourEventPid', [
    'name' => 'Some changed event name'
]

if ($response->isSuccessful()) {
    // Data was successfully updated
}

API credentials

Get in touch to get your API credentials:
support@ticketpark.ch, (*5)

The Versions

04/01 2017

dev-master

9999999-dev

A PHP client to use the Ticketpark API

  Sources   Download

MIT

The Requires

 

by Avatar ticketpark

04/01 2017

1.1

1.1.0.0

A PHP client to use the Ticketpark API

  Sources   Download

MIT

The Requires

 

by Avatar ticketpark

17/09 2016

1.0

1.0.0.0

A PHP client to use the Ticketpark API

  Sources   Download

MIT

The Requires

 

by Avatar ticketpark

15/01 2016

0.1

0.1.0.0

A PHP client to use the Ticketpark API

  Sources   Download

MIT

The Requires

 

by Avatar ticketpark