Download the PHP package onfleet/php-onfleet without Composer

On this page you can find all versions of the php package onfleet/php-onfleet. 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 php-onfleet

Onfleet PHP Wrapper

License Latest version Top language Downloads

Read this document in another language: Español

Visit our blog post on the API wrapper project to learn more about our initiatives. If you have any questions, please reach us by submitting an issue here or contact [email protected].

Table of contents

Synopsis

The Onfleet PHP library provides convenient access to the Onfleet API.

Installation

Requirements

The Onfleet PHP library requires bcmath extension to be installed.

Usage

Before using the API wrapper, you will need to obtain an API key from one of your organization's admins.

Creation and integration of API keys are performed through the Onfleet dashboard.

To start utilizing the library, you simply need to create an Onfleet object with your API key:

Optionally, you can introduce a customized timeout that is less than the default Onfleet API timeout (70,000 ms) by providing a 2nd parameter:

Authentication

Once the Onfleet object is created, you can test on the authentication endpoint:

Throttling

Rate limiting is enforced by the API with a threshold of 20 requests per second across all your organization's API keys. Learn more about it here.

We have also implemented a limiter on this library to avoid you from unintentionally exceeding your rate limitations and eventually be banned for.

Supported CRUD Operations

Here are the operations available for each entity:

Entity GET POST PUT DELETE
Admins/Administrators get() create(obj), matchMetadata(obj) update(id, obj) deleteOne(id)
Containers get(id, 'workers'), get(id, 'teams'), get(id, 'organizations') x update(id, obj) x
Destinations get(id) create(obj), matchMetadata(obj) x x
Hubs get() create(obj) update(id, obj) x
Organization get(), get(id) x insertTask(id, obj) x
Recipients get(id), get(name, 'name'), get(phone, 'phone') create(obj), matchMetadata(obj) update(id, obj) x
Tasks get(query), get(id), get(shortId, 'shortId') create(obj), clone(id), forceComplete(id), batch(obj), autoAssign(obj), matchMetadata(obj) update(id, obj) deleteOne(id)
Teams get(), get(id), getWorkerEta(id, obj) create(obj), autoDispatch(id, obj) update(id, obj), insertTask(id, obj) deleteOne(id)
Webhooks get() create(obj) x deleteOne(id)
Workers get(), get(query), get(id), getByLocation(obj), getSchedule(id) create(obj), setSchedule(id, obj), matchMetadata(obj), getDeliveryManifest(obj) update(id, obj), insertTask(id, obj) deleteOne(id)

GET Requests

To get all the documents within an endpoint, this returns an array of results:

Examples of get()

Optionally you can send an array of query params for some certain endpoints. Refer back to API documentation for endpoints that support query parameters.

To get one of the documents within an endpoint, if the optional paramName is not provided, the library will search by ID. If paramName is provided, it will search by paramName:

paramName can be any of:

Examples of get(param)

To get a driver by location, use the getByLocation function:

Examples of getByLocation

POST Requests

To create a document within an endpoint:

Examples of create()
Examples of getDeliveryManifest()

Extended POST requests include clone, forceComplete, batchCreate, autoAssign on the Tasks endpoint; setSchedule on the Workers endpoint; autoDispatch on the Teams endpoint; and matchMetadata on all supported entities. For instance:

For more details, check our documentation on clone, forceComplete, batchCreate, autoAssign, setSchedule, matchMetadata, getDeliveryManifest, and autoDispatch.

PUT Requests

To update a document within an endpoint:

Examples of update()
Examples of insertTask()

DELETE Requests

To delete a document within an endpoint:

Examples of deleteOne()

Examples of utilizing your CRUD operations

Things NOT to do

Go to top.


All versions of php-onfleet with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 onfleet/php-onfleet contains the following files

Loading the files please wait ....