📃Responses format

Learn about the respones format of the Mailzeet API.

When interacting with the Mailzeet APIs, it is essential to understand the format of the responses you will receive. This will help you properly interpret the responses and handle them appropriately in your application.

Response Structure

Responses from the Mailzeet API are returned in JSON format and follow a consistent structure. Here's an example of a typical response:

  • In case of a successful request:

{
    "success": true,
    "message": "Email has been queued successfully and will be sent shortly.",
    "data": {
        "sendingId": "afaf2u8k1c8i"
    }
}
  • In case of an unsuccessful request:

{
    "message": "Template not found.",
    "data": null,
    "errors": []
}

Each part of this response carries specific information:

  • message This is a string field that provides a human-readable message about the result of the operation. If the API call is successful, this message usually confirms what has been achieved. If the API call fails, this message usually provides information about what went wrong.

  • data This object contains any data returned by the operation.

  • errors When interacting with the Mailzeet APIs, you may encounter an errors field in the response body, especially in cases where the operation fails to execute as expected. This field is an array of error objects, each providing detailed context about specific issues encountered during the operation. These objects contain information such as the type of error, a detailed error message, and sometimes, a hint or steps to resolve the issue.

Understanding this response format is crucial to making the most of the Mailzeet APIs, as it will allow you to handle both successful operations and errors in a robust and user-friendly way.

Last updated