cedricziel / amznprofilesapiphp
Amazon Advertising profiles 的 API 客户端
v1.1.3
2024-08-06 16:03 UTC
Requires
- php: ^8.3
- jane-php/open-api-runtime: ^7.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- jane-php/open-api-3: ^7.8
- symfony/yaml: ^7.1
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