Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (45 sloc) 1.87 KB
AWeber API PHP Library
PHP library for easily integrating with the AWeber API.
2011-12-23: v1.1.2
* Fixed a bug in the AWeberCollection class to properly set the URL of entries found in collections.
2011-10-10: v1.1.1
* Raise an E_USER_WARNING instead of a fatal error if multiple instances of the client library are installed.
2011-08-29: v1.1.0
* Modified client library to raise an AWeberAPIException on any API errors (HTTP status >= 400)
* Refactored tests for better code coverage
* Refactored move and create methods to return the resource or raise an AWeberAPIException on error.
* Added getActivity method to a subscriber entry.
Basic Usage:
Refer to demo.php to see a working example of how to authenticate an app and query the API.
For more complete documentation please refer to:
Handling Errors:
Sometimes errors happen and your application should handle them appropriately.
Whenever an API error occurs an AWeberAPIException will be raised with a detailed
error message and documentation link to explain what's wrong.
You should wrap any calls to the API in a try/except block.
Common Errors:
* Resource not found (404 error)
* Your application has been rate limited (403 error)
* Bad request (400 error)
* API Temporarily unavailable (503 error)
Refer to for the complete list
Example Below:
$consumerKey = '***';
$consumerSecret = '***';
$accessKey = '***';
$accessSecret = '***';
$aweber = new AWeberAPI($consumerKey, $consumerSecret);
$account = $aweber->getAccount($accessKey, $accessSecret);
try {
$resource = $account->loadFromUrl('/accounts/idontexist');
} catch (AWeberAPIException $exc) {
print "<li> $exc->type on $exc->url, refer to $exc->message for more info ...<br>";
Jump to Line
Something went wrong with that request. Please try again.