Skip to content

Messaging API

For details about the API, we have the sections below or you can also refer to the Swagger JSON available at /user/apihelp/v2/swagger

ContentController API

GetMessage

Endpoint: GET /api/v2/messaging/message/{messageId}

Description: This endpoint retrieves a specific message by its ID.

Request example

/api/v2/messaging/message/3fa85f64-5717-4562-b3fc-2c963f66afa6

Response

json
{
  "messageId": "3835e88c-6d99-4434-b434-619ac0430b83",
  "inReplyToMessageId": null,
  "conversationId": "c04605c9-867c-47b5-a231-8e9b4ce2ea5a",
  "sender": {
    "userId": "fb597912-7ea7-4be4-b96f-8134151192fa",
    "userName": "demoinvestor1",
    "fullName": "Wallis Simpson",
    "clientName": "Demo Investor",
    "sameClient": true,
    "isSelf": false
  },
  "subject": "Hello world",
  "message": "Message content",
  "receivedAt": "2024-06-05T13:50:33.3020765Z",
  "status": 1
}

GetConversation

Endpoint: GET /api/v2/messaging/conversation/{conversationId}

Description: This endpoint retrieves all messages in a specific conversation by its ID. Request example: api/v2.0/messaging/conversation/c04605c9-867c-47b5-a231-8e9b4ce2ea5a

Response example

json
{
  "conversationId": "c04605c9-867c-47b5-a231-8e9b4ce2ea5a",
  "messages": [
    {
      "messageId": "3835e88c-6d99-4434-b434-619ac0430b83",
      "inReplyToMessageId": null,
      "conversationId": "c04605c9-867c-47b5-a231-8e9b4ce2ea5a",
      "sender": {
        "userId": "fb597912-7ea7-4be4-b96f-8134151192fa",
        "userName": "demoinvestor1",
        "fullName": "Wallis Simpson",
        "clientName": "Demo Investor",
        "sameClient": true,
        "isSelf": false
      },
      "subject": "Hello world",
      "message": "Message content",
      "receivedAt": "2024-06-05T13:50:33.3020765Z",
      "status": 2
    }
  ]
}

DirectoryController API

GetDirectoryEntries

Endpoint: GET /api/v2/messaging/directory

Description: This endpoint retrieves a list of directory entries. The results can be filtered and sorted, and pagination is supported.

Request example/api/v2/messaging/directory?filter=John&sort=UserName%20desc&page=1

ParameterDescriptionRequired
filterUsed to filter the list of directory entries.No
sortUsed to sort the list of directory entries.
"{fieldName}%20{desc
asc}”
pageUsed for pagination.No

Response example

json
{
    "currentPage": 1,
    "pageSize": 10,
    "totalResults": 2,
    "items": [
        {
				    "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
				    "userName": "JohnDoe",
				    "fullName": "John Doe",
				    "clientName": "Client1",
				    "sameClient": true,
				    "isSelf": true
				},
        {
			    "userId": "1199770f-a23a-4a6a-a365-e3fa4925621c",
			    "userName": "JaneDoe",
			    "fullName": "Jane Doe",
			    "clientName": "Client1",
			    "sameClient": true,
			    "isSelf": false
			}
    ]
}

InboxController API

Get

Endpoint: GET /api/v2/messaging/inbox/personal

Description: This endpoint retrieves the personal inbox messages.

Request example

/api/v2.0/messaging/inbox/personal?sort=ReceivedAt%20desc&status=3&uniqueConversations=false

ParameterDescriptionRequired
filterUsed to filter the list of directory entries.No
sortUsed to sort the list of directory entries. "{fieldName}%20{descasc}”
pageUsed for pagination.No
statusThe status of the messages to retrieve.No
uniqueConversationsWhether to retrieve unique conversations only.no

Response example

json
{
  "unreadCount": 0,
  "currentPage": 0,
  "pageSize": 100,
  "totalResults": 1,
  "items": [
    {
      "messageId": "3835e88c-6d99-4434-b434-619ac0430b83",
      "conversationId": "c04605c9-867c-47b5-a231-8e9b4ce2ea5a",
      "sender": {
        "userId": "fb597912-7ea7-4be4-b96f-8134151192fa",
        "userName": "demoinvestor1",
        "fullName": "Wallis Simpson",
        "clientName": "Demo Investor",
        "sameClient": true,
        "isSelf": false
      },
      "subject": "Hello world",
      "receivedAt": "2024-06-05T13:50:33.3020765Z",
      "status": 2,
      "messagePreview": "Message content"
    }
  ]
}

UpdateStatus

Endpoint: POST /api/v2/messaging/inbox/status/{messageId:guid}/{status}

Description: This endpoint updates the status of a specific message.

Request example

/api/v2.0/messaging/inbox/status/3835e88c-6d99-4434-b434-619ac0430b83/1

Response 200 OK

GetUnreadCount

Endpoint: GET /api/v2/messaging/inbox/personal/unreadCount

Description: This endpoint retrieves the count of unread messages in the personal inbox.

Response Example: 1

OutboxController API

Post

Endpoint: POST /api/v2/messaging/outbox

Description: This endpoint sends a message.

Request Example

json
{
  "message": "Message content",
  "sendToUserId": "fb597912-7ea7-4be4-b96f-8134151192fa",
  "subject": "Subject"
}

Response

200 OK

Common

typescript
// Status of the message
enum MessageStatus {
    None = 0,
    Unread = 1,
    Read = 2,
    ReadOrUnread = 3,
    Archived = 4
}