criteo/criteo-api-marketingsolutions-sdk

Official Criteo API PHP SDK for Marketing Solutions Service

2021.10.0.211126 2021-11-26 17:12 UTC

This package is auto-updated.

Last update: 2021-11-29 10:38:39 UTC


README

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.

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:
  • 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-api-php-sdk

or add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/criteo-api-marketingsolutions-sdk-php/vendor/autoload.php');

Tests

To run the unit tests:

composer run-script test

Getting Started

Please follow the installation procedure and then run the following:

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

$clientId = 'YOUR_CLIENT_ID';
$clientSecret = 'YOUR_CLIENT_SECRET';

// Automatic token refresh
$apiInstance = new criteo\api\marketingsolutions\v2021_10\Api\AdvertiserApi(new TokenAutoRefreshClient($clientId, $clientSecret));


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-10/advertisers/me
AnalyticsApi getAdsetReport POST /2021-10/statistics/report
AnalyticsApi getTransactionsReport POST /2021-10/transactions/report
AnalyticsApi getTransparencyReport POST /2021-10/log-level/advertisers/{advertiser-id}/report
AudienceApi createAudience POST /2021-10/audiences
AudienceApi deleteIdentifiers DELETE /2021-10/audiences/{audience-id}/contactlist
AudienceApi getAudiences GET /2021-10/audiences
AudienceApi modifyAudience PATCH /2021-10/audiences/{audience-id}
AudienceApi modifyAudienceUsers PATCH /2021-10/audiences/{audience-id}/contactlist
AudienceApi removeAudience DELETE /2021-10/audiences/{audience-id}
CampaignApi getAdSet GET /2021-10/marketing-solutions/ad-sets/{adSetId}
CampaignApi getCampaign GET /2021-10/marketing-solutions/campaigns/{campaign-id}
CampaignApi patchAdSets PATCH /2021-10/marketing-solutions/ad-sets
CampaignApi patchCampaigns PATCH /2021-10/marketing-solutions/campaigns
CampaignApi searchAdSets POST /2021-10/marketing-solutions/ad-sets/search
CampaignApi searchCampaigns POST /2021-10/marketing-solutions/campaigns/search
CampaignApi startAdSets POST /2021-10/marketing-solutions/ad-sets/start
CampaignApi stopAdSets POST /2021-10/marketing-solutions/ad-sets/stop
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.

oauth

  • 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.