Download the PHP package chrisjohnleah/velocity-fleet-api without Composer

On this page you can find all versions of the php package chrisjohnleah/velocity-fleet-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package velocity-fleet-api

Velocity Fleet API — PHP SDK

CI Packagist Version Total Downloads PHP Version

A modern, framework-agnostic PHP SDK for the Radius Velocity Fleet Telematics API, built on Saloon. Bearer authentication, an optional OAuth2 refresh-token flow, typed responses, and transient-error backoff — all baked in.

Using Laravel? Reach for the companion bridge chrisjohnleah/velocity-fleet-api-laravel for a service provider, config, and a persistent token store.

What it covers

The Velocity Telematics API exposes a small, focused surface — and this SDK wraps all of it:

Endpoint SDK
List the customers linked to your user $velocity->customers()->list()
List live device (vehicle) positions for a customer $velocity->devicePositions()->forCustomer($id)

Requirements

Installation

Quick start

With an API token (existing customers)

Generate a token in the Velocity UI under Account → Account Settings → API Integrations → Create API Token, then:

With a refresh token (third-party integrations)

Your customer supplies a Refresh Token. The SDK exchanges it for a short-lived access token on first use (standard OAuth2 refresh_token grant), and refreshes again whenever a call comes back unauthorised:

Reading device positions

Use the right id. The customers response is keyed by each customer's unique id — exposed as Customer::$id. Pass that to forCustomer(), not the human-facing Customer::$number.

Persisting tokens

When you use the refresh-token flow, implement Contracts\TokenStore to keep the rotated token between requests (the in-memory ArrayTokenStore only lives for the current process). The token endpoint may rotate the refresh token, so your put() must always overwrite the previous record:

Errors

Failures surface as typed exceptions, all extending Exceptions\VelocityFleetException:

Exception When
NotConnectedException No token available (and none could be obtained)
AuthenticationException 401 / 403 after a refresh attempt — re-authorise
ApiException Any other API error or transport failure (carries ->status, ->body, ->headers, header(), and retryAfter())

A note on authentication details

The Velocity API is a Django REST Framework service using Bearer (SimpleJWT) access tokens, with token issuance via an OAuth2 endpoint (django-oauth-toolkit). The third-party refresh-token exchange isn't part of the public reference, so the SDK targets the standard OAuth2 refresh_token grant at https://www.velocityfleet.com/o/token/ by default. If your integration documents a different token endpoint or client-authentication requirement, pass it through VelocityFleetConnector (tokenEndpoint, clientId, clientSecret) — no code changes needed.

Sending raw requests

Anything not yet wrapped in a resource can be sent through the client, which still applies auth, refresh-on-401, and typed error handling:

Testing

Tests never hit the network — every request is faked with Saloon's MockClient.

Contributing

Issues and PRs welcome — see SECURITY.md.

Licence

MIT © Chris John Leah. See LICENSE.

Not affiliated with or endorsed by Radius or Velocity Fleet. "Radius", "Velocity" and "Kinesis" are trademarks of their respective owners.


All versions of velocity-fleet-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
saloonphp/saloon Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chrisjohnleah/velocity-fleet-api contains the following files

Loading the files please wait ...