PHP code example of brightlocal / api

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

    

brightlocal / api example snippets



 = new BrightLocal\Api('YOUR_API_KEY', 'YOUR_API_SECRET');

// get a list of clients
print_r($api->call('/v2/clients/get-all'));

// get a client
print_r($api->call('/v2/clients/get', array(
    'client-id' => 1059
)));

// get LSRC report list
print_r($api->call('/v2/lsrc/get-all'));

// get LSRC report
print_r($api->call('/v2/lsrc/get', array(
    'campaign-id' => 50
)));

// get CT report list
print_r($api->call('/v2/ct/get-all'));

// get a CT report
print_r($api->call('/v2/ct/get', array(
    'report-id' => 259
)));