Interface IMessagesApi
public interface IMessagesApi
High-level methods for interacting with portal messages.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptiongetChatMessages(IUserPortalInvocationContext ctx, UUID chatUuid) Gets all messages for the current user and chat.getMessages(IUserPortalInvocationContext ctx, PagingDataModel pagingDataModel, MessagesQueryModel queryModel) Gets all messages for the current user.getMessagesCount(IUserPortalInvocationContext ctx, MessagesQueryModel queryModel) Gets the number of messages for the current user.sendMessage(IUserPortalInvocationContext ctx, String message, UUID chatUuid) Sends a message to a chat.uploadAttachment(IUserPortalInvocationContext ctx, UUID messageUuid, UUID uploadRequestUuid, List<File> files) Uploads an attachment to a message.
-
Method Details
-
sendMessage
IUserPortalResponse<DetailedFormRecordMessageResource> sendMessage(IUserPortalInvocationContext ctx, String message, UUID chatUuid) Sends a message to a chat.- Parameters:
ctx- Invocation context for communicating with the user portal REST API.message- The message to send.- Returns:
nullif the message was sent successfully, an error message otherwise.
-
uploadAttachment
IUserPortalResponse<DetailedFormRecordMessageUploadRequestResource> uploadAttachment(IUserPortalInvocationContext ctx, UUID messageUuid, UUID uploadRequestUuid, List<File> files) Uploads an attachment to a message.- Parameters:
ctx- Invocation context for communicating with the user portal REST API.messageUuid- The UUID of the message to upload the attachment to.uploadRequestUuid- The UUID of the upload request.files- The files to upload.- Returns:
- a 'success' response if the attachment was uploaded successfully, an error response describing the failure otherwise.
-
getMessages
IUserPortalResponse<FormRecordMessageResourcePage> getMessages(IUserPortalInvocationContext ctx, PagingDataModel pagingDataModel, MessagesQueryModel queryModel) Gets all messages for the current user.- Parameters:
ctx- Invocation context for communicating with the user portal REST API.pagingDataModel- Paging data for the messages to retrieve.queryModel- Query to filter messages by.- Returns:
- A list of all messages for the current user.
-
getChatMessages
IUserPortalResponse<List<BaseFormRecordMessageResource>> getChatMessages(IUserPortalInvocationContext ctx, UUID chatUuid) Gets all messages for the current user and chat.- Parameters:
ctx- Invocation context for communicating with the user portal REST API.chatUuid- The UUID of the chat to retrieve messages for.- Returns:
- A list of all messages for the current user.
-
getMessagesCount
IUserPortalResponse<Integer> getMessagesCount(IUserPortalInvocationContext ctx, MessagesQueryModel queryModel) Gets the number of messages for the current user.- Parameters:
ctx- Invocation context for communicating with the user portal REST API.queryModel- The query model for the messages to count.- Returns:
- The number of messages for the current user.
-