criteo/criteo-php-marketing-transition-sdk

Official Criteo PHP Marketing Transition SDK

1.0.3 2021-06-14 14:44 UTC

This package is not auto-updated.

Last update: 2024-04-10 01:31:55 UTC


README

This project is deprecated

We've built a new set of SDKs to help you use our Criteo's API.

You can find the new PHP SDKs repositories here : https://github.com/criteo/criteo-api-marketingsolutions-php-sdk and https://github.com/criteo/criteo-api-retailmedia-php-sdk

Introduction

API Client Libraries can facilitate your use of the Criteo API allowing you to build unique and customized solutions to serve your businesses and clients. These libraries can reduce the amount of code you need to write in order to start accessing Criteo programmatically. They also can help expedite troubleshooting, should you encounter any issues. This Transition SDK will help you migrate from MAPI to Criteo API. We will support it until end of 2021 when we will decommission the /legacy endpoints. After that date we will only support our official versioned Client Libraries available in Q3 2021.

More information: https://developers.criteo.com/marketing-solutions/docs/php-api-client-library

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2021-04
  • Package version: 1.0.3
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

Requirements

PHP 7.1 and later

Installation & Usage

Composer

To install the bindings via Composer:

either run the following command: composer require criteo/criteo-php-marketing-transition-sdk

or add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/criteo/criteo-php-marketing-transition-sdk.git"
    }
  ],
  "require": {
    "criteo/criteo-php-marketing-transition-sdk": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/CriteoMarketingTransition/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

$clientId = 'YOUR_CLIENT_ID';
$clientCredentials = 'YOUR_PASSWORD';

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


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

?>

You can find the full example here.

Documentation for API Endpoints

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

Class Method HTTP request Description
AdvertiserApi apiPortfolioGet GET /2021-04/advertisers/me
AdvertiserApi getCategories GET /legacy/marketing/v1/advertisers/{advertiserId}/categories Gets all advertiser's categories
AdvertiserApi getCategory GET /legacy/marketing/v1/advertisers/{advertiserId}/categories/{categoryHashCode} Gets a specific advertiser's category
AnalyticsApi getAdsetReport POST /2021-04/statistics/report
AnalyticsApi getTransactionsReport POST /2021-04/transactions/report
AudienceApi createAudience POST /2021-04/audiences
AudienceApi deleteIdentifiers DELETE /2021-04/audiences/{audience-id}/contactlist
AudienceApi getAudiences GET /2021-04/audiences
AudienceApi modifyAudience PATCH /2021-04/audiences/{audience-id}
AudienceApi modifyAudienceUsers PATCH /2021-04/audiences/{audience-id}/contactlist
AudienceApi removeAudience DELETE /2021-04/audiences/{audience-id}
CampaignApi getAdSet GET /2021-04/marketing-solutions/ad-sets/{adSetId}
CampaignApi getBids GET /legacy/marketing/v1/campaigns/bids Gets a the bids for campaigns and their categories
CampaignApi getCategories GET /legacy/marketing/v1/campaigns/{campaignId}/categories Gets categories
CampaignApi getCategory GET /legacy/marketing/v1/campaigns/{campaignId}/categories/{categoryHashCode} Gets a specific category
CampaignApi patchAdSets PATCH /2021-04/marketing-solutions/ad-sets
CampaignApi searchAdSets POST /2021-04/marketing-solutions/ad-sets/search
CampaignApi startAdSets POST /2021-04/marketing-solutions/ad-sets/start
CampaignApi stopAdSets POST /2021-04/marketing-solutions/ad-sets/stop
CampaignApi updateBids PUT /legacy/marketing/v1/campaigns/bids Update bids for campaigns and their categories
CategoryApi getCategories GET /legacy/marketing/v1/categories Gets categories
CategoryApi updateCategories PUT /legacy/marketing/v1/categories Enables/disables categories
OAuthApi createToken POST /oauth2/token

Documentation For Models

Documentation For Authorization

In order to ease usage of this client library, you might want to use the TokenAutoRefreshClient as explained in the example.

Authorization

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Author

Criteo

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.