PHP wrapper for the Gumroad API. Originally developed for Ultiworld.
Dependencies:
- libcurl
# Construct the client object
$gr = new Gumroad_Client();
# Authenticate with email and password
$gr->auth('YOUR_EMAIL', 'YOUR_PASSWORD');
Good practice to also deauth once you are done, but if you did not, the client destructor method will deauth for you.
$id = 'uWhq'
$params = array('name' => 'A Wonderful Widget', 'price' => 100);
$response = $gr->link->editLink($id, $params);
$id should be a string and $params should be an associative array. $response will be the HTTP response body JSON-decoded into an associative array, with the HTTP status code appended ('http_code' => 200
).
$gr->sessions->authenticate($params);
# Shortcut method
$gr->auth($email, $password);
$gr->sessions->deauthenticate();
# Shortcut method
$gr->deauth();
$gr->links->getLinks();
$gr->links->getLink($id);
$gr->links->createLink($params);
$gr->links->editLink($id, $params);
$gr->links->enableLink($id);
$gr->links->disableLink($id);
$gr->links->deleteLink($id);
MIT License (see LICENSE).
Copyright (c) 2013 Orion Burt.