millermedia / brink-php
A PHP wrapper to the Brink API
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/millermedia/brink-php
This package is auto-updated.
Last update: 2025-10-15 05:11:49 UTC
README
Install the PHP Package
$ composer require millermedia/brink-php
Using the API
- 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();
- 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);