cedricziel/amznprofilesapiphp

Amazon Advertising profiles 的 API 客户端

v1.1.3 2024-08-06 16:03 UTC

This package is auto-updated.

Last update: 2024-09-06 16:13:33 UTC


README

Amazon Advertising Profiles API 的 PHP 客户端

composer require cedricziel/amznprofilesapiphp

文档

通用

实例化客户端,配置您的密钥并继续使用

use CedricZiel\AmznAdvertisingProfilesApi\AdvertisingProfilesClient;
use CedricZiel\AmznAdvertisingProfilesApi\Endpoint;
use CedricZiel\AmznAdvertisingProfilesApi\Header;

// You need to obtain a token via the Amazon LwA workflow
$token = '..';

$client = AdvertisingProfilesClient::createFor(
    Endpoint::Europe,
    $token,
);

// execute the endpoint of choice, see below ...
$client->listProfiles([], [Header::AmazonAdvertisingApiClientId->value => $clientId]);

listProfiles - get /v2/profiles

获取配置文件列表。

请注意,此操作不会返回响应,除非当前账户至少使用广告控制台创建了一个活动。

use CedricZiel\AmznAdvertisingProfilesApi\AdvertisingProfilesClient;
use CedricZiel\AmznAdvertisingProfilesApi\Endpoint;
use CedricZiel\AmznAdvertisingProfilesApi\Header;
// see above how to create a client
$accessToken = '...';
$clientId = '...';
$client = AdvertisingProfilesClient::createFor(Endpoint::Europe, $accessToken);
$client->listProfiles([], [Header::AmazonAdvertisingApiClientId->value => $clientId]);

updateProfiles - put /v2/profiles

更新一个或多个配置文件的每日预算。

请注意,此操作仅用于使用赞助产品的卖家。此操作未启用针对供应商类型账户。

use CedricZiel\AmznAdvertisingProfilesApi\AdvertisingProfilesClient;
use CedricZiel\AmznAdvertisingProfilesApi\Endpoint;
use CedricZiel\AmznAdvertisingProfilesApi\Header;
// see above how to create a client
$accessToken = '...';
$clientId = '...';
$client = AdvertisingProfilesClient::createFor(Endpoint::Europe, $accessToken);
$client->updateProfiles([], [Header::AmazonAdvertisingApiClientId->value => $clientId]);

getProfileById - get /v2/profiles/{profileId}

通过标识符获取配置文件。

此操作不会返回响应,除非当前账户至少使用广告控制台创建了一个活动。

use CedricZiel\AmznAdvertisingProfilesApi\AdvertisingProfilesClient;
use CedricZiel\AmznAdvertisingProfilesApi\Endpoint;
use CedricZiel\AmznAdvertisingProfilesApi\Header;
// see above how to create a client
$accessToken = '...';
$clientId = '...';
$client = AdvertisingProfilesClient::createFor(Endpoint::Europe, $accessToken);
$client->getProfileById([], [Header::AmazonAdvertisingApiClientId->value => $clientId]);

许可证

Apache 2.0