PHP code example of tuks128 / fanburst-php-api

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

    

tuks128 / fanburst-php-api example snippets


composer 



use WaProduction\Fanburst\FanburstApi;

$fanburstApi = new FanburstApi('CLIENT_ID', 'CLIENT_SECRET', 'AUTH_CALLBACK_URI');



$options = [
  'state' => json_encode([
      'custom_param' => 'custom_param_value',
   ]),
];
  
header('Location: '.$fanburstApi->getOauthLoginUrl($options)); // get URL for login



$accessToken = $fanburstApi->exachangeCodeForAccessToken($_GET['code']);
$fanburstApi->setAccessToken($accessToken);



$fanburstApi->getAccessToken();
$fanburstApi->followUser('CHANNEL_ID')
$fanburstApi->searchUser('CHANNEL_NAME');
$fanburstApi->multipleCallTargets('CHANNEL_ID', function($target) { });