Messages

Link to swagger documentation

A Message is a single entry within a Chat, containing text content and optional attachments.

  1. Upload a Message Attachment
  2. Send a Message
  3. Retrieve list of Messages in a Chat

Upload a Message Attachment

To add Message Attachments (Uploaded Files) to a Message, a multipart/form-data POST request to /openapi/v1/orders/{orderId}/upload-file needs to be made for each Uploaded File/Attachment before creating a Message.

Request:

POST https://service-message-center.pp-de.metro-marketplace.cloud/openapi/v1/orders/9e159b23-5585-4482-b078-9a9e1db2b252/upload-file

Response:

A 201 Created response will be received containing the details of the Uploaded File.

{
  "status": "success",
  "message": "File uploaded successfully.",
  "data": {
    "fileId": "files/229dc41e-d3d5-4243-8789-53898cc69022/e13514f4-18fa-479e-88d7-e79eb3e02ef2/9aaba500-54dd-4ef5-b14d-f3190d157ee2",
    "fileName": "Test Document.pdf",
    "fileType": "application/pdf"
  },
  "metadata": []
}

Send a Message

To add a Message to an existing Chat, a POST request to /openapi/v1/chats/{chatId}/messages can be made.

Request:

POST https://service-message-center.pp-de.metro-marketplace.cloud/openapi/v1/chats/9e3e66e9-4025-4306-9278-c71ccee64fe5/messages

request Body with an Attachment:
{
  "content": "Test OpenAPI 123",
  "attachments": [
    {
      "fileId": "files/229dc41e-d3d5-4243-8789-53898cc69022/e13514f4-18fa-479e-88d7-e79eb3e02ef2/9aaba500-54dd-4ef5-b14d-f3190d157ee2",
      "fileType": "application/pdf",
      "fileName": "Test Document"
    }
  ]
}

Response:

A 201 Created response will be received containing the details of the newly created Message.

{
  "status": "success",
  "message": "Message [9fd66bbe-cc4f-489e-810f-c136e3592326] has been created",
  "data": {
    "id": "9fd66bbe-cc4f-489e-810f-c136e3592326",
    "chatId": "9eea824c-b69c-42c2-a9df-2cd545d57b50",
    "senderId": "1ebeca48-baa3-40a2-8421-a2b12162008d",
    "senderUserType": "SELLER",
    "receiverId": "78dc45b5-d0ae-4155-b26a-2a238bfc2a35",
    "content": "Test OpenAPI 123",
    "seenAt": null,
    "createdAt": "2025-09-09T15:46:34+00:00",
    "attachments": [
      {
        "fileId": "files/229dc41e-d3d5-4243-8789-53898cc69022/e13514f4-18fa-479e-88d7-e79eb3e02ef2/9aaba500-54dd-4ef5-b14d-f3190d157ee2",
        "fileType": "application/pdf",
        "fileName": "Test Document",
        "downloadUrl": "https://storage.googleapis.com/service-message-center-bucket-pp-de/files/229dc41e-d3d5-4243-8789-53898cc69022/..."
      }
    ]
  },
  "metadata": []
}

Retrieve list of Messages in a Chat

To retrieve all Chat’s Messages (conversation history), a GET request can be made to /openapi/v1/chats/{chatId}/messages.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/chats/9e3e66e9-4025-4306-9278-c71ccee64fe5/messages

Response:

{
  "status": "success",
  "message": "Messages for chatId [9eea824c-b69c-42c2-a9df-2cd545d57b50] fetched successfully",
  "data": [
    {
      "id": "9fc8202f-b40d-46cb-bd5c-dcb341ac3551",
      "chatId": "9eea824c-b69c-42c2-a9df-2cd545d57b50",
      "senderId": "78dc45b5-d0ae-4155-b26a-2a238bfc2a35",
      "senderUserType": "BUYER",
      "receiverId": "136eb8b3-c0aa-44e6-86cb-a050587ac0a9",
      "content": "Test message from buyer",
      "seenAt": "2025-09-09T14:52:00+00:00",
      "createdAt": "2025-09-02T13:13:42+00:00",
      "attachments": [
        {
          "fileId": "files/229dc41e-d3d5-4243-8789-53898cc69022/e13514f4-18fa-479e-88d7-e79eb3e02ef2/9aaba500-54dd-4ef5-b14d-f3190d157ee2",
          "fileType": "application/pdf",
          "fileName": "Test Document",
          "downloadUrl": "https://storage.googleapis.com/service-message-center-bucket-pp-de/files/229dc41e-d3d5-4243-8789-53898cc69022/..."
        }
      ]
    }
  ],
  "metadata": []
}