Whautomate REST API Error Messages

This document outlines the errors returned by REST APIs, including standardized error responses, appropriate HTTP status codes, and detailed error messages.

Handling Errors

Status codeErrorReason

400 Bad Request

{"message": "Invalid request body"}

  • Malformed JSON: The request body might not be formatted correctly (e.g., missing commas, brackets, or quotations) or does not adhere to valid JSON structure.

  • Missing required fields: One or more required fields may be missing from the request body.

  • Incorrect data types: Fields in the request body may have the wrong data type (e.g., sending a string when a number is expected).

  • Invalid field values: Some fields may contain values outside the acceptable range or invalid options.

400 Bad Request

{"error": 'Invalid parameters'}

A 400 Bad Request error indicates that your API request contains invalid parameters. This can occur for various reasons, such as:

• Missing required parameters.

• Incorrect data types for parameters.

• Invalid values for specific fields.

403 Forbidden

{"message": "Forbidden"}

403 Forbidden Error occurs when your API request is not authorized. This can happen if the required x-api-key header is missing from your request. The x-api-key is crucial for authenticating your request and granting access.

Verify that the x-api-key header is included in your API request. (or) Verify the x-api-key provided is correct. (or) Verify that you have necessary permissions to perform the requested functionality.

404 Not Found

{"error": "Invalid locationId"}

Invalid or missing locationId: The locationId provided in the request is either missing, incorrect, or does not exist in the system. The API expects a valid locationId to complete the requested operation.

Here are two easy ways to get your Location ID:

  1. Using API: You can get a list of locations by calling the API. Check the Locations API documentation for more details.

  2. From the Whautomate App:

• Go to Settings.

• Click Edit location details under the General section.

• Look at the end of the URL for your Location ID, like this: 1abcd2Ef34.

404 Not Found

{"error": "<Record> not found"} (Eg. Client, Contact, etc)

Invalid or missing record identifier: The system could not locate the specified client because the ID you provided is incorrect, missing, or does not exist in the database.

429 Too Many Requests

{"message": "Too Many Requests"}

A 429 Too Many Requests error occurs when you exceed the allowed number of API requests within a given time frame. The rate limits depend on your account type:

Trial Account: Maximum of 60 requests per minute Subscribed Account: Maximum of 300 requests per minute How to Resolve: Reduce the frequency of your API requests to stay within the rate limit. Consider upgrading your account if you need a higher request rate.

500 Internal Server Error

{"error": "Could not create <record> "} {"error": "Could not retrieve <record> "} {"error": "Could not update <record> "} {"error": "Could not delete <record> "}

A 500 Internal Server Error in an API call means the server encountered an unexpected issue while processing your request. This could be related to server load, request limits, or other internal factors.

Please reach out to our support team for assistance in resolving the issue.

Contact Support: support@whautomate.com


Last updated