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
PHP 7.1 and later
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
Download the files and include autoload.php
:
require_once('/path/to/criteo-api-retailmedia-sdk/vendor/autoload.php');
To run the unit tests:
composer run-script test
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.
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 |
- AccessTokenModel
- ApplicationSummaryModel
- ApplicationSummaryModelResource
- ApplicationSummaryModelResponse
- BadRequest
- BrandPreview
- BrandPreviewListResponse
- CommonError
- CommonProblem
- CommonWarning
- CreateRetailMediaAudience
- CreateRetailMediaAudienceAttributes
- CreateRetailMediaAudienceBody
- CreateRetailMediaAudienceRequest
- CreateRetailMediaAudienceResponse
- CustomerListDetails
- EnvelopeReportRequest
- EnvelopeReportStatus
- Error
- ExternalAccount
- ExternalBalance
- ExternalBalanceCampaign
- ExternalBrand
- ExternalCampaign
- ExternalCampaignAttributes
- ExternalCatalogRequestPreview
- ExternalCatalogStatus
- ExternalDeleteBalanceCampaign
- ExternalEditableCampaignAttributes
- ExternalEditableLineItemAttributes
- ExternalLineItem
- ExternalLineItemAttributes
- ExternalPostCampaign
- ExternalPostLineItem
- ExternalProductButtonRequest
- ExternalProductButtonResponse
- ExternalPromotedProduct
- ExternalPutBalanceCampaign
- ExternalPutCampaign
- ExternalPutLineItem
- ExternalRetailer
- GetPageOfAudiencesByAccountIdResponse
- JsonApiBodyWithExternalIdOfEditableCampaignAttributesAndCampaign
- JsonApiBodyWithExternalIdOfEditableLineItemAttributesAndLineItem
- JsonApiBodyWithIdOfInt64AndAccountAndAccount
- JsonApiBodyWithIdOfInt64AndBalanceAndBalance
- JsonApiBodyWithIdOfInt64AndBrandAndBrand
- JsonApiBodyWithIdOfInt64AndCampaignAndCampaign
- JsonApiBodyWithIdOfInt64AndCatalogStatusAndCatalogStatus
- JsonApiBodyWithIdOfInt64AndLineItemAndLineItem
- JsonApiBodyWithIdOfInt64AndRetailerAndRetailer
- JsonApiBodyWithIdOfStringAndPromotedProductAndPromotedProduct
- JsonApiBodyWithoutIdOfCampaignAttributesAndCampaign
- JsonApiBodyWithoutIdOfCatalogRequestAndCatalogRequestPreview
- JsonApiBodyWithoutIdOfLineItemAttributesAndLineItem
- JsonApiDataRequestOfDeleteBalanceCampaign
- JsonApiDataRequestOfPutBalanceCampaign
- JsonApiDataRequestWithIdOfStringAndPromotedProduct
- JsonApiPageResponseOfAccount
- JsonApiPageResponseOfBalance
- JsonApiPageResponseOfBrand
- JsonApiPageResponseOfCampaign
- JsonApiPageResponseOfLineItem
- JsonApiPageResponseOfRetailer
- JsonApiPageResponseOfStringAndPromotedProduct
- JsonApiRequestOfCatalogRequestPreview
- JsonApiSingleResponseOfCampaign
- JsonApiSingleResponseOfCatalogStatus
- JsonApiSingleResponseOfLineItem
- OAuthErrorModel
- PageMetadata
- PageOfBalanceCampaign
- ProblemDetails
- ProductButtonListRequest
- ProductButtonListResponse
- ProductButtonRequest
- ProductButtonResponse
- ReportRequest
- ReportRequestAttributes
- ReportStatus
- ReportStatusAttributes
- ResourceOfBrandPreview
- ResourceOfProductButtonRequest
- ResourceOfProductButtonResponse
- ResourceOfSellerPreview
- ResourceOfSkuDataPreview
- ResourceOfSkuSearchRequestPreview
- RetailMediaAudience
- RetailMediaAudienceAttributes
- SellerPreview
- SellerPreviewResponse
- SkuDataPreview
- SkuDataPreviewListResponse
- SkuSearchRequestPreview
- SkuSearchRequestPreviewRequest
- UserBehaviorDetails
In order to ease usage of this client library, you might want to use the TokenAutoRefreshClient as explained in the example.
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes: N/A
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.