Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedricziel/amzn-profiles-api-php
PHP Client for the Amazon Advertising Profiles API
https://github.com/cedricziel/amzn-profiles-api-php
Last synced: 11 days ago
JSON representation
PHP Client for the Amazon Advertising Profiles API
- Host: GitHub
- URL: https://github.com/cedricziel/amzn-profiles-api-php
- Owner: cedricziel
- Created: 2024-08-04T11:31:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T16:03:51.000Z (3 months ago)
- Last Synced: 2024-10-11T20:09:27.331Z (25 days ago)
- Language: PHP
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# amzn-profiles-api-php
PHP Client for the Amazon Advertising Profiles API
```shell
composer require cedricziel/amznprofilesapiphp
```## Docs
### General
Instantiate a client, configure your secrets and continue to use:
```php
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
Gets a list of profiles.
Note that this operation does not return a response unless the current account has created at least one campaign using the advertising console.
```php
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
Update the daily budget for one or more profiles.
Note that this operation is only used for Sellers using Sponsored Products. This operation is not enabled for vendor type accounts.
```php
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}
Gets a profile specified by identifier.
This operation does not return a response unless the current account has created at least one campaign using the advertising console.
```php
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]);
```## License
Apache 2.0