PHPackages                             gpsinsight/api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. gpsinsight/api-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gpsinsight/api-client
=====================

GPS Insight API client library

0.1.0(9y ago)51.3k2[2 issues](https://github.com/gpsinsight/api-v2-client-php/issues)Apache 2.0PHPPHP &gt;=5.5.0CI failing

Since Mar 28Pushed 6y ago5 watchersCompare

[ Source](https://github.com/gpsinsight/api-v2-client-php)[ Packagist](https://packagist.org/packages/gpsinsight/api-client)[ RSS](/packages/gpsinsight-api-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

GPS Insight API Client Library for PHP
======================================

[](#gps-insight-api-client-library-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/71510bfdf870813efabaaf1635e87edf16273c48684b5c7d1a57cf77e39e9ce0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677073696e73696768742f6170692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gpsinsight/api-client)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/f334a6e02ca8083de4c1f2ace56876d2963905c686905b0db34606d8c74f641e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f677073696e73696768742f6170692d76322d636c69656e742d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/gpsinsight/api-v2-php-client)

This is the official PHP client library for interacting with the **GPS Insight API (V2)**.

[![GPS Insight logo](https://camo.githubusercontent.com/4833d06c80d37e8b0acbdb47cc26f7a28918db3a69ed6fc2fa465e8bc2d57325/687474703a2f2f7777772e677073696e73696768742e636f6d2f617069646f63732f696d616765732f677073695f6c6f676f5f666c61742e706e67)](http://www.gpsinsight.com/)

[GPS Insight](http://www.gpsinsight.com/) provides vehicle fleet GPS tracking and FMCSA-compliant electronic logging devices (ELD) for regulating hours of service (HOS). GPS Insight's API (V2) provides a programmatic way to push your fleet's data from our system to your back-end systems (e.g., ERP, Dispatch, CRM). By using our API you can effortlessly integrate your fleet's data into your back-end systems to provide transparency into payroll, fuel card transactions, additional documentation, asset management, and more.

The [GPS Insight API documentation](http://www.gpsinsight.com/apidocs/) is hosted on our website. Be sure to sign up for an account and follow the directions to get API credentials before using this library.

Installation
------------

[](#installation)

This package is hosted on [Packagist](https://packagist.org/packages/gpsinsight/api-client) and is installable via [Composer](https://getcomposer.org/).

### Requirements

[](#requirements)

- PHP version 5.5 or greater (5.6+ recommended)
- Composer (for installation)
- [Guzzle](http://docs.guzzlephp.org/) is installed automatically as a dependency and requires one of the following to make HTTP requests:
    - A recent version of cURL (minimum 7.19.4) compiled with OpenSSL and zlib.
    - Enable `allow_url_fopen` in your system's `php.ini`.

### Installing Via Composer

[](#installing-via-composer)

Run the following command (assuming `composer` is available in your PATH):

```
$ composer require gpsinsight/api-v2-client
```

This will set the **GPS Insight API Client Library** as a dependency in your project and install it.

When bootstrapping your application, you will need to require `'vendor/autoload.php'` in order to setup autoloading for the GPS Insight API Client Library and any of your other Composer-installed packages.

Basic Usage
-----------

[](#basic-usage)

### Code

[](#code)

```
use GpsInsight\Api\V2\GpsInsight;

// Create and configure an SDK object
$gpsInsight = new GpsInsight([
    'username'  => 'johndoe3000',
    'app_token' => '490f5ed342ca8',
]);

// Call the "create" method of the "driver" service
// Note: API authentication is applied automatically by the client library
$result = $gpsInsight->driver->create([
    'lastname' => 'Lindblom',
    'firstname' => 'Jeremy',
    'email' => 'jlindblom@example.com',
    'timezone' => 'US/Arizona',
]);

print_r($result->getData());
```

### Output

[](#output)

```
Array
(
    [id] => 4551485
    [message] => Driver added
)

```

Additional Usage
----------------

[](#additional-usage)

If you are using an IDE like PhpStorm that supports intellisense, the names of services and operations will autocomplete for you. For parameters, you should consult the official [GPS Insight API documentation](http://www.gpsinsight.com/apidocs/).

Concepts
--------

[](#concepts)

### Classes

[](#classes)

All classes are in the root namespace of `GpsInsight\Api\V2`.

- `GpsInsight` – The starting point to the library (as seen above in the example). Users can access the various available services via readonly, intellisense-ready properties (e.g., `$gpsInsight->driver`, `$gpsInsight->landmark`)
- `ServiceClient` – Encapsulates APIs for a particular service (e.g., `$gpsInsight->driver->create()`)
- `Client` – A `guzzlehttp/command`-powered client that is used by the `GpsInsight` and various `ServiceClient`classes
- `Result` – An `ArrayAccessible` object that encapsulates the parsed data from an API response. It is returned as the result of any API call (e.g., `$result = $gpsInsight->driver->create(); echo $result['message'];`)
- `Services` – A class containing the list of valid services names
- `Middleware` – The `Middleware` directory contains `guzzlehttp/command` middleware that are used to perform transformations on the command or result prior to them being serialized to a request or response. For example, auth is handled via a middleware, as is applying an app channel.

### Configuration

[](#configuration)

When instantiating the `GpsInsight` class, you must provide configuration options to setup the API client. The following settings are allowed:

- **app\_token** (`string`, *conditionally required †*) – GPS Insight API "App Token", which acts as a credential for a specific application
- **channel** (`string`, *recommended*) – An identifier to tag your requests with for your application. You can then retrieve stats about your application's API usage with the [channel APIs](http://www.gpsinsight.com/apidocs/#/service/channel)
- **endpoint** (`string`, *optional*) – Base URL endpoint for accessing the GPS Insight API. Defaults to the production GPS Insight API endpoint: ""
- **http\_handler** (`callable`, *optional*) – Custom or shared Guzzle HTTP handler. See docs for `handler` in the [Guzzle documentation for "Creating a Client"](http://docs.guzzlephp.org/en/latest/quickstart.html#creating-a-client)
- **http\_options** (associative `array`, *optional*) – A set of Guzzle HTTP request options. See docs for [Request Options in the Guzzle Documentation](http://docs.guzzlephp.org/en/latest/request-options.html)
- **password** (`string`, *conditionally required †*) – GPS Insight API account password
- **session\_token** (`string`, *conditionally required †*) – GPS Insight API "session token"
- **token\_cache** (`TokenCacheInterface`, *recommended*) – A token cache for storing/retrieving session tokens.
- **username** (`string`, *required*) – GPS Insight API account username
- **version** (`string`, *recommended*) – A version number to tag your requests with for your application. Use this with in combination with `channel`
- **wire\_log** (`bool|LoggerInterface`, *optional*) – Use this to enable wire logging for debugging purposes. Set to `true` for the default logger that writes to `STDOUT`, or provide a PSR-3 compliant `LoggerInterface`

† You must provide at least one of `app_token`, `password`, or `session_token` along with your `username`to authenticate to the GPS Insight API. For more information about API credentials, please read the [GPS Insight API documentation](http://www.gpsinsight.com/apidocs/).

#### Advanced Example

[](#advanced-example)

```
use GpsInsight\Api\V2\GpsInsight;
use GpsInsight\Api\V2\TokenCache\CallbackCache as TokenCallbackCache;

// Create and configure an SDK object
$gpsInsight = new GpsInsight([
    'username'  => 'johndoe3000',
    'app_token' => '490f5ed342ca8',
    'channel' => 'my_custom_app',
    'version' => '2.10.1',
    'token_cache' => new TokenCallbackCache(
        function ($key) {
            return isset($_SESSION['gpsinsight_tokens'][$key])
                ? $_SESSION['gpsinsight_tokens'][$key]
                : null;
        },
        function ($key, $token) {
            $_SESSION['gpsinsight_tokens'][$key] = $token;
        }
    ),
]);
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  directly instead of using the issue tracker. This allows us to take appropriate actions to mitigate the issues as quickly as possible.

Credits
-------

[](#credits)

- [Jeremy Lindblom](https://github.com/jeremeamia)
- [Jennifer Dearing](https://github.com/jdearing11)
- [Grant Anderson](https://github.com/pendenga)
- [Drew LeSueur](https://github.com/drewlesueur)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27fbb3bb3008265520daa337334fb9b3ae57bb282bc7d4785784bf8be1d7d855?d=identicon)[pendenga](/maintainers/pendenga)

---

Top Contributors

[![jeremeamia](https://avatars.githubusercontent.com/u/107867?v=4)](https://github.com/jeremeamia "jeremeamia (10 commits)")[![pendenga](https://avatars.githubusercontent.com/u/29118?v=4)](https://github.com/pendenga "pendenga (1 commits)")[![remote-coder](https://avatars.githubusercontent.com/u/4411605?v=4)](https://github.com/remote-coder "remote-coder (1 commits)")

---

Tags

api-clientfleet-trackinggpsgps-insightguzzlephp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/gpsinsight-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/gpsinsight-api-client/health.svg)](https://phpackages.com/packages/gpsinsight-api-client)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k853.6M8.4k](/packages/symfony-http-kernel)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M719](/packages/sylius-sylius)[guzzlehttp/guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

25711.0M188](/packages/guzzlehttp-guzzle-services)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k34](/packages/neuron-core-neuron-ai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
