Get Messages: /message/ (GET)

Purpose:

Get messages by page and per page.

Input:

  • Headers:
    • Authorization: The JWT token of the user.
  • Query Parameters:
    • page: (Integer) Default 1
    • per_page: (Integer) Default 30
    • recipient_type: (String) The type of the recipient. Set to “CHANNEL” if sending to a channel, or “USER” if sending to a user.
    • reference_id: (Uuid) This should be the user or channel id based on the recipient type.

Output (200):

[
  {
    "id": "82a85be9-01ba-4ca5-bf22-ba9c755f237f",
    "message_type": "MESSAGE",
    "recipient_type": "CHANNEL",
    "reference_id": "a98a657f-df84-4fee-8aad-a9bdcdd0aeda",
    "content": "Hello, world!",
    "date_created": "2024-08-12T12:34:56",
    "date_updated": "2024-08-12T12:34:56",
    "user_id": "33505151-e25f-4adc-a6aa-964190112af8",
    "deleted": false
  },
  {
    "id": "2325bde0-1038-4c0d-9cf3-9af013de808a",
    "message_type": "MESSAGE",
    "recipient_type": "CHANNEL",
    "reference_id": "1568536b-0e5a-4605-bf56-18fccd73f862",
    "content": "Hello, planet!",
    "date_created": "2024-08-12T12:35:56",
    "date_updated": "2024-08-12T12:35:56",
    "user_id": "475bbeb3-a307-4642-85d5-b14891b6044c",
    "deleted": false
  }
]