PHP code example of criteo / criteo-php-marketing-sdk

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

    

criteo / criteo-php-marketing-sdk example snippets


    


entId = 'YOUR_CLIENT_ID';
$clientCredentials = 'YOUR_PASSWORD';

// Automatic token refresh
$apiInstance = new Criteo\Marketing\Api\AdvertisersApi(new TokenAutoRefreshClient($clientId, $clientCredentials));

$advertiser_id = 56;
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64';

try {
    $result = $apiInstance->getCampaigns($advertiser_id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdvertisersApi->getCampaigns: ', $e->getMessage(), PHP_EOL;
}

json
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/criteo/criteo-php-marketing-sdk.git"
    }
  ],
  "