2017 © Pedro Peláez
 

library fleetlog-php

Simple PHP Wrapper for Fleetlog API v2 calls

image

fleetlog/fleetlog-php

Simple PHP Wrapper for Fleetlog API v2 calls

  • Thursday, December 17, 2015
  • by visvk
  • Repository
  • 5 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

fleetlog-php

Fleetlog API wrapper, (*1)

  • Include the class in your PHP code
  • Set your access_token to FleetlogAPI
  • Make request

Installation

Normally: Include TwitterAPIExchange.php in your application., (*2)

Composer: Add to your composer.json file to have FleetlogAPI.php automatically imported into your vendors folder:, (*3)

{
    "require": {
        "fleetlog/fleetlog-php": "dev-master"
    }
}

Of course, you'll then need to run php composer.phar update., (*4)

How To Use

Include the class file

require_once('FleetlogAPI.php');

Obtain an access token (client_credentials grant)

$body = array(
    'grant_type' => 'client_credentials',
    'client_id' => 'yourCLientId',
    'client_secret' => 'yourClientSecret'
);

$customHeaders = ['Content-type: application/x-www-form-urlencoded'];
$fleetlog = new \FleetlogAPI();
$resultBody = $fleetlog->request('token', 'POST', $body, $customHeaders);
echo json_encode($resultBody);

$fleetlog->setAccessToken($resultBody->access_token);
$vehicles =  $fleetlog->request('vehicles', 'GET');
echo json_encode($vehicles);

GET Request Example

[GET] https://api.fleetlog.com.au/v2/vehicles/222, (*5)

$settings = array(
    'oauth_access_token' => "your_access_token",
);

$requestMethod = 'GET';
$fleetlog = new FleetlogAPI($settings);
echo json_encode($fleetlog->request('vehicles/222', 'GET'));

[GET] https://api.fleetlog.com.au/v2/vehicles/222/positions, (*6)

$settings = array(
    'oauth_access_token' => "your_access_token",
);

$requestMethod = 'GET';
$fleetlog = new FleetlogAPI($settings);
echo json_encode($fleetlog->request('vehicles/222/positions', 'GET'));

The Versions

17/12 2015

dev-master

9999999-dev https://github.com/fleetlog/fleetlog-php

Simple PHP Wrapper for Fleetlog API v2 calls

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

by Viktor Sincak

api php fleetlog

17/12 2015

v0.0.3

0.0.3.0 https://github.com/fleetlog/fleetlog-php

Simple PHP Wrapper for Fleetlog API v2 calls

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

by Viktor Sincak

api php fleetlog