2017 © Pedro Peláez
 

library brink-php

A PHP wrapper to the Brink API

image

millermedia/brink-php

A PHP wrapper to the Brink API

  • Monday, October 16, 2017
  • by kcarwilemiller
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

, (*1)

Install the PHP Package

    $ composer require millermedia/brink-php

Using the API

  1. Login to the api to receive a jwt token that can be used in future requests without the need to reauthenticate
    include("vendor/autoload.php");
    $brink_api = new \MillerMedia\Brink\Brink_API();

    // Login to the api via username and password
    $user_data = array(
        "username" => 'username',
        "password" => 'password'
    );
    $response = $brink_api->login($user_data);

    if (isset($response->error)) {
        // Login Error
        echo $response->error;
        exit;
    }
    $access_token = $response->jwt_token;

    // After logging in using the $brink_api->login() method, the token is already set
    // so additional requests can be handled correctly
    $flights = $brink_api->get_all_flights();
  1. If you already have a jwt token prepared, you can use it when creating the api instance and bypass logging in.
    include("Brink_API.php");
    $brink_api = new Brink_API();

    $token='eyJ0eXAiOiJKV1QiLCJhbGc...';
    $brink_api->access_token = $token;

    // Get all flights
    $flights = $brink_api->get_all_flights();

    // Get details for a specific flights
    $params = array('flight_id' => 12);
    $flight = $brink_api->get_flight($params);

    // Get data points for a specific flight
    $params = array('flight_id'=>15, 'prop' => array('page'=>1, 'per_page'=>5));
    $flight_data = $brink_api->get_flight_data($params);

The Versions

16/10 2017

dev-master

9999999-dev

A PHP wrapper to the Brink API

  Sources   Download

04/10 2017

1.0.2

1.0.2.0

A PHP wrapper to the Brink API

  Sources   Download

04/10 2017

1.0.1

1.0.1.0

A PHP wrapper to the Brink API

  Sources   Download