criteo/criteo-api-marketingsolutions-sdk

PHP SDK for Criteo API 0.0.221102 version


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:

  • 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-marketingsolutions-sdk:0.0.221102

or add the following to composer.json:

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

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/criteo-api-marketingsolutions-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\marketingsolutions\preview\Api\AdvertiserApi(new criteo\api\marketingsolutions\preview\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 /preview/advertisers/me
AdvertiserApi createAdvertiser POST /preview/advertisers
AdvertiserApi getDatasetList GET /preview/advertisers/{advertiser-id}/datasets
AdvertiserApi listIndustries GET /preview/industries
AnalyticsApi getAdsetReport POST /preview/statistics/report
AnalyticsApi getCategoriesReport POST /preview/categories/report
AnalyticsApi getCreativesReport POST /preview/reports/creatives
AnalyticsApi getPlacementsReport POST /preview/placements/report
AnalyticsApi getTopProductsReport POST /preview/reports/top-products
AnalyticsApi getTransactionsReport POST /preview/transactions/report
AnalyticsApi getTransparencyReport POST /preview/log-level/advertisers/{advertiser-id}/report
AudienceApi bulkCreateAudienceSegments POST /preview/marketing-solutions/audience-segments/create
AudienceApi bulkCreateAudiences POST /preview/marketing-solutions/audiences/create
AudienceApi bulkDeleteAudienceSegment POST /preview/marketing-solutions/audience-segments/delete
AudienceApi bulkDeleteAudiences POST /preview/marketing-solutions/audiences/delete
AudienceApi bulkUpdateAudienceSegments PATCH /preview/marketing-solutions/audience-segments
AudienceApi bulkUpdateAudiences PATCH /preview/marketing-solutions/audiences
AudienceApi computeAudienceSegmentsSizes POST /preview/marketing-solutions/audience-segments/compute-sizes
AudienceApi computeAudiencesSizes POST /preview/marketing-solutions/audiences/compute-sizes
AudienceApi deleteContactListIdentifiers DELETE /preview/marketing-solutions/audience-segments/{audience-segment-id}/contact-list
AudienceApi estimateAudienceSegmentSize POST /preview/marketing-solutions/audience-segments/estimate-size
AudienceApi estimateAudienceSize POST /preview/marketing-solutions/audiences/estimate-size
AudienceApi getCommerceBrands GET /preview/marketing-solutions/audience-segments/commerce-brands
AudienceApi getCommerceInterests GET /preview/marketing-solutions/audience-segments/commerce-interests
AudienceApi getContactListStatistics GET /preview/marketing-solutions/audience-segments/{audience-segment-id}/contact-list
AudienceApi modifyAudienceUsersWithAttributes PATCH /preview/audiences/{audience-id}/contactlist-attributes
AudienceApi searchAudienceSegments POST /preview/marketing-solutions/audience-segments/search
AudienceApi searchAudiences POST /preview/marketing-solutions/audiences/search
AudienceApi updateContactListIdentifiers PATCH /preview/marketing-solutions/audience-segments/{audience-segment-id}/contact-list
CampaignApi createAdSet POST /preview/marketing-solutions/ad-sets
CampaignApi createCampaign POST /preview/marketing-solutions/campaigns
CampaignApi deleteAdvertiserBundleRules DELETE /preview/advertisers/{advertiserId}/targeting/bundle-rules
CampaignApi deleteAdvertiserDomainRules DELETE /preview/advertisers/{advertiserId}/targeting/domain-rules
CampaignApi deleteCampaignBundleRules DELETE /preview/campaigns/{campaignId}/targeting/bundle-rules
CampaignApi deleteCampaignDomainRules DELETE /preview/campaigns/{campaignId}/targeting/domain-rules
CampaignApi deleteOCIbrandSafetyRule DELETE /preview/brand-safety/oci
CampaignApi deleteOCItargetingRule DELETE /preview/targeting/oci
CampaignApi disableAdSetTargetingDealIds POST /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/deal-ids/disable
CampaignApi disableAdSetTargetingVideoPositioning POST /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/video-positionings/disable
CampaignApi getAdSet GET /preview/marketing-solutions/ad-sets/{adSetId}
CampaignApi getAdSetTargetingDealIds GET /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/deal-ids
CampaignApi getAdSetTargetingVideoPositioning GET /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/video-positioning
CampaignApi getAdvertiserBundleRules GET /preview/advertisers/{advertiserId}/targeting/bundle-rules
CampaignApi getAdvertiserDomainRules GET /preview/advertisers/{advertiserId}/targeting/domain-rules
CampaignApi getCampaign GET /preview/marketing-solutions/campaigns/{campaign-id}
CampaignApi getCampaignBundleRules GET /preview/campaigns/{campaignId}/targeting/bundle-rules
CampaignApi getCampaignDomainRules GET /preview/campaigns/{campaignId}/targeting/domain-rules
CampaignApi getCategoryBidList GET /preview/marketing-solutions/ad-sets/{ad-set-id}/category-bids
CampaignApi getDisplayMultipliers GET /preview/marketing-solutions/ad-sets/{ad-set-id}/display-multipliers
CampaignApi getOCIbrandSafetyRule GET /preview/brand-safety/oci
CampaignApi getOCItargetingRule GET /preview/targeting/oci
CampaignApi getSupplyVendorList GET /preview/marketing-solutions/ad-sets/targeting/supply-vendors
CampaignApi patchAdSets PATCH /preview/marketing-solutions/ad-sets
CampaignApi patchCampaigns PATCH /preview/marketing-solutions/campaigns
CampaignApi patchCategoryBidList PATCH /preview/marketing-solutions/ad-sets/{ad-set-id}/category-bids
CampaignApi patchDisplayMultipliers PATCH /preview/marketing-solutions/ad-sets/{ad-set-id}/display-multipliers
CampaignApi postAdvertiserBundleRules POST /preview/advertisers/{advertiserId}/targeting/bundle-rules
CampaignApi postAdvertiserDomainRules POST /preview/advertisers/{advertiserId}/targeting/domain-rules
CampaignApi postCampaignBundleRules POST /preview/campaigns/{campaignId}/targeting/bundle-rules
CampaignApi postCampaignDomainRules POST /preview/campaigns/{campaignId}/targeting/domain-rules
CampaignApi putAdvertiserBundleRules PUT /preview/advertisers/{advertiserId}/targeting/bundle-rules
CampaignApi putAdvertiserDomainRules PUT /preview/advertisers/{advertiserId}/targeting/domain-rules
CampaignApi putCampaignBundleRules PUT /preview/campaigns/{campaignId}/targeting/bundle-rules
CampaignApi putCampaignDomainRules PUT /preview/campaigns/{campaignId}/targeting/domain-rules
CampaignApi searchAdSets POST /preview/marketing-solutions/ad-sets/search
CampaignApi searchCampaigns POST /preview/marketing-solutions/campaigns/search
CampaignApi setAdSetTargetingDealIds PUT /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/deal-ids
CampaignApi setAdSetTargetingVideoPositioning PUT /preview/marketing-solutions/ad-sets/{ad-set-id}/targeting/video-positioning
CampaignApi startAdSets POST /preview/marketing-solutions/ad-sets/start
CampaignApi stopAdSets POST /preview/marketing-solutions/ad-sets/stop
CampaignApi updateAdSetAudience PUT /preview/marketing-solutions/ad-sets/{ad-set-id}/audience
CampaignApi upsertOCIbrandSafetyRule POST /preview/brand-safety/oci
CampaignApi upsertOCItargetingRule POST /preview/targeting/oci
CatalogApi previewCatalogProductsBatchPost POST /preview/catalog/products/batch
CatalogApi previewCatalogProductsBatchReportOperationTokenGet GET /preview/catalog/products/batch/report/{operation-token}
CreativeApi createAd POST /preview/advertisers/{advertiser-id}/ads
CreativeApi createCoupon POST /preview/advertisers/{advertiser-id}/coupons
CreativeApi createCreative POST /preview/advertisers/{advertiser-id}/creatives
CreativeApi deleteAd DELETE /preview/ads/{id}
CreativeApi deleteCoupon DELETE /preview/advertisers/{advertiser-id}/coupons/{id}
CreativeApi deleteCreative DELETE /preview/creatives/{id}
CreativeApi editCoupon PUT /preview/advertisers/{advertiser-id}/coupons/{id}
CreativeApi editCreative PUT /preview/creatives/{id}
CreativeApi getAd GET /preview/ads/{id}
CreativeApi getAds GET /preview/advertisers/{advertiser-id}/ads
CreativeApi getCoupon GET /preview/advertisers/{advertiser-id}/coupons/{id}
CreativeApi getCouponPreview GET /preview/advertisers/{advertiser-id}/coupons/{id}/preview
CreativeApi getCouponSupportedSizes GET /preview/advertisers/{advertiser-id}/coupons-supported-sizes
CreativeApi getCoupons GET /preview/advertisers/{advertiser-id}/coupons
CreativeApi getCreative GET /preview/creatives/{id}
CreativeApi getCreativePreviewPost POST /preview/creatives/{id}/preview
CreativeApi getCreatives GET /preview/advertisers/{advertiser-id}/creatives
GatewayApi getCurrentApplication GET /me
OAuthApi getToken POST /oauth2/token Creates a token based either on supplied client credentials or on single use authorization code
OnSiteRecommendationApi apiV1RecoPost POST /preview/recommendation/search
RecoApi createProductSet POST /preview/product-sets
RecoApi fetchProductSet GET /preview/product-sets/{product-set-id}
RecoApi fetchProductSets GET /preview/product-sets/dataset/{dataset-id}
RecoApi previewProductSetsPreviewPost POST /preview/product-sets/preview
RecoApi removeProductSet DELETE /preview/product-sets/{product-set-id}

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.