Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Latest commit

 

History

History
210 lines (140 loc) · 7.19 KB

AdvertisersApi.md

File metadata and controls

210 lines (140 loc) · 7.19 KB

Criteo\Marketing\AdvertisersApi

All URIs are relative to https://api.criteo.com/marketing

Method HTTP request Description
getCampaigns GET /v1/advertisers/{advertiserId}/campaigns Gets all advertiser's campaigns
getCategories GET /v1/advertisers/{advertiserId}/categories Gets all advertiser's categories
getCategory GET /v1/advertisers/{advertiserId}/categories/{categoryHashCode} Gets a specific advertiser's category

getCampaigns

\Criteo\Marketing\Model\CampaignMessage[] getCampaigns($advertiser_id, $authorization)

Gets all advertiser's campaigns

Get the list of all the campaigns linked to the requested advertiser.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Authorization
$config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Criteo\Marketing\Api\AdvertisersApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$advertiser_id = 56; // int | Mandatory. The id of the advertiser to return.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token

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

Parameters

Name Type Description Notes
advertiser_id int Mandatory. The id of the advertiser to return.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']

Return type

\Criteo\Marketing\Model\CampaignMessage[]

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml, text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCategories

\Criteo\Marketing\Model\CategoryMessage[] getCategories($advertiser_id, $authorization, $enabled_only)

Gets all advertiser's categories

Get the list of all the categories linked to the requested advertiser.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Authorization
$config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Criteo\Marketing\Api\AdvertisersApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$advertiser_id = 56; // int | Mandatory. The id of the advertiser to return.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token
$enabled_only = True; // bool | Optional. Returns only categories you can bid on. Defaults to false.

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

Parameters

Name Type Description Notes
advertiser_id int Mandatory. The id of the advertiser to return.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']
enabled_only bool Optional. Returns only categories you can bid on. Defaults to false. [optional]

Return type

\Criteo\Marketing\Model\CategoryMessage[]

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml, text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCategory

\Criteo\Marketing\Model\CategoryMessage[] getCategory($advertiser_id, $category_hash_code, $authorization)

Gets a specific advertiser's category

Get a specific category linked to the requested advertiser.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Authorization
$config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Criteo\Marketing\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Criteo\Marketing\Api\AdvertisersApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$advertiser_id = 56; // int | Mandatory. The id of the advertiser to return.
$category_hash_code = 56; // int | Mandatory. The id of the category to return.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token

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

Parameters

Name Type Description Notes
advertiser_id int Mandatory. The id of the advertiser to return.
category_hash_code int Mandatory. The id of the category to return.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']

Return type

\Criteo\Marketing\Model\CategoryMessage[]

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml, text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]