← Back to Blog

API: Consistent Errors and 404s for Missing Resources

The PresenceWave API now answers every error in the same way, and says "not found" when a resource doesn't exist.

Change to note: a URL shortener, mailing list or blog that doesn't exist, or isn't in your workspace, now returns 404 Not Found instead of 400 Bad Request. The error codes are unchanged. If your integration checks for 400 in these cases, update it to check for 404.

Also in this release:

  • One error format. Every error, including malformed JSON, a wrong parameter type, a missing parameter, an unknown address or a wrong HTTP method, returns the documented body {"success": false, "error": {"code": "...", "message": "..."}}.
  • Paging. size is kept between 1 and 100 and page at 0 or more, so an out-of-range value no longer causes an error.
  • Documentation. The API reference has new sections on errors, paging and timestamps, and lists the 404 responses.