Skip to content

BianoCZ/criteo-api-retailmedia-php-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Criteo API SDK for PHP

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:

  • Package version: 0.0.221102
  • 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-retailmedia-sdk:0.0.221102

or add the following to composer.json:

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

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/criteo-api-retailmedia-sdk/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\retailmedia\preview\Api\AnalyticsApi(new criteo\api\retailmedia\preview\TokenAutoRefreshClient($clientId, $clientSecret));

$report_id = ee439121-13e3-4734-9f67-c504dd921a41;

try {
$result = $apiInstance->getReportOutput($report_id);
print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnalyticsApi->getReportOutput: ', $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
AnalyticsApi getReportOutput GET /preview/retail-media/reports/{reportId}/output
AnalyticsApi getReportStatus GET /preview/retail-media/reports/{reportId}/status
AnalyticsApi requestCampaignReport POST /preview/retail-media/reports/campaigns
AnalyticsApi requestLineItemReport POST /preview/retail-media/reports/line-items
AudienceApi createAudience POST /preview/retail-media/accounts/{accountId}/audiences
AudienceApi getAudiencesByAccountId GET /preview/retail-media/accounts/{accountId}/audiences
CampaignApi deleteApi202210ExternalLineItemProductButtonsByLineItemIdProductButtonId DELETE /preview/retail-media/line-items/{line-item-id}/product-buttons/{product-button-id}
CampaignApi deleteApiV1ExternalBalanceCampaignsByBalanceId DELETE /preview/retail-media/balances/{balanceId}/campaigns
CampaignApi deleteApiV1ExternalLineItemProductsByLineItemId DELETE /preview/retail-media/line-items/{lineItemId}/products
CampaignApi getApi202210ExternalLineItemProductButtonsByLineItemId GET /preview/retail-media/line-items/{line-item-id}/product-buttons
CampaignApi getApi202210ExternalLineItemProductButtonsByLineItemIdProductButtonId GET /preview/retail-media/line-items/{line-item-id}/product-buttons/{product-button-id}
CampaignApi getApiV0ExternalCatalogOutputByCatalogId GET /preview/retail-media/catalogs/{catalogId}/output
CampaignApi getApiV0ExternalCatalogStatusByCatalogId GET /preview/retail-media/catalogs/{catalogId}/status
CampaignApi getApiV1ExternalAccountBalancesByAccountId GET /preview/retail-media/accounts/{accountId}/balances
CampaignApi getApiV1ExternalAccountBrandsByAccountId GET /preview/retail-media/accounts/{accountId}/brands
CampaignApi getApiV1ExternalAccountCampaignsByAccountId GET /preview/retail-media/accounts/{accountId}/campaigns
CampaignApi getApiV1ExternalAccountRetailersByAccountId GET /preview/retail-media/accounts/{accountId}/retailers
CampaignApi getApiV1ExternalAccounts GET /preview/retail-media/accounts
CampaignApi getApiV1ExternalBalanceCampaignsByBalanceId GET /preview/retail-media/balances/{balanceId}/campaigns
CampaignApi getApiV1ExternalCampaignByCampaignId GET /preview/retail-media/campaigns/{campaignId}
CampaignApi getApiV1ExternalCampaignLineItemsByCampaignId GET /preview/retail-media/campaigns/{campaignId}/line-items
CampaignApi getApiV1ExternalLineItemByLineItemId GET /preview/retail-media/line-items/{lineItemId}
CampaignApi getApiV1ExternalLineItemProductsByLineItemId GET /preview/retail-media/line-items/{lineItemId}/products
CampaignApi getApiV1ExternalRetailerBrandsByRetailerId GET /preview/retail-media/retailers/{retailerId}/brands
CampaignApi getApiV1ExternalRetailerByRetailerIdSellerBySeller GET /preview/retail-media/retailers/{retailerId}/sellers/{seller}
CampaignApi postApi202210ExternalLineItemProductButtonsCreateByLineItemId POST /preview/retail-media/line-items/{line-item-id}/product-buttons/create
CampaignApi postApiV0ExternalAccountCatalogsByAccountId POST /preview/retail-media/accounts/{accountId}/catalogs
CampaignApi postApiV1ExternalAccountCampaignsByAccountId POST /preview/retail-media/accounts/{accountId}/campaigns
CampaignApi postApiV1ExternalCampaignLineItemsByCampaignId POST /preview/retail-media/campaigns/{campaignId}/line-items
CampaignApi postApiV1ExternalCatalogsSkuRetrieval POST /preview/retail-media/catalogs/sku-retrieval
CampaignApi postApiV1ExternalCatalogsSkuSearch POST /preview/retail-media/catalogs/sku-search
CampaignApi putApi202210ExternalLineItemProductButtonsByLineItemIdProductButtonId PUT /preview/retail-media/line-items/{line-item-id}/product-buttons/{product-button-id}
CampaignApi putApiV1ExternalBalanceCampaignsByBalanceId PUT /preview/retail-media/balances/{balanceId}/campaigns
CampaignApi putApiV1ExternalCampaignByCampaignId PUT /preview/retail-media/campaigns/{campaignId}
CampaignApi putApiV1ExternalLineItemByLineItemId PUT /preview/retail-media/line-items/{lineItemId}
CampaignApi putApiV1ExternalLineItemProductsByLineItemId PUT /preview/retail-media/line-items/{lineItemId}/products
GatewayApi getCurrentApplication GET /me
OAuthApi getToken POST /oauth2/token Creates a token based either on supplied client credentials or on single use authorization code

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.

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%