PHPackages                             dmytroklyman/amazon-advertising-api-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dmytroklyman/amazon-advertising-api-php-sdk

ActiveLibrary

dmytroklyman/amazon-advertising-api-php-sdk
===========================================

Amazon Advertising API Client Library

1.2.6(7y ago)018OSL-2.0PHPPHP &gt;=5.6.0

Since Aug 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/dmytroklyman/amazon-advertising-api-php-sdk)[ Packagist](https://packagist.org/packages/dmytroklyman/amazon-advertising-api-php-sdk)[ Docs](https://advertising.amazon.com/)[ RSS](/packages/dmytroklyman-amazon-advertising-api-php-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/5d765a45b062f40cee4f0f4e9f0bd36b98ee9ef91574c3f0da81d9dbc654cf14/68747470733a2f2f706f7365722e707567782e6f72672f646d7974726f6b6c796d616e2f616d617a6f6e2d6164766572746973696e672d6170692d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/dmytroklyman/amazon-advertising-api-php-sdk)[![Build Status](https://camo.githubusercontent.com/bb5e913d557d3ec0774c12f9b074dfe5bc300d7c51ee2243f1f748b9891a43ca/68747470733a2f2f6170692e7472617669732d63692e6f72672f646d7974726f6b6c796d616e2f616d617a6f6e2d6164766572746973696e672d6170692d7068702d73646b2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/dmytroklyman/amazon-advertising-api-php-sdk)

Synopsis
--------

[](#synopsis)

Fork of official Amazon Advertising API PHP client library, that solves the problems of the official lib.

In some cases Amazon Advertising API requires the usage of BigInt data type (ex. keyword ID, ad group ID etc.). As you know, PHP doesn't have BigInt data type. If you send such IDs as a string in request, you get an exception in response.

This fork solves this problem and supports the JSON encoded parameters string in Client methods.

To convert the strings into "BigInt" and generate the request parameters string, use the following regex:

`preg_replace('/("\w+"):"(\d+)"/', '\\1:\\2', json_encode($params));`

To convert the BigInt into string in response string, use the JSON\_BIGINT\_AS\_STRING parameter in json\_decode:

`json_decode($response['response'], true, 512, JSON_BIGINT_AS_STRING);`

Requirements
------------

[](#requirements)

PHP &gt;= 5.4.0
cURL &gt;= 7.18

Documentation
-------------

[](#documentation)

[API Reference](https://advertising.amazon.com/API/docs)
[Access Request](https://advertising.amazon.com/API)
[Getting Started](https://advertising.amazon.com/API/docs/v2/guides/get_started)

Tutorials
---------

[](#tutorials)

[Register Sandbox Profile](https://git.io/vPKMl) - This tutorial will show you how to register a profile in sandbox using CURL.
[Generate and download a report using CURL](https://git.io/vPKPW) - You will need to complete registering a profile in sandbox prior to doing this tutorial.

Sandbox self-service
--------------------

[](#sandbox-self-service)

If you would like to test the API in sandbox you will need to register a profile for the region in which you would like to test. The `registerProfile` API call can be made to do this. Make sure you instantiate the client in `sandbox` mode before making this call or it will fail.

The following country codes are available for testing.

> US, CA, UK, DE, FR, ES, IT, IN, CN, JP

```
$client->registerProfile(array("countryCode" => "IT"));
```

>

```
{
  "registerProfileId": "5cf1aca5-4ab8-4489-8c33-013d1f85c586JP",
  "status": "IN_PROGRESS",
  "statusDetails": "Registration workflow has been started"
}

```

Quick Start
-----------

[](#quick-start)

#### Instantiate the client

[](#instantiate-the-client)

> You can pass in `accessToken` if you do not have a refresh token.

```
