Zac G.
Product Manager - Integrations
Published: Mon, 09/13/21
Combine actions to reduce complexity and excessive calls
More software code can often lead to increased brittleness. Accessing an API increases your complexity as you account for rate limiting, error flows, and other factors. Update your call to the Add Subscriber endpoint with “update_exsting=true” to
combine the actions of adding and updating a subscriber into a single API call. This reduces your impact on rate limiting and eliminates the step of validating if the subscriber currently exists.
Are you accounting for errors from API calls?
Having access to numerous APIs is truly awesome, but it also requires increased vigilance. This is where defensive programming can help. For instance, do you know what error messages you are encountering from our Add Subscriber endpoint? A few examples are: the subscriber already exists; the subscriber is globally blocked; the API call has exceeded the rate limit; and an account is on hold. Knowing your errors allows you to implement intelligent retrying where applicable.
Best ways to handle expired access tokens
For enhanced security, AWeber’s access tokens expire two hours after they are issued. You can refresh a token proactively before it expires or wait until it expires to refresh. There are three ways we encourage everyone to refresh:
Learn about these scenarios in more detail:
Did you miss a previous newsletter? Check out our archive.
Happy coding and have a great day!
Zac G.
Product Manager - Integrations
|