Class ConversationAPI


  • public class ConversationAPI
    extends BaseAPI
    • Constructor Detail

      • ConversationAPI

        public ConversationAPI​(ResourceFactory resourceFactory)
    • Method Detail

      • createConversation

        public int createConversation​(String subject,
                                      String text,
                                      List<Integer> participants)
        Creates a new conversation with a list of users. Once a conversation is started, the participants cannot (yet) be changed.
        Parameters:
        subject - The subject of the conversation
        text - The text of the first message in the conversation
        participants - List of participants in the conversation (not including the sender)
        Returns:
        The id of the newly created conversation
      • createConversation

        public int createConversation​(String subject,
                                      String text,
                                      List<Integer> participants,
                                      Reference reference)
        Creates a new conversation with a list of users. Once a conversation is started, the participants cannot (yet) be changed.
        Parameters:
        subject - The subject of the conversation
        text - The text of the first message in the conversation
        participants - List of participants in the conversation (not including the sender)
        reference - The object the conversation should be created on, if any
        Returns:
        The id of the newly created conversation
      • getConversation

        public Conversation getConversation​(int conversationId)
        Gets the conversation including participants and messages with the the given id. Only participants in the conversation is allowed to view the conversation.
        Parameters:
        conversationId - The id of the conversation to get
        Returns:
        The conversation requested
      • getConversationsOnObject

        public List<Conversation> getConversationsOnObject​(Reference object)
        Returns a list of all the conversations on the object that the active user is part of.
        Parameters:
        object - The object to get conversations on
        Returns:
        The list of conversations
      • addReply

        public int addReply​(int conversationId,
                            String text)
        Creates a reply to the conversation.
        Parameters:
        conversationId - The id of the conversation to reply to
        text - The text of the reply
        Returns:
        The id of the new message