Download the PHP package misisipy/php-sdk without Composer
On this page you can find all versions of the php package misisipy/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-sdk
misisipy-php-sdk
Misisipy ERP SDK for PHP
This SDK provides a simplified access to the API of Misisipy.
Installation
This SDK is mounted on top of Requests for PHP, so we recommend using Composer for installing.
Simply add the misisipy/php-sdk
requirement to composer.json.
Then run composer install
or composer update
to complete the installation.
If you need an autoloader, you can use the one provided by Composer:
Authenticating Your App
When a user installs your app, he will be taken to your specified Redirect URI with a parameter called code
containing your temporary authorization code.
With this code you can request a permanent access token.
The returned value will contain the id of the authenticated store, as well as the access token and the authorized scopes.
Keep in mind that future visits to your app will not go through the Redirect URI, so you should store the access info and check the expiration of token before call the API.
However, if you need to authenticate a user that has already installed your app (or invite them to install it), you can redirect them to login to the Misisipy site.
After the user has logged in, he will be taken to your specified Redirect URI with a new authorization code. You can use this code to request a new request token.
Making a Request
The first step is to instantiate the API
class with a store id and an access token, as well as a user agent to identify your app. Then you can use the get
, post
, put
and delete
methods.
You can access the headers of the response via $response->headers
as if it were an array:
Other examples:
For list results you can use the next
, prev
, first
and last
methods to retrieve the corresponding page as a new response object.
Exceptions
Calls to Auth
may throw a Misisipy\Auth\Exception
:
Likewise, calls to API
may throw a Misisipy\API\Exception
. You can retrieve the original response from these exceptions:
Requests that return 404 will throw a subclass called Misisipy\API\NotFoundException
.