Interface ConversationsService
-
Method Summary
Modifier and TypeMethodDescriptioncreate(CreateConversationRequest createConversationRequest) Create a conversationvoidDelete a conversationGet a conversationinjectEvent(String conversationId, InjectEventRequest injectEventRequest) Inject an eventvoidinjectMessage(String conversationId, InjectMessageRequestBase injectMessageRequestBase) Inject a messagelist()List conversations (using default parameters)list(ConversationsListQueryParameters queryParameter) List conversationslistRecent(RecentConversationsListQueryParameters queryParameter) List recent conversationsvoidstopActive(String conversationId) Stop conversationupdate(String conversationId, Conversation conversation) Update a conversation (using default parameters)update(String conversationId, ConversationsUpdateQueryParameters queryParameter, Conversation conversation) Update a conversation
-
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 conversationsThis 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
Create a conversationCreates 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
Delete a conversationDeletes 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
Get a conversationRetrieves 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 eventThis 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 messageThis 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
RecentConversationsListResponse listRecent(RecentConversationsListQueryParameters queryParameter) throws ApiException List recent conversationsThis 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
Stop conversationThis 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
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 conversationThis 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
-