PHP code example of sympla / revolution-bar

1. Go to this page and download the library: Download sympla/revolution-bar 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/ */

    

sympla / revolution-bar example snippets




$authentication = new RDStation\Services\Authentication("YOUR_CLIENT_ID", "YOUR_URL_CALLBACK");
$authentication->getUrlAuthentication();



$authorization = new RDStation\Services\Authorization("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "CODE_RDSTATION");
$authorizationResponse = $authorization->execute();
var_export($authorizationResponse->getAccessToken());
var_export($authorizationResponse->getExpireIn());
var_export($authorizationResponse->getRefreshToken());



$refreshToken = new RDStation\Services\RefreshToken("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "REFRESH_TOKEN");
$refreshTokenResponse = $refreshToken->execute();
var_export($refreshTokenResponse->getAccessToken());
var_export($refreshTokenResponse->getExpireIn());
var_export($refreshTokenResponse->getRefreshToken());



$contactIdentifier = RDStation\Request\ContactIdentifier::EMAIL;

$contactRequest = new RDStation\Request\ContactRequest(ContactIdentifier::EMAIL, [
    "YOUR_CUSTOMER_FIELD"   => "VALUE",   
    "YOUR_CUSTOMER_FIELD_2" => "VALUE",
]);

$contactRequest->setEmail("[email protected]");
$contactRequest->setName("NAME'S LEAD");
$contactRequest->setBio("BIO");
$contactRequest->setCity("BELO HORIZONTE");
$contactRequest->setCountry("BRASIL");
$contactRequest->setFacebook("FACEBOOK_LEAD");
$contactRequest->setJobTitle("JOB_TITLE");
$contactRequest->setLinkedin("LINKDEDIN LEAD");
$contactRequest->setMobilePhone("(31)99999-9999");
$contactRequest->setPersonalPhone("(31)99999-9999");
$contactRequest->setState("MG");
$contactRequest->setWebsite("https://lead_website.com");


$contact = new RDStation\Services\Contact($contactRequest, "YOUR_ACCESS_TOKEN");
var_export($contact->save());

$revokingAccess = new \RDStation\Services\RevokingAccess("YOUR_ACCESS_TOKEN");
var_export($revokingAccess->revoke());

$revokingAccess = new \RDStation\Services\RevokingAccess("YOUR_ACCESS_TOKEN", "YOUR_REFRESH_TOKEN", "refresh_token");
var_export($revokingAccess->revoke());