Interface ConversationsService


public interface ConversationsService
Conversations Service
  • Method Details

    • list

      List conversations (using default parameters)

      This operation lists all conversations that are associated with an app and/or a contact. Note that either `app_id` or `contact_id` is required in order for the operation to function correctly.

      Returns:
      ConversationsListResponse
      Throws:
      ApiException - if fails to make API call
    • list

      List conversations

      This operation lists all conversations that are associated with an app and/or a contact. Note that either `app_id` or `contact_id` is required in order for the operation to function correctly.

      Parameters:
      queryParameter - (optional)
      Returns:
      ConversationsListResponse
      Throws:
      ApiException - if fails to make API call
    • create

      Conversation create(CreateConversationRequest createConversationRequest) throws ApiException
      Create a conversation

      Creates a new empty conversation. In Conversation mode, it is generally not needed to create a conversation explicitly since sending or receiving a message automatically creates a new conversation if it does not already exist between the given app and contact. Creating empty conversation is useful if the metadata of the conversation should be populated when the first message in the conversation is a contact message or the first message in the conversation comes out-of-band and needs to be injected with InjectMessage endpoint.

      Parameters:
      createConversationRequest - The conversation to create. ID will be generated for the conversation and any ID in the given conversation will be ignored. (required)
      Returns:
      Conversation
      Throws:
      ApiException - if fails to make API call
    • delete

      void delete(String conversationId) throws ApiException
      Delete a conversation

      Deletes a conversation together with all the messages sent as part of the conversation.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      Throws:
      ApiException - if fails to make API call
    • get

      Conversation get(String conversationId) throws ApiException
      Get a conversation

      Retrieves a conversation by id. A conversation has two participating entities, an app and a contact.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      Returns:
      Conversation
      Throws:
      ApiException - if fails to make API call
    • injectEvent

      InjectEventResponse injectEvent(String conversationId, InjectEventRequest injectEventRequest) throws ApiException
      Inject an event

      This operation injects a conversation event in to a specific conversation. It only supports injecting App events in `CONVERSATION` mode.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      injectEventRequest - Inject event request (required)
      Returns:
      InjectEventResponse
      Throws:
      ApiException - if fails to make API call
    • injectMessage

      void injectMessage(String conversationId, InjectMessageRequestBase injectMessageRequestBase) throws ApiException
      Inject a message

      This operation injects a conversation message in to a specific conversation.

      Parameters:
      conversationId - The ID of the conversation. (required)
      injectMessageRequestBase - Message to be injected. (required)
      Throws:
      ApiException - if fails to make API call
    • listRecent

      List recent conversations

      This operation lists conversations and their most recent message, ordered by when the most recent message was sent for that conversation.

      Parameters:
      queryParameter - (optional)
      Returns:
      RecentConversationsListResponse
      Throws:
      ApiException - if fails to make API call
    • stopActive

      void stopActive(String conversationId) throws ApiException
      Stop conversation

      This operation stops the referenced conversation, if the conversation is still active. In Conversation mode, a new conversation will be created if a new message is exchanged between the app or contact that was part of the stopped conversation.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      Throws:
      ApiException - if fails to make API call
    • update

      Conversation update(String conversationId, Conversation conversation) throws ApiException
      Update a conversation (using default parameters)

      This operation updates a conversation which can, for instance, be used to update the metadata associated with a conversation.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      conversation - The updated conversation. (required)
      Returns:
      Conversation
      Throws:
      ApiException - if fails to make API call
    • update

      Conversation update(String conversationId, ConversationsUpdateQueryParameters queryParameter, Conversation conversation) throws ApiException
      Update a conversation

      This operation updates a conversation which can, for instance, be used to update the metadata associated with a conversation.

      Parameters:
      conversationId - The unique ID of the conversation. This is generated by the system. (required)
      queryParameter - (optional)
      conversation - The updated conversation. (required)
      Returns:
      Conversation
      Throws:
      ApiException - if fails to make API call