Download the PHP package geotab/mygeotab-php without Composer
On this page you can find all versions of the php package geotab/mygeotab-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mygeotab-php
MyGeotab PHP API Client
PHP client for the MyGeotab API.
Requirements
- PHP >=8.1
- Composer
Installation
Quick Start
Constructor: new Geotab\API($username, $password, $database, $server = "my.geotab.com")
The $server parameter defaults to my.geotab.com. After authenticate(), it is updated automatically if the account lives on a different server node.
Error handling
Methods return results directly and throw Geotab\MyGeotabException on error:
All methods also accept optional success and error callbacks if you prefer that style:
Logging
The library does not log internally. To log HTTP requests and responses, pass a pre-configured Guzzle client with a log middleware attached. This works with any PSR-3 compatible logger such as Monolog:
API Reference
| Method | Description |
|---|---|
authenticate() |
Exchanges credentials for a session token. Updates $server automatically if the account is on a different node. |
get($type, $params) |
Retrieves or searches for entities. |
add($type, $entity) |
Creates a new entity. |
set($type, $entity) |
Updates an existing entity. |
remove($type, $entity) |
Deletes an entity. |
call($method, $params) |
Calls any MyGeotab API method by name. |
multiCall($calls) |
Executes multiple API calls in a single HTTP request. |
getCredentials() |
Returns the current Geotab\Credentials object. |
setCredentials($credentials) |
Replaces the current credentials. |
See the Geotab SDK documentation for available entity types, methods, and search parameters.
Examples
The examples/ directory contains two runnable samples.
CLI sample — exercises Get, Set, Add, and MultiCall against a live database:
Top Speeding Violations — a web UI example. Serve with PHP's built-in server:
Then open http://localhost:7000 in your browser.
Contributing
Clone the repo and install dependencies:
Run the test suite:
Integration tests require credentials supplied as environment variables; they are skipped automatically if not set:
Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.
License
MIT © Geotab. See LICENSE for details.