PHP code example of fw4 / sweepbright-api

1. Go to this page and download the library: Download fw4/sweepbright-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fw4 / sweepbright-api example snippets


$client = new \SweepBright\SweepBright();
$accessToken = getAccessTokenFromDataStore();
if (empty($accessToken) || $accessToken->hasExpired()) {
    $accessToken = $client->requestAccessToken($clientId, $clientSecret);
    saveAccessTokenToDataStore($accessToken);
} else {
    $client->setAccessToken($accessToken);
}
$estate = $client->getEstate($estateId);