Download the PHP package webleit/revisoapi without Composer
On this page you can find all versions of the php package webleit/revisoapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webleit/revisoapi
More information about webleit/revisoapi
Files in webleit/revisoapi
Informations about the package revisoapi
Reviso REST Api - PHP SDK
This Library is a SDK in PHP that simplifies the usage of the Reviso REST API (http://api-docs.reviso.com)
It provides both an interface to ease the interaction with the APIs without bothering with the actual REST request, while packaging the various responses using very simple Model classes that can be then uses with any other library or framework.
Installation
HTTP Clients
In order to talk to Reviso APIs, you need an HTTP Client library. Since v2 of this package, the HTTP Client is not included, allowing you to choose the one you like the best, and avoiding any potential dependency conflict.
You can use any library to send HTTP messages that implements php-http/client-implementation.
Here is a list of all officially supported clients and adapters: http://docs.php-http.org/en/latest/clients.html
You can read more on the HTTPlug docs.
Usage
In order to use the library, just require the composer autoload file, and then fire up the library itself.
This way, the library will try to find any HTTP Client implementation that you may already have. If you want, you can pass a specific Http Client instance to the library like this:
If you want to use the demo account, just don't specify the auth parameters, and you'll be able to use any GET request.
API calls
To call any Api, just use the same name reported in the api docs. You can get the list of supported apis using the getEndpoints() method
You can, for example, get the list of customers by using:
or the list of customer groups
List calls
To get a list of resources from a module, use the get() method
In order to navigate the pages, just use the "page" and "perPage" methods
Filters
To filter a list of resources from a module, use the where()
method before calling get()
In order to navigate the pages, just use the "page" and "perPage" methods
Return Types
Any "list" api call returns a Collection object, which contains information on the list itself, allows for further pagination,
and stores the list of items in a Laravel Collection package (Illuminate\Support\Collection
).
You can therefore use the result as Collection, which allows mapping, reducing, serializing, etc
Any "resource" api call returns a Model object of a class dedicated to the single resource you're fetching. For example, calling
will return a \Weble\RevisoApi\Model
object, which is Arrayable and Jsonable, and that can be therefore used in many ways.
CRUD
You can create / Read / Update / Delete a resource from the Endpoint class or on the model itself.
Create
Read
Update
Delete
Test
This package contains some tests to test the basic functionalities of the package.
In order to run the tests also on the "CRUD" methods, you need to create a config.json
file in the"tests/
directory, with the authentication details of an app you want to use as a test base.
You may copy if from the config.example.json
in the same directory.
Upgrade from V1 to V2
See the upgrade docs
Contributing
Finding bugs, sending pull requests or improving the docs - any contribution is welcome and highly appreciated
Versioning
Semantic Versioning Specification (SemVer) is used.
Copyright and License
Copyright Weble Srl under the MIT license.
All versions of revisoapi with dependencies
illuminate/collections Version ^8.0 || ^9.0
psr/http-message Version ^1.0
psr/http-client-implementation Version ^1.0
php-http/httplug Version ^2.0
php-http/message-factory Version ^1.0
php-http/discovery Version ^1.0
ext-json Version *