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

Latest commit

 

History

History
408 lines (272 loc) · 13.9 KB

AudiencesApi.md

File metadata and controls

408 lines (272 loc) · 13.9 KB

Criteo\Marketing\AudiencesApi

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

Method HTTP request Description
addRemoveUsersToAudience PATCH /v1/audiences/userlist/{audienceId} Add/Remove users to an Audience.
createAudience POST /v1/audiences/userlist Create a new Audience.
deleteAudience DELETE /v1/audiences/{audienceId} Delete an Audience.
getAudiences GET /v1/audiences Get the list of Audiences.
removeUsersFromAudience DELETE /v1/audiences/userlist/{audienceId}/users Remove all users from an Audience.
updateAudienceMetadata PUT /v1/audiences/{audienceId} Update an Audience metadata.

addRemoveUsersToAudience

\Criteo\Marketing\Model\AudiencePatchResponse addRemoveUsersToAudience($audience_id, $authorization, $request)

Add/Remove users to an Audience.

Add/Remove users to an Audience.

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\AudiencesApi(
    // 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
);
$audience_id = 56; // int | Mandatory. The id of the audience to add or remove users to.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token
$request = new \Criteo\Marketing\Model\AudiencePatchRequest(); // \Criteo\Marketing\Model\AudiencePatchRequest | Mandatory. The request to create the Audience.

try {
    $result = $apiInstance->addRemoveUsersToAudience($audience_id, $authorization, $request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->addRemoveUsersToAudience: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
audience_id int Mandatory. The id of the audience to add or remove users to.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']
request \Criteo\Marketing\Model\AudiencePatchRequest Mandatory. The request to create the Audience.

Return type

\Criteo\Marketing\Model\AudiencePatchResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
  • 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]

createAudience

\Criteo\Marketing\Model\AudienceCreateResponse createAudience($authorization, $create_request)

Create a new Audience.

Create a new Audience for the given 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\AudiencesApi(
    // 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
);
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token
$create_request = new \Criteo\Marketing\Model\AudienceCreateRequest(); // \Criteo\Marketing\Model\AudienceCreateRequest | 

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

Parameters

Name Type Description Notes
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']
create_request \Criteo\Marketing\Model\AudienceCreateRequest

Return type

\Criteo\Marketing\Model\AudienceCreateResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
  • 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]

deleteAudience

object deleteAudience($audience_id, $authorization)

Delete an Audience.

Delete an Audience.

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\AudiencesApi(
    // 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
);
$audience_id = 56; // int | Mandatory. The id of the audience to delete.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token

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

Parameters

Name Type Description Notes
audience_id int Mandatory. The id of the audience to delete.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']

Return type

object

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]

getAudiences

\Criteo\Marketing\Model\AudiencesGetResponse getAudiences($authorization, $advertiser_id)

Get the list of Audiences.

Get the list of Audiences for the given 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\AudiencesApi(
    // 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
);
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token
$advertiser_id = 56; // int | Mandatory. Advertiser to get all Audiences for.

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

Parameters

Name Type Description Notes
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']
advertiser_id int Mandatory. Advertiser to get all Audiences for. [optional]

Return type

\Criteo\Marketing\Model\AudiencesGetResponse

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]

removeUsersFromAudience

object removeUsersFromAudience($audience_id, $authorization)

Remove all users from an Audience.

Remove all users from an Audience.

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\AudiencesApi(
    // 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
);
$audience_id = 56; // int | Mandatory. The id of the audience to empty.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token

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

Parameters

Name Type Description Notes
audience_id int Mandatory. The id of the audience to empty.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']

Return type

object

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]

updateAudienceMetadata

object updateAudienceMetadata($audience_id, $authorization, $request)

Update an Audience metadata.

Update an Audience metadata.

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\AudiencesApi(
    // 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
);
$audience_id = 56; // int | Mandatory. The id of the Audience to update.
$authorization = 'Bearer VALID_JWT_TOKEN_BASE64'; // string | JWT Bearer Token
$request = new \Criteo\Marketing\Model\AudiencePutRequest(); // \Criteo\Marketing\Model\AudiencePutRequest | Mandatory. The request to update the Audience metadata.

try {
    $result = $apiInstance->updateAudienceMetadata($audience_id, $authorization, $request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->updateAudienceMetadata: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
audience_id int Mandatory. The id of the Audience to update.
authorization string JWT Bearer Token [default to 'Bearer VALID_JWT_TOKEN_BASE64']
request \Criteo\Marketing\Model\AudiencePutRequest Mandatory. The request to update the Audience metadata.

Return type

object

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
  • 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]