Skip to content

Commit b0f54b1

Browse files
committed
Adds note about OAuth to readme
1 parent c9805bf commit b0f54b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ if (!empty($response) && isset($response->lists)) {
7474
}
7575
```
7676

77+
### API Key vs OAuth Access Token
78+
79+
If you need to connect to Mailchimp using an OAuth generated access token modify your calls to use the Mailchimp2 class as follows.
80+
81+
```php
82+
<?php
83+
// Replace calls like this:
84+
$api_key = 'YOUR_API_KEY';
85+
$mailchimp = new Mailchimp\Mailchimp($api_key);
86+
87+
// With this:
88+
$access_token = 'YOUR_ACCESS_TOKEN';
89+
$data_center = 'YOUR_DATA_CENTER'; // ex. us-10
90+
$mailchimp_lists = new Mailchimp\Mailchimp2($access_token, $data_center);
91+
92+
```
93+
7794
## Testing
7895

7996
This library includes a [PHPUnit](https://phpunit.de/) test suite.

0 commit comments

Comments
 (0)