5 Tips for Dealing with Unreliable Web APIs

A recent post on the Instavest Blog covered the topic of dealing with unreliable web APIs, such as ones that provide inconsistent error responses or suffer from reliability issues. The author offered these 5 tips to ease the pain for developers dealing with these kinds of APIs.

  1. Retry Loops – Since undocumented error responses should make up only a small percentage of requests, retrying the request twice could take success rate of requests from, for example, 90% up to 99.9%
  2. Thorough Logging – Keeping accurate and detailed records of the success or failure of every API request can speed up debugging and act as a trustworthy audit trail
  3. Set up Automatic Emails – An extension of the logging process, sending error reporting emails with diagnostics reports to tech support teams can help maintain third-party APIs that are non-critical, but may still be important from a UX perspective
  4. Use Error-Reporting Tools – Whether you are using third-party APIs or not, you should integrate some form of middleware that reports on unhandled exceptions, including frequency of instances and the users affected
  5. Track Response Latency and Warn Yourself Internally – Keeping a record of response latency can help you understand the reasons it might be happening. This data can be used to improve your processes, such as timing heavy data pulls to times where third-party APIs are more available.

Be sure to read the next API Management article: How NZ Post Relies On APIs To Fend Off The Threat From Uber, Others

Original Article

Working with unreliable web APIs

 

Comments