https://github.com/flowdee/envato-api-php-class
PHP class for the new Envato API https://build.envato.com/api/
https://github.com/flowdee/envato-api-php-class
Last synced: 10 months ago
JSON representation
PHP class for the new Envato API https://build.envato.com/api/
- Host: GitHub
- URL: https://github.com/flowdee/envato-api-php-class
- Owner: flowdee
- License: lgpl-3.0
- Created: 2016-05-10T06:37:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-16T07:27:07.000Z (almost 9 years ago)
- Last Synced: 2025-02-02T15:48:53.533Z (12 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
#Envato API PHP Class
This PHP Class was created in order to communicate with the new Envato API.
For more information please take a look into the official [Envato API documentation](https://build.envato.com/api/ "Envato API documentation").
##Setup
In order to use this class respectively the API you need a **personal token** which can be created [here](https://build.envato.com/create-token/ "Create a token").
``` php
// Including class to your project
require('Envato.php');
// Setup Envato with your credentials
$envato = new Envato(ENVATO_TOKEN);
```
Please replace ENVATO_TOKEN with your personal credentials.
``` php
// Updating the response type
$envato->set_response_type('array');
```
By default the API returns an object, but with this class you can return an array as well:
##Examples
``` php
// Receive all purchases of the buyer
$purchases = $envato->call('/buyer/list-purchases');
// Receive purchase data by submitting the purchase code
$purchase_data = $envato->call('/buyer/purchase?code=XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX');
```
These are just some examples. The complete list can be found inside the [Envato API documentation](https://build.envato.com/api/ "Envato API documentation").
##Info
If you don't want to miss an update or say hello, follow me on Twitter: [@flowdee](https://twitter.com/flowdee "@flowdee") :wink:
##Credits
* [Envato](https://build.envato.com/ "Envato")