PHP client library for urb-it integration.
The recommended way to install the urb-it PHP client is through Composer:
# Install Composer
curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest version of the urb-it PHP client:
php composer.phar require urbit/client:dev-master
After installing, you need to require Composer's auto-loader:
require __DIR__ . '/vendor/autoload.php';
You can later update the PHP client using composer:
composer.phar update
For the legacy version of the PHP client, please see the legacy branch or release v0.1.
$storeKey = '<store key>';
$sharedSecret = '<shared secret>';
$client = new Urbit\Client($storeKey, $sharedSecret);
$openingHours = $client->getOpeningHours('2016-05-21', '2016-05-28');
$validPostalCode = $client->validatePostalCode('113 30');
$order = [...];
$createOrderResponse = $client->createOrder($order);
$validateDeliveryResponse = $client->validateDelivery($order);
Or if you only need UWA and not the full client:
$storeKey = '<store key>'; // Store key
$sharedSecret = '<shared secret>'; // Shared secret
$method = 'GET'; // HTTP method, like GET, POST, PUT, DELETE
$url = ''; // Full HTTP request URL
$json = ''; // JSON body, if any
$uwa = new Urbit\Auth\UWA($storeKey, $sharedSecret, $method, $url, $json);
One can also override the base URL:
$client = new Urbit\Client('<store key>', '<shared secret>');
$client->baseUrl = 'https://another-api.com/v1/';
$client->request('GET', 'orders'); // Sends a GET request to https://another-api.com/v1//orders
- General API documentation: http://developer.urb-it.com
- Detailed urbit-client-php documentation: http://developer.urb-it.com/docs/php
- Sebastian Mandrean [email protected] (Maintainer)
- Caio Mathielo [email protected] (Contributor)
- Ivar Johansson [email protected] (Contributor)