Download the PHP package shimango/gophr without Composer
On this page you can find all versions of the php package shimango/gophr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gophr
A PHP client for the Gophr Courier Service commercial API
Documentation regarding the Gophr Restfull API can be found at: https://developers.gophr.com/docs
Requirements
The Gophr Commercial API uses API Key based authentication. In order to use this client you need to obtain an API key from Gophr. See how to obtain it here: https://developers.gophr.com/docs/authorisation
Installation
using composer:
Or add the following to your composer.json file for your project:
Alternatively, download this package from github, and run composer install
in the directory containing the
composer.json file to generate the autoloader, then require the autoloader using
Usage
The two main classes in this library are Shimango\Gophr\Common\Configuration
and Shimango\Gophr\Client
-
The
Configuration
class is used to set all the variables required when making calls to the Rest API. The configuration parameters are passed in the constructor of that class or can be set via setter methods. These are: - The
Client
is the main class in this library and has functions to allow for easy calls to the Gophr commercial API. Below are a couple of simple examples of how to query the gophr API for a list of jobs:
Jobs
A Job is a collection of deliveries that will be assigned to a courier and completed by them in the same trip. This library provides the following methods to interact with Jobs: `
Deliveries
A Delivery represents a pickup - dropoff combination along with any parcels that are associated with them. This library provides the following methods to interact with Deliveries:
Parcels
Parcels represent the individual packages within a delivery. A parcel belongs to a delivery and deliveries can have many parcels. This library provides the following methods to interact with Parcels:
All the methods above are available from the main \Shimango\Gophr\Client
class. Alternatively, individual resources
can be used instead. The resource objects will only have the methods that affect that resource directly. These resources
are:
\Shimango\Gophr\Resources\Job
\Shimango\Gophr\Resources\Delivery
\Shimango\Gophr\Resources\Parcel
All calls to the Gophr API via this library will return a GophrResponse object. This class is PSR-7 compliant and also, amongst other common response methods, provides two methods to help get the body of the response. These are:
Request and Response payloads
Examples of the request and response payloads for each API call can be found at: https://developers.gophr.com/reference