PHP code example of darkgoldblade01 / infusionsoft

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

    

darkgoldblade01 / infusionsoft example snippets



$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_'
]);


$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
]);

$url = $infusionsoft->authorize()->getAuthorizationUrl();

$code = $_GET['code'];
$token = $infusionsoft->authorize()->getToken($code);

$refreshedToken = $infusionsoft->authorize()->refreshToken();


$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_',
]);

$campaigns = $infusionsoft->campaigns()->listCampaigns();

$campaign = $infusionsoft->campaigns()->getCampaign($campaignId);


$infusionsoft = new darkgoldblade01\Infusionsoft\Infusionsoft([
    'client_id' => '_YOUR_CLIENT_ID_',
    'client_secret' => '_YOUR_CLIENT_SECRET_',
    'redirect_uri' => '_YOUR_REDIRECT_URI_',
    'access_token' => '_YOUR_ACCESS_TOKEN_ARRAY_',
]);

$campaigns = $infusionsoft->contacts()->listContacts();

$campaign = $infusionsoft->contacts()->getContact($contactId);