API Reference

Link to swagger documentation

This page covers general information about the Message Center API, including error handling, standards and business logic.


Error Handling

The API uses standard HTTP status codes to indicate whether a request was successful or failed.

Example 422 Validation Error:

{
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "message": [
      "The message field is required."
    ]
  }
}

Standards

  • Request and response format: All API requests and responses are expected to use the JSON format, except in cases where multipart/form-data is explicitly required (e.g., for file uploads).
  • URL encoding: All URLs must be properly encoded to ensure safe and accurate transmission of parameters.
  • Date and time format: All date and time values follow the RFC 3339 standard, e.g., 2019-10-12T07:20:50.52+00:00.

Appendix

Automatic ‘Mark as Seen’ Behavior

When a Seller interacts with Chat’s Messages, any unread messages from the BUYER within that Chat are automatically marked as read/seen.
This behavior includes the following actions:

In both cases, the seenAt field for all messages where senderUserType is BUYER and seenAt is null will be updated to the current timestamp.
Additionally, the Chat’s isSeen field will be set to true.