Download the PHP package rapidwebltd/etsy-php without Composer
On this page you can find all versions of the php package rapidwebltd/etsy-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package etsy-php
Etsy PHP SDK
Based on Etsy Rest API description output, this wrapper provides a simple client with all available methods on Etsy API (thanks to the __call
magic PHP method!), validating its arguments on each request (Take a look to https://github.com/rapidwebltd/etsy-php/blob/master/src/Etsy/methods.json for full list of methods and its arguments).
Requirements
Note: I will be working on remove this dependencies
- cURL devel:
- Ubuntu:
sudo apt-get install libcurl4-dev
- Fedora/CentOS:
sudo yum install curl-devel
- Ubuntu:
- OAuth pecl package:
sudo pecl install oauth
- And then add the line
extension=oauth.so
to yourphp.ini
Installation
The following recommended installation requires composer. If you are unfamiliar with composer see the composer installation instructions.
Add the following to your composer.json
file:
Usage
All methods has only one argument, an array with two items (both are optional, depends on the method):
-
params: an array with all required params to build the endpoint url.
Example: getSubSubCategory: GET /categories/:tag/:subtag/:subsubtag
- data: an array with post data required by the method
Example: createShippingTemplate: POST /shipping/templates
OAuth configuration script
Etsy API uses OAuth 1.0 authentication, so lets setup our credentials.
The script scripts/auth-setup.php
will generate an OAuth config file required by the Etsy client to make signed requests.
Example:
It will show an URL you must open, sign in on Etsy and allow the application. Then copy paste the verification code on the terminal. (On Mac OSX, it will open your default browser automatically)
Generated OAuth config file
After all, it should looks like this:
Initialization
Examples
Asociations
You would be able to fetch associations of given your resources using a simple interface:
To read more about associations: https://www.etsy.com/developers/documentation/getting_started/resources#section_associations
Testing
Thanks
This is a fork of the good work of Iñaki Abete.