PHP code example of millermedia / brink-php

1. Go to this page and download the library: Download millermedia/brink-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

millermedia / brink-php example snippets


		$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();

		$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);

    $ composer