Guzzle client wrapper for Storedge API
- This is a composer package, so download composer
- Add the Github URL to the
repositories
section of your composer.json file:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/rideron89/storedge-api-client-php"
}
]
- Set minimum stability in composer.json to
dev
- Run command:
composer require rideron89/storedge-sdk-php=master
<?php
require('vendor/autoload.php');
use RedNovaLabs\Storedge\SDK;
$base_url = 'https://api.storedgefms.com/v1/';
$api_key = '[INSERT]';
$api_secret = '[INSERT]';
$client = new SDK($base_url, $api_key, $api_secret);
<?php
// ... continued
// Create any needed uuids
$facility_uuid = '[INSERT]';
// Send the request
// GET request
$units = $client->getUnits($facility_uuid);
// POST request
// array of data to send in body of request
$tenant = json_decode(
'{
"tenant": {
"password": "supersecretpassword",
"username": "awesome_o_5000"
}
}', true);
$newTenant = $client->signUpTenant($facility_uuid, $tenant_uuid, $tenant);
- See samples.php for more information