### Get Advertiser Portfolio using Criteo PHP SDK Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md A 'Getting Started' example demonstrating how to initialize the AdvertiserApi client with automatic token refresh and fetch the advertiser portfolio using the Criteo Marketing Transition SDK for PHP. It includes basic error handling. ```php apiPortfolioGet(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdvertiserApi->apiPortfolioGet: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Start Ad Sets using Criteo Marketing SDK (PHP) Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md This PHP snippet illustrates how to start a specified list of ad sets using the Criteo Marketing SDK. Ensure the SDK is installed and authenticated with an access token. The function takes a list of ad set IDs to start as input. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\CampaignApi( // 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 ); $requests_ad_set_id = new Criteo\Marketing\Model\RequestsAdSetId(); // \Criteo\Marketing\Model\RequestsAdSetId | All the ad sets to start try { $result = $apiInstance->startAdSets($requests_ad_set_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->startAdSets: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Start Ad Sets with Criteo PHP SDK Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Activates multiple ad sets to begin serving ads. This function requires the Criteo Marketing SDK and authentication. It takes a list of ad set IDs to start and returns a confirmation of which ad sets were successfully started. ```php 'adset-123456', 'type' => 'AdSetId']), new WriteModelAdSetId(['id' => 'adset-789012', 'type' => 'AdSetId']) ]; $requests_ad_set_id = new RequestsAdSetId([ 'data' => $adSetIds ]); try { $result = $apiInstance->startAdSets($requests_ad_set_id); echo "Ad Sets started successfully" . PHP_EOL; foreach ($result->getData() as $response) { echo "Ad Set " . $response->getId() . " started" . PHP_EOL; } } catch (Exception $e) { echo 'Exception when calling CampaignApi->startAdSets: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Install Criteo PHP SDK via Composer Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Instructions for installing the Criteo Marketing Transition SDK for PHP using Composer. This involves either running a composer require command or adding repository and require entries to the composer.json file. ```json { "repositories": [ { "type": "vcs", "url": "https://github.com/criteo/criteo-php-marketing-transition-sdk.git" } ], "require": { "criteo/criteo-php-marketing-transition-sdk": "*@dev" } } ``` -------------------------------- ### Search Ad Sets using Criteo Marketing SDK (PHP) Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md This PHP code example shows how to search for ad sets using the Criteo Marketing SDK. It requires proper SDK setup and authentication. The function accepts search criteria for ad sets and returns a list of matching ad sets. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\CampaignApi( // 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 ); $request_ad_set_search = new Criteo\Marketing\Model\RequestAdSetSearch(); // \Criteo\Marketing\Model\RequestAdSetSearch | try { $result = $apiInstance->searchAdSets($request_ad_set_search); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->searchAdSets: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Start Ad Sets Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Activates multiple ad sets to begin serving. ```APIDOC ## POST /adsets/start ### Description Activates multiple ad sets to begin serving. ### Method POST ### Endpoint `/adsets/start` ### Parameters #### Request Body - **data** (array) - Required - A list of ad set IDs to activate. - **id** (string) - Required - The ID of the ad set. - **type** (string) - Required - The type of the resource (e.g., 'AdSetId'). ### Request Example ```json { "data": [ { "id": "adset-123456", "type": "AdSetId" }, { "id": "adset-789012", "type": "AdSetId" } ] } ``` ### Response #### Success Response (200) - **data** (array) - A list of ad sets that were started. - **id** (string) - The ID of the ad set. - **status** (string) - The status of the operation for this ad set (e.g., 'started'). #### Response Example ```json { "data": [ { "id": "adset-123456", "status": "started" }, { "id": "adset-789012", "status": "started" } ] } ``` ``` -------------------------------- ### Advertiser Portfolio Get Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Retrieves the advertiser's portfolio. ```APIDOC ## GET /api/portfolio ### Description Retrieves the advertiser's portfolio, including details about their campaigns and other relevant information. ### Method GET ### Endpoint /api/portfolio ### Parameters #### Query Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **portfolio** (object) - Contains details of the advertiser's portfolio. - **advertiser_id** (string) - The unique identifier for the advertiser. - **campaigns** (array) - A list of campaigns associated with the advertiser. #### Response Example ```json { "portfolio": { "advertiser_id": "12345", "campaigns": [ { "campaign_id": "campaign-abc", "name": "Summer Sale Campaign" } ] } } ``` ### Error Handling - **ApiException**: Handles specific API errors with status code, message, and response body. - **General Exception**: Catches any other unexpected errors. ``` -------------------------------- ### POST /2021-04/marketing-solutions/ad-sets/start Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Starts one or more ad sets. ```APIDOC ## POST /2021-04/marketing-solutions/ad-sets/start ### Description Starts one or more ad sets. ### Method POST ### Endpoint /2021-04/marketing-solutions/ad-sets/start ### Parameters #### Request Body - **StartAdSetsRequest** (*\Criteo\Marketing\Model\StartAdSetsRequest*) - Required - The request body containing the IDs of the ad sets to start. ### Response #### Success Response (200) - **StartAdSetsResponse** (*\Criteo\Marketing\Model\StartAdSetsResponse*) - The response containing the results of the start operation. ### Authorization [Authorization](../../README.md#Authorization) ### HTTP request headers - **Content-Type**: application/json - **Accept**: text/plain, application/json, text/json ``` -------------------------------- ### Start Ad Sets API Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Allows starting the specified list of ad sets. This endpoint is used to activate ad sets that have been previously paused or created. ```APIDOC ## POST /api/v1/adsets/start ### Description Start the specified list of ad sets. This action activates ad sets, allowing them to begin serving ads. ### Method POST ### Endpoint /api/v1/adsets/start ### Parameters #### Request Body - **requests_ad_set_id** (object) - Required - An object containing the IDs of the ad sets to start. Refer to \Criteo\Marketing\Model\RequestsAdSetId for the exact structure. ### Request Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\CampaignApi( // 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 ); $requests_ad_set_id = new \Criteo\Marketing\Model\RequestsAdSetId(); // \Criteo\Marketing\Model\RequestsAdSetId | All the ad sets to start try { $result = $apiInstance->startAdSets($requests_ad_set_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->startAdSets: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Response #### Success Response (200) - **ResponsesAdSetId** (object) - An object confirming the start of the ad sets. Refer to \Criteo\Marketing\Model\ResponsesAdSetId for the exact structure. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Include Criteo PHP SDK Autoloader Manually Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Demonstrates how to manually include the autoloader file for the Criteo Marketing Transition SDK for PHP after downloading the files. This is an alternative to Composer installation. ```php require_once('/path/to/CriteoMarketingTransition/vendor/autoload.php'); ``` -------------------------------- ### Get Ad Set Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Retrieves details for a specific ad set using its ID. ```APIDOC ## GET /adsets/{ad_set_id} ### Description Retrieves details for a specific ad set. ### Method GET ### Endpoint `/adsets/{ad_set_id}` ### Parameters #### Path Parameters - **ad_set_id** (string) - Required - The unique identifier of the ad set. ### Request Example ```php // Example usage in PHP $ad_set_id = 'adset-123456'; $result = $apiInstance->getAdSet($ad_set_id); ``` ### Response #### Success Response (200) - **data** (object) - Contains the ad set details. - **id** (string) - The ad set's unique identifier. - **attributes** (object) - The ad set's attributes. - **name** (string) - The name of the ad set. - **status** (string) - The current status of the ad set. - **budget** (object) - Budget details for the ad set. - **budget_type** (string) - The type of budget (e.g., 'daily'). - **amount** (float) - The budget amount. #### Response Example ```json { "data": { "id": "adset-123456", "attributes": { "name": "Example Ad Set", "status": "active", "budget": { "budget_type": "daily", "amount": 100.00 } } } } ``` ``` -------------------------------- ### Advertiser API - Get Portfolio Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Fetches a list of all advertisers associated with your Criteo account. This endpoint is useful for retrieving an overview of your managed advertisers. ```APIDOC ## GET /v1/portfolio ### Description Fetches a list of all advertisers in your account portfolio. ### Method GET ### Endpoint /v1/portfolio ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```php apiPortfolioGet(); // Access advertiser data $data = $result->getData(); foreach ($data as $advertiser) { echo "Advertiser ID: " . $advertiser->getAdvertiserId() . PHP_EOL; echo "Advertiser Name: " . $advertiser->getAdvertiserName() . PHP_EOL; } } catch (Exception $e) { echo 'Exception when calling AdvertiserApi->apiPortfolioGet: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Response #### Success Response (200) - **data** (array) - A list of advertiser objects. - **advertiser_id** (integer) - The unique identifier for the advertiser. - **advertiser_name** (string) - The name of the advertiser. #### Response Example ```json { "data": [ { "advertiser_id": 12345, "advertiser_name": "Example Advertiser" } ] } ``` ``` -------------------------------- ### PatchAdSetScheduling Model Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Model/PatchAdSetScheduling.md The PatchAdSetScheduling model allows you to update the start and end dates for an ad set's schedule. Both fields are optional. ```APIDOC ## PatchAdSetScheduling ### Description Represents the scheduling parameters for patching an ad set, allowing for optional start and end dates. ### Method PATCH (Implied by the model's purpose for updating) ### Endpoint `/adsets/{adSetId}/schedule` (Example endpoint, actual may vary) ### Parameters #### Request Body - **start_date** (NillableDateTime) - Optional - The new start date for the ad set schedule. - **end_date** (NillableDateTime) - Optional - The new end date for the ad set schedule. ### Request Example ```json { "start_date": "2023-10-27T10:00:00Z", "end_date": "2023-12-31T23:59:59Z" } ``` ### Response #### Success Response (200 OK) - **status** (string) - Indicates the success of the operation. - **message** (string) - A confirmation message. #### Response Example ```json { "status": "success", "message": "Ad set schedule updated successfully." } ``` ``` -------------------------------- ### Get Audiences using Criteo PHP SDK Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Retrieves all audiences for a user or a specific advertiser using the AudienceApi. It requires client credentials for authentication and optionally accepts an advertiser ID to filter results. The output includes audience details like ID, name, and description. ```php getAudiences($advertiser_id); foreach ($result->getData() as $audience) { echo "Audience ID: " . $audience->getId() . PHP_EOL; echo "Name: " . $audience->getAttributes()->getName() . PHP_EOL; echo "Description: " . $audience->getAttributes()->getDescription() . PHP_EOL; echo "---" . PHP_EOL; } } catch (Exception $e) { echo 'Exception when calling AudienceApi->getAudiences: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Transactions Report - PHP Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Retrieves transaction-level reporting data for attribution analysis. Uses the AnalyticsApi and TransactionsReportQueryDataMessage. Requires advertiser IDs, date range, timezone, and desired format (Json). Returns transaction data. ```php ['12345'], 'start_date' => '2024-01-01T00:00:00Z', 'end_date' => '2024-01-31T23:59:59Z', 'timezone' => 'UTC', 'format' => 'Json' ]); try { $result = $apiInstance->getTransactionsReport($transactions_query); echo $result; } catch (Exception $e) { echo 'Exception when calling AnalyticsApi->getTransactionsReport: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Advertiser Portfolio - PHP Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Fetches a list of all advertisers associated with the authenticated account. This function is part of the Advertiser API and requires an authenticated client, preferably using the TokenAutoRefreshClient for seamless token management. The output contains advertiser IDs and names. ```php apiPortfolioGet(); // Access advertiser data $data = $result->getData(); foreach ($data as $advertiser) { echo "Advertiser ID: " . $advertiser->getAdvertiserId() . PHP_EOL; echo "Advertiser Name: " . $advertiser->getAdvertiserName() . PHP_EOL; } } catch (Exception $e) { echo 'Exception when calling AdvertiserApi->apiPortfolioGet: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Get Audiences using Criteo PHP SDK Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/AudienceApi.md This snippet demonstrates how to retrieve all audiences for a given advertiser ID using the Criteo PHP Marketing SDK. It requires the SDK to be installed and configured with an access token. The function takes an advertiser ID as input and returns a list of audiences or throws an exception if an error occurs. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\AudienceApi( // 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 = 'advertiser_id_example'; // string | The advertiser id to get all the audiences for. Mandatory for internal users. For external users, if you don't provide it, we will take into account the advertisers from your portfolio try { $result = $apiInstance->getAudiences($advertiser_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling AudienceApi->getAudiences: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Ad Set Data using Criteo PHP SDK Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Retrieves data for a specific ad set using the Criteo Marketing Campaign API. Requires an OAuth2 access token for authorization. The function takes an ad set ID as input and returns a ResponseReadAdSet object. Ensure the SDK and Guzzle HTTP client are installed. ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\CampaignApi( // 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 ); $ad_set_id = 'ad_set_id_example'; // string | Id of the ad set try { $result = $apiInstance->getAdSet($ad_set_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignApi->getAdSet: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Campaigns API - Get Specific Category Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Gets a specific category linked to the requested campaign using its hash code. ```APIDOC ## GET /campaigns/{campaignId}/categories/{categoryHashCode} ### Description Gets a specific category linked to the requested campaign using its hash code. ### Method GET ### Endpoint /campaigns/{campaignId}/categories/{categoryHashCode} ### Parameters #### Path Parameters - **campaignId** (int) - Mandatory - The id of the campaign the categories are linked to. - **categoryHashCode** (int) - Mandatory - The id of the category to return. ### Response #### Success Response (200) - **CategoryMessage** (object) - A CategoryMessage object representing the requested category. #### Response Example ```json { "categoryId": 456, "categoryName": "Electronics", "isBiddable": true } ``` ``` -------------------------------- ### Category API Endpoints Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Endpoints for managing product categories. ```APIDOC ## GET /legacy/marketing/v1/categories ### Description Gets a list of all available categories. ### Method GET ### Endpoint /legacy/marketing/v1/categories ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **categories** (array) - A list of category objects. #### Response Example ```json { "categories": [ { "id": 1, "name": "Electronics" } ] } ``` ``` ```APIDOC ## PUT /legacy/marketing/v1/categories ### Description Enables or disables categories. ### Method PUT ### Endpoint /legacy/marketing/v1/categories ### Parameters #### Request Body - **categories** (array) - Required - A list of category objects with their status. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Categories updated successfully." } ``` ``` -------------------------------- ### GET /legacy/marketing/v1/advertisers/{advertiserId}/categories Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/AdvertiserApi.md Retrieves all categories associated with a specific advertiser. You can optionally filter to get only enabled categories. ```APIDOC ## GET /legacy/marketing/v1/advertisers/{advertiserId}/categories ### Description Gets all advertiser's categories. Get the list of all the categories linked to the requested advertiser. ### Method GET ### Endpoint /legacy/marketing/v1/advertisers/{advertiserId}/categories ### Parameters #### Path Parameters - **advertiserId** (int) - Required - The ID of the advertiser to return. #### Query Parameters - **enabledOnly** (bool) - Optional - Returns only categories you can bid on. Defaults to false. #### Request Body None ### Request Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Criteo\Marketing\Api\AdvertiserApi( new GuzzleHttp\Client(), $config ); $advertiser_id = 56; // int | Mandatory. The id of the advertiser to return. $enabled_only = True; // bool | Optional. Returns only categories you can bid on. Defaults to false. try { $result = $apiInstance->getCategories($advertiser_id, $enabled_only); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdvertiserApi->getCategories: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Response #### Success Response (200) - **response** (*\Criteo\Marketing\Model\CategoryMessage[]*) - An array of category messages. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Campaigns API - Get Categories Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Gets the list of categories linked to a specific campaign. You can optionally filter to return only categories that are enabled for bidding. ```APIDOC ## GET /campaigns/{campaignId}/categories ### Description Gets the list of categories linked to the requested campaign. You can optionally filter to return only categories that are enabled for bidding. ### Method GET ### Endpoint /campaigns/{campaignId}/categories ### Parameters #### Path Parameters - **campaignId** (int) - Mandatory - The id of the campaign the categories are linked to. #### Query Parameters - **enabled_only** (bool) - Optional - Returns only categories you can bid on. Defaults to false. ### Response #### Success Response (200) - **[]** (array) - An array of CategoryMessage objects. #### Response Example ```json [ { "categoryId": 456, "categoryName": "Electronics", "isBiddable": true } ] ``` ``` -------------------------------- ### Search Ad Sets Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Searches for ad sets based on specified filter criteria. ```APIDOC ## POST /adsets/search ### Description Searches for ad sets matching specified criteria. ### Method POST ### Endpoint `/adsets/search` ### Parameters #### Request Body - **filters** (object) - Required - Criteria to filter ad sets. - **advertiser_ids** (array) - Optional - List of advertiser IDs to filter by. - **ad_set_ids** (array) - Optional - List of ad set IDs to filter by. - **campaign_ids** (array) - Optional - List of campaign IDs to filter by. ### Request Example ```json { "filters": { "advertiser_ids": ["12345", "67890"], "ad_set_ids": [], "campaign_ids": [] } } ``` ### Response #### Success Response (200) - **data** (array) - A list of ad sets matching the search criteria. - Each object contains ad set details similar to the 'Get Ad Set' response. #### Response Example ```json { "data": [ { "id": "adset-123456", "attributes": { "name": "Example Ad Set 1", "status": "active" } }, { "id": "adset-789012", "attributes": { "name": "Example Ad Set 2", "status": "paused" } } ] } ``` ``` -------------------------------- ### OAuth API Endpoint Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Endpoint for obtaining OAuth 2.0 access tokens. ```APIDOC ## POST /oauth2/token ### Description Creates an OAuth 2.0 access token. ### Method POST ### Endpoint /oauth2/token ### Parameters #### Request Body - **grant_type** (string) - Required - The grant type (e.g., "client_credentials"). - **client_id** (string) - Required - The client ID. - **client_secret** (string) - Required - The client secret. ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token (e.g., "Bearer"). - **expires_in** (integer) - The token's expiration time in seconds. #### Response Example ```json { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 } ``` ``` -------------------------------- ### Comprehensive API Error Handling - PHP Source: https://context7.com/criteo/criteo-php-marketing-transition-sdk/llms.txt Demonstrates robust exception handling for API calls, including parsing ApiException for status codes, messages, detailed error responses, and request IDs. Requires the Criteo PHP SDK. ```php apiPortfolioGet(); print_r($result); } catch (ApiException $e) { echo "API Exception occurred:" . PHP_EOL; echo "Status Code: " . $e->getCode() . PHP_EOL; echo "Message: " . $e->getMessage() . PHP_EOL; // Parse response body for detailed error info $responseBody = $e->getResponseBody(); if ($responseBody) { $error = json_decode($responseBody, true); if (isset($error['errors'])) { foreach ($error['errors'] as $err) { echo "Error Code: " . ($err['code'] ?? 'N/A') . PHP_EOL; echo "Error Detail: " . ($err['detail'] ?? 'N/A') . PHP_EOL; } } } // Access response headers $headers = $e->getResponseHeaders(); if (isset($headers['X-Request-Id'])) { echo "Request ID: " . $headers['X-Request-Id'][0] . PHP_EOL; } } catch (Exception $e) { echo "General Exception: " . $e->getMessage() . PHP_EOL; } ``` -------------------------------- ### ReadAdSetBudget Model Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Model/ReadAdSetBudget.md This section details the properties available for configuring an ad set's budget within the Criteo Marketing SDK. ```APIDOC ## ReadAdSetBudget Model ### Description Provides configuration options for an ad set's budget, allowing for granular control over spending. ### Method N/A (This is a model definition, not an API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ##### budget_strategy (string) - Optional Specifies whether the budget is capped. ##### budget_renewal (string) - Optional Defines the pace at which the budget is renewed. ##### budget_delivery_smoothing (string) - Optional Controls the pace at which the budget is spent. ##### budget_delivery_week (string) - Optional Sets the delivery week for the budget. ##### budget_amount ([Criteo\Marketing\Model\NillableDecimal](NillableDecimal.md)) - Optional The monetary amount allocated for the budget. ### Request Example ```json { "budget_strategy": "capped", "budget_renewal": "daily", "budget_delivery_smoothing": "even", "budget_delivery_week": "2023-12-31", "budget_amount": "100.50" } ``` ### Response #### Success Response (200) This model is used in request bodies and does not represent a direct API response. #### Response Example N/A ``` -------------------------------- ### Campaign API Endpoints Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Endpoints for managing campaigns, ad sets, bids, and categories. ```APIDOC ## GET /2021-04/marketing-solutions/ad-sets/{adSetId} ### Description Retrieves details of a specific ad set. ### Method GET ### Endpoint /2021-04/marketing-solutions/ad-sets/{adSetId} ### Parameters #### Path Parameters - **adSetId** (string) - Required - The ID of the ad set. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **adSet** (object) - Details of the ad set. #### Response Example ```json { "adSet": { "id": "adset_123", "name": "Summer Sale Ad Set" } } ``` ``` ```APIDOC ## GET /legacy/marketing/v1/campaigns/bids ### Description Gets the bids for campaigns and their categories. ### Method GET ### Endpoint /legacy/marketing/v1/campaigns/bids ### Parameters #### Query Parameters - **campaignIds** (array) - Optional - A list of campaign IDs to filter by. #### Request Body None ### Response #### Success Response (200) - **bids** (object) - Bid information for campaigns and categories. #### Response Example ```json { "bids": { "campaign_abc": { "category_1": 0.50 } } } ``` ``` ```APIDOC ## GET /legacy/marketing/v1/campaigns/{campaignId}/categories ### Description Gets categories for a specific campaign. ### Method GET ### Endpoint /legacy/marketing/v1/campaigns/{campaignId}/categories ### Parameters #### Path Parameters - **campaignId** (string) - Required - The ID of the campaign. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **categories** (array) - A list of campaign categories. #### Response Example ```json { "categories": [ { "id": 1, "name": "Electronics" } ] } ``` ``` ```APIDOC ## GET /legacy/marketing/v1/campaigns/{campaignId}/categories/{categoryHashCode} ### Description Gets a specific category for a campaign. ### Method GET ### Endpoint /legacy/marketing/v1/campaigns/{campaignId}/categories/{categoryHashCode} ### Parameters #### Path Parameters - **campaignId** (string) - Required - The ID of the campaign. - **categoryHashCode** (string) - Required - The hash code of the category. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **category** (object) - Details of the specific category. #### Response Example ```json { "category": { "id": 1, "name": "Electronics" } } ``` ``` ```APIDOC ## PATCH /2021-04/marketing-solutions/ad-sets ### Description Updates multiple ad sets. ### Method PATCH ### Endpoint /2021-04/marketing-solutions/ad-sets ### Parameters #### Request Body - **adSets** (array) - Required - A list of ad sets to update. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Ad sets updated successfully." } ``` ``` ```APIDOC ## POST /2021-04/marketing-solutions/ad-sets/search ### Description Searches for ad sets based on specified criteria. ### Method POST ### Endpoint /2021-04/marketing-solutions/ad-sets/search ### Parameters #### Request Body - **criteria** (object) - Required - Search criteria for ad sets. ### Response #### Success Response (200) - **adSets** (array) - A list of ad sets matching the criteria. #### Response Example ```json { "adSets": [ { "id": "adset_123", "name": "Summer Sale Ad Set" } ] } ``` ``` ```APIDOC ## POST /2021-04/marketing-solutions/ad-sets/start ### Description Starts multiple ad sets. ### Method POST ### Endpoint /2021-04/marketing-solutions/ad-sets/start ### Parameters #### Request Body - **adSetIds** (array) - Required - A list of ad set IDs to start. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Ad sets started successfully." } ``` ``` ```APIDOC ## POST /2021-04/marketing-solutions/ad-sets/stop ### Description Stops multiple ad sets. ### Method POST ### Endpoint /2021-04/marketing-solutions/ad-sets/stop ### Parameters #### Request Body - **adSetIds** (array) - Required - A list of ad set IDs to stop. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Ad sets stopped successfully." } ``` ``` ```APIDOC ## PUT /legacy/marketing/v1/campaigns/bids ### Description Updates bids for campaigns and their categories. ### Method PUT ### Endpoint /legacy/marketing/v1/campaigns/bids ### Parameters #### Request Body - **bids** (object) - Required - An object containing campaign IDs and their updated bids. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Bids updated successfully." } ``` ``` -------------------------------- ### GET /legacy/marketing/v1/campaigns/{campaignId}/categories Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/docs/Api/CampaignApi.md Retrieves categories for a specific campaign. ```APIDOC ## GET /legacy/marketing/v1/campaigns/{campaignId}/categories ### Description Gets categories for a specific campaign. ### Method GET ### Endpoint /legacy/marketing/v1/campaigns/{campaignId}/categories ### Parameters #### Path Parameters - **campaignId** (string) - Required - The ID of the campaign. ### Response #### Success Response (200) - **Category[]** (*\Criteo\Marketing\Model\Category[]*) - An array of categories associated with the campaign. ### Authorization [Authorization](../../README.md#Authorization) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: text/plain, application/json, text/json ``` -------------------------------- ### Audience API Endpoints Source: https://github.com/criteo/criteo-php-marketing-transition-sdk/blob/main/README.md Endpoints for managing user audiences. ```APIDOC ## POST /2021-04/audiences ### Description Creates a new audience. ### Method POST ### Endpoint /2021-04/audiences ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the audience. - **description** (string) - Optional - A description for the audience. ### Response #### Success Response (200) - **audienceId** (string) - The ID of the newly created audience. #### Response Example ```json { "audienceId": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` ```APIDOC ## DELETE /2021-04/audiences/{audience-id}/contactlist ### Description Deletes identifiers from an audience's contact list. ### Method DELETE ### Endpoint /2021-04/audiences/{audience-id}/contactlist ### Parameters #### Path Parameters - **audience-id** (string) - Required - The ID of the audience. #### Query Parameters None #### Request Body - **identifiers** (array) - Required - A list of identifiers to remove. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Identifiers removed successfully." } ``` ``` ```APIDOC ## GET /2021-04/audiences ### Description Retrieves a list of all audiences. ### Method GET ### Endpoint /2021-04/audiences ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of audiences to return. - **offset** (integer) - Optional - The number of audiences to skip. #### Request Body None ### Response #### Success Response (200) - **audiences** (array) - A list of audience objects. #### Response Example ```json { "audiences": [ { "audienceId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "Example Audience" } ] } ``` ``` ```APIDOC ## PATCH /2021-04/audiences/{audience-id} ### Description Modifies an existing audience. ### Method PATCH ### Endpoint /2021-04/audiences/{audience-id} ### Parameters #### Path Parameters - **audience-id** (string) - Required - The ID of the audience to modify. #### Query Parameters None #### Request Body - **name** (string) - Optional - The new name for the audience. - **description** (string) - Optional - The new description for the audience. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Audience updated successfully." } ``` ``` ```APIDOC ## PATCH /2021-04/audiences/{audience-id}/contactlist ### Description Modifies users within an audience's contact list. ### Method PATCH ### Endpoint /2021-04/audiences/{audience-id}/contactlist ### Parameters #### Path Parameters - **audience-id** (string) - Required - The ID of the audience. #### Query Parameters None #### Request Body - **identifiers** (array) - Required - A list of identifiers to add or update. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Contact list updated successfully." } ``` ``` ```APIDOC ## DELETE /2021-04/audiences/{audience-id} ### Description Removes an audience. ### Method DELETE ### Endpoint /2021-04/audiences/{audience-id} ### Parameters #### Path Parameters - **audience-id** (string) - Required - The ID of the audience to remove. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Audience removed successfully." } ``` ```