API Errors

If an API call results in an error, the API response will return details about the error using JSON. Most errors encountered with the API can be easily handled and corrected in your application. To provide a better user experience, you should design your API applications to expect errors and handle them appropriately.

When an error is returned:

  • The appropriate HTTP status will be set in the response headers.
  • Content-Type will be set to application/json.
  • The body will consist of a JSON formatted dictionary with a single key called "error" containing the status, error type, message, and documentation URL.

Here is a sample API error response:

{"error": {"status": 401, "message": "Consumer key is invalid.", "type": "UnauthorizedError", "documentation_url": "https://labs.aweber.com/docs/troubleshooting"}}

400 BadRequestError

What is it?

This error is raised when you make a properly authenticated request to a valid resource with incorrect parameters. If you receive 400 BAD REQUEST errors, refer to the actual error message as well as the appropriate documentation for the method you are calling.

Examples

  • Attempting to modify a read-only field.
  • Invoking the find() method on a subscriber entry without supplying an email address
  • Invoking the move() method on a subscriber entry without supplying a list
  • Creating or modifying resources using invalid character encodings.

Troubleshooting Checklist

  • Refer to the error message for a summary of what is wrong.
  • Refer to the API reference documentation for the method you're calling to find out what it requires.

401 UnauthorizedError

This class of errors represents authentication errors. In order to troubleshoot authentication errors, a basic understanding of the OAuth 1.0A Authentication Protocol is required. Please refer to the following documentation for more information on how we handle authentication with the AWeber API as well as specific examples of how to handle each kind of authentication error.

AccessToken key is invalid.

What is it?

This error is raised when your access token key is invalid. The most common causes for this error is that the AWeber Customer disconnected your application from their account or you have a typographical error in the access token key.

Troubleshooting Checklist

  • Obtain a new access token key.

Account Unauthorized.

What is it?

This error is raised when the AWeber Customer account is no longer active. The most common causes for this error are that the AWeber Customer cancelled their account or you are using an invalid account id.

Troubleshooting Checklist

  • Contact support to reactivate the AWeber Customer account.

Consumer key is invalid.

What is it?

This error is raised when your consumer key is invalid. The most common cause for this error is a typographical error in consumer key copied from your labs account.

Troubleshooting Checklist

  • Copy and paste your consumer key from your labs account into your application and try again.
  • If using the distributed authentication method, make sure you are properly parsing out the Consumer Key from the returned authorization code.

Expired timestamp: ...

What is it?

This error is raised when your clock is not accurately synchronized to your local time. Timestamps play a key role in the OAuth 1.0A Authentication protocol and we require that the system clock of any computer or server initiating API requests to be reasonably synchronized (+/- 5 minutes) to UTC time.

Troubleshooting Checklist

  • Check your system clock and make sure it's synchronized within 5 minutes +/- of UTC Refer here for a more detailed explanation of UTC.
  • If you don't have the ability to set your system clock and your server is hosted by a 3rd party hosting company, please contact them for support.
  • If you are implementing your own client libraries, use the standard Unix time-stamp as the time-stamp in all requests. Refer to the programming language documentation of the language you're using to develop your app for more information.

Invalid signature. ...

What is it?

This error is raised when the signature of your request doesn't match what we'd expect it to be. Common causes of this error are incorrect or missing token secret keys (either consumer, request token, or access token) or an incorrect OAuth 1.0A implementation in your applications.

Troubleshooting Checklist

  • Verify that your consumer secret is correct by logging onto your labs account and copy and pasting the consumer key into your application.
  • Issue new request tokens and/or access tokens and try again.
  • Verify that your application is properly implementing the OAuth 1.0A standard with respect to the server base string.
  • Refer to RFC5849 OAuth 1.0A Specification Section 3.4.1 for more details.

Request does not have OAuth credentials.

What is it?

This error is raised when your application attempts to communicate to the AWeber API without using the OAuth 1.0A protocol. You must fully implement the OAuth 1.0A protocol to access the AWeber API.

Troubleshooting Checklist

  • If you are new to OAuth 1.0A, refer to our client libraries. We have several versions of our client library that are fully tested to comply with the OAuth 1.0A protocol and these will help you 'hit the ground running'.
  • If you are not using our client libraries, make sure you are sending all required OAuth credentials in the request.

    Refer to RFC5849 OAuth 1.0A Specification Section 3.1 for more details.

403 ForbiddenError

This class of errors is used when the API understands your request but has refused to grant access to the requested resource.

Account Temporarily Suspended.

What is it?

This error is raised when the AWeber Customer account is temporarily suspended. The most common causes for this error are that the AWeber Customer has a billing issue or you are using an invalid account id.

Troubleshooting Checklist

  • Contact support to reactivate the AWeber Customer account.

Application not authorized to send Broadcasts.

What is it?

This error is raised when you make a request to schedule a Broadcast, but your application has not been authorized by the AWeber Customer to send Broadcasts.

Troubleshooting Checklist

  • Ensure that your application has specified that it requires the Send Broadcast Email permission.
  • Ensure that the AWeber Customer has authorized your application after it was modified to require the Send Broadcast Email permission. The AWeber Customer may need to disable and re-enable your application to grant this authorization.

Method requires access to Subscriber information.

What is it?

This error is raised when you make a request to a resource that requires access to subscriber information, but your application has not specifically requested access to subscriber information from the AWeber Customer.

Troubleshooting Checklist

  • Check the labs documentation for resource that you're calling.
  • Log into your labs account and select 'access to subscribers information' for your application.
  • Issue new access tokens to your application.

Rate Limit Error.

What is it?

This error is raised when the number of API requests made by your application exceeds the rate limits as specified in the API Terms of Service.

Troubleshooting Checklist

  • Reduce the frequency that you make API requests.
  • Utilize a local cache in your application to prevent making unnecessary API requests.

Subscriber Complaints Error.

What is it?

This error is raised when the number of complaints reported by subscribers is too high.

Complaints generally occur when subscribers receive email they did not sign up for or do not want.
Continued complaints reported by subscribers can lead to the suspension of the AWeber account.

Troubleshooting Checklist

Before you will be able to continue adding subscribers, you will need to:

  • Review and implement these best practices to lower subscriber complaints.
  • Wait for those complaints to lessen.

404 NotFoundError

What is it?

This error is raised when the requested resource does not exist.

Troubleshooting Checklist

405 MethodNotAllowedError

What is it?

This error is raised when a properly authenticated request is made to a valid resource, but the HTTP method you used is not allowed.

Examples

  • Attempting to modify a read-only resource using the PUT or PATCH method.
  • Invoking the move() method on a subscriber entry that has a status of 'unconfirmed'.

Troubleshooting Checklist

  • Check the URL of the resource you are requesting.
  • Make sure the resource supports the HTTP method you are using.
  • Check the response from the error message for further details.
  • Refer to the API Reference Documentation for more information.

409 Conflict

What is it?

This error is raised when the request could not be completed due to a conflict with the current state of the resource.

Examples

  • Attempting to schedule a Broadcast that has already been sent.

415 InvalidContentType

What is it?

This error is raised when the request is in a format that is not supported by the resource for the method.

Examples

  • Making a POST request with a Content-Type other than application/x-www-form-urlencode.

500 InternalServerError

What is it?

This error is raised when the API experiences an internal error.

Troubleshooting Checklist

  • Try your request again.
  • Contact support if the problem persists.

503 ServiceUnavailableError

What is it?

This error is raised when the API is down for maintenance.

Troubleshooting Checklist

  • Try your request again.
  • Contact support if the problem persists.

Client Library Errors

AWeber API PHP Library

The following error is specific to the AWeber API PHP Library.

Fatal error: Uncaught exception 'AWeberOAuthDataMissing' with message 'OAuthDataMissing...

What is it?

The AWeber PHP API is written to throw exceptions when various errors are encountered. In the event of an error in the following line of code, a fatal uncaught exception will be thrown:

$aweber = new AWeberAPI($consumerKey, $consumerSecret);

The AweberOAuthDataMissing exception generally indicates the user has supplied an invalid oauth_consumer_key or oauth_consumer_secret. Additionally, if you would like to write your application to be fault tolerant of connection errors associated with the AWeber API, you can use PHP's exception handling to check for and properly handle any exceptions raised by the API. For details on exception handling in PHP, click here.

AWeber API Python Library

The following error is specific to the AWeber API Python Library.

SSLHandshakeError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed...

What is it?

AWeber will be upgrading its SSL certificates to SHA-2 on January 5, 2015. As a consequence, developers using the AWeber API Python Library will need to upgrade to version 1.2.1 of the library. Versions 1.2.0 and earlier will not work with the new SSL certificates.



Troubleshooting Checklist

  • Use a version of the Python Client Library >= 1.2.1
  • Contact support if the problem persists.

Non-Error Responses

204 NoContent

What is it?

A 204 No Content status is returned when an API resource was successfully updated and there is no content to return.

209 ContentModified

What is it?

A 209 Content Modified status is returned along with a JSON representation when an API resource was successfully updated with an HTTP PATCH request.