Interface MessagesService
-
Method Summary
Modifier and TypeMethodDescriptionvoidDelete a message (using default parameters)voiddelete(String messageId, MessagesDeleteQueryParameters queryParameter) Delete a messageGet a message (using default parameters)get(String messageId, MessagesGetQueryParameters queryParameter) Get a messagelist()List messages (using default parameters)list(MessagesListQueryParameters queryParameter) List messagesList messages by channel identity (using default parameters)List messages by channel identitysendCardMessage(SendMessageRequest<CardMessage> request) Send a card messageSend a carousel messagesendChoiceMessage(SendMessageRequest<ChoiceMessage> request) Send a choice messageSend a contact info messagesendListMessage(SendMessageRequest<ListMessage> request) Send a list messageSend a location messagesendMediaMessage(SendMessageRequest<MediaMessage> request) Send a media messagesendMessage(SendMessageRequest<? extends AppMessageBody> sendMessageRequest) Send a messageSend a template messagesendTextMessage(SendMessageRequest<TextMessage> request) Send a send message request messageupdate(String messageId, MessagesUpdateQueryParameters queryParameter, MessageUpdateRequest messageUpdateRequest) Update message metadataupdate(String messageId, MessageUpdateRequest messageUpdateRequest) Update message metadata (using default parameters)
-
Method Details
-
list
List messages (using default parameters)This operation lists all messages sent or received via particular [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/). Setting the `messages_source` parameter to `CONVERSATION_SOURCE` allows for querying messages in `CONVERSATION` mode, and setting it to `DISPATCH_SOURCE` will allow for queries of messages in `DISPATCH` mode. Note that `conversation_id` and `contact_id` are only supported as query parameters if `messages_source` is set to `CONVERSATION_SOURCE`. Combining multiple parameters is supported for more detailed filtering of messages, but some of them are not supported depending on the value specified for `messages_source`. The description for each field will inform if that field may not be supported. The messages are ordered by their `accept_time` property in descending order, where `accept_time` is a timestamp of when the message was enqueued by the Conversation API. This means messages received most recently will be listed first.
- Returns:
- MessagesListResponse
- Throws:
ApiException- if fails to make API call
-
list
List messagesThis operation lists all messages sent or received via particular [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/). Setting the `messages_source` parameter to `CONVERSATION_SOURCE` allows for querying messages in `CONVERSATION` mode, and setting it to `DISPATCH_SOURCE` will allow for queries of messages in `DISPATCH` mode. Note that `conversation_id` and `contact_id` are only supported as query parameters if `messages_source` is set to `CONVERSATION_SOURCE`. Combining multiple parameters is supported for more detailed filtering of messages, but some of them are not supported depending on the value specified for `messages_source`. The description for each field will inform if that field may not be supported. The messages are ordered by their `accept_time` property in descending order, where `accept_time` is a timestamp of when the message was enqueued by the Conversation API. This means messages received most recently will be listed first.
- Parameters:
queryParameter- (optional)- Returns:
- MessagesListResponse
- Throws:
ApiException- if fails to make API call
-
delete
Delete a message (using default parameters)Delete a specific message by its ID. Note that this operation deletes the message from Conversation API storage; this operation does not affect messages already delivered to recipients' handsets. Also note that removing all messages of a conversation will not automatically delete the conversation.
- Parameters:
messageId- The unique ID of the message. (required)- Throws:
ApiException- if fails to make API call
-
delete
Delete a messageDelete a specific message by its ID. Note that this operation deletes the message from Conversation API storage; this operation does not affect messages already delivered to recipients' handsets. Also note that removing all messages of a conversation will not automatically delete the conversation.
- Parameters:
messageId- The unique ID of the message. (required)queryParameter- (optional)- Throws:
ApiException- if fails to make API call
-
get
Get a message (using default parameters)Retrieves a specific message by its ID.
- Parameters:
messageId- The unique ID of the message. (required)- Returns:
- ConversationMessage
- Throws:
ApiException- if fails to make API call
-
get
ConversationMessage get(String messageId, MessagesGetQueryParameters queryParameter) throws ApiException Get a messageRetrieves a specific message by its ID.
- Parameters:
messageId- The unique ID of the message. (required)queryParameter- (optional)- Returns:
- ConversationMessage
- Throws:
ApiException- if fails to make API call
-
listLastMessagesByChannelIdentity
List messages by channel identity (using default parameters)Retrieves the last message sent to specified channel identities. In CONVERSATION_SOURCE mode, you can query either by channel_identities or by contact_ids. Note: Use either contact_ids OR channel_identities per request, not both. DISPATCH_SOURCE mode does not support contact_ids.
- Returns:
- MessagesListResponse
- Throws:
ApiException- if fails to make API call
-
listLastMessagesByChannelIdentity
MessagesListResponse listLastMessagesByChannelIdentity(LastMessagesByChannelIdentityListQueryParameters queryParameter) throws ApiException List messages by channel identityRetrieves the last message sent to specified channel identities. In CONVERSATION_SOURCE mode, you can query either by channel_identities or by contact_ids. Note: Use either contact_ids OR channel_identities per request, not both. DISPATCH_SOURCE mode does not support contact_ids.
- Parameters:
queryParameter- Request body for listing messages by channel identity. NOTE: You can use either contact_ids OR channel_identities, but not both in the same request. (required)- Returns:
- MessagesListResponse
- Throws:
ApiException- if fails to make API call
-
sendMessage
SendMessageResponse sendMessage(SendMessageRequest<? extends AppMessageBody> sendMessageRequest) throws ApiException Send a messageYou can send a message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically. You can find all of your IDs and authentication credentials on the [Sinch Customer Dashboard](https://dashboard.sinch.com/settings/access-keys).
- Parameters:
sendMessageRequest- This is the request body for sending a message. `app_id`, `recipient`, and `message` are all required fields. (required)- Returns:
- SendMessageResponse
- Throws:
ApiException- if fails to make API call
-
sendCardMessage
Send a card message- Parameters:
request- CardMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendCarouselMessage
Send a carousel message- Parameters:
request- CarouselMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendChoiceMessage
Send a choice message- Parameters:
request- ChoiceMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendContactInfoMessage
Send a contact info message- Parameters:
request- ContactInfoMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendListMessage
Send a list message- Parameters:
request- ListMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendLocationMessage
Send a location message- Parameters:
request- LocationMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendMediaMessage
Send a media message- Parameters:
request- MediaMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendTemplateMessage
Send a template message- Parameters:
request- TemplateMessage request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
sendTextMessage
Send a send message request message- Parameters:
request- request- Returns:
- Response related to sent message
- Since:
- 1.3
- See Also:
-
update
ConversationMessage update(String messageId, MessageUpdateRequest messageUpdateRequest) throws ApiException Update message metadata (using default parameters)Update a specific message metadata by its ID.
- Parameters:
messageId- The unique ID of the message. (required)messageUpdateRequest- Update message metadata request. (required)- Returns:
- ConversationMessage
- Throws:
ApiException- if fails to make API call
-
update
ConversationMessage update(String messageId, MessagesUpdateQueryParameters queryParameter, MessageUpdateRequest messageUpdateRequest) throws ApiException Update message metadataUpdate a specific message metadata by its ID.
- Parameters:
messageId- The unique ID of the message. (required)queryParameter- (optional)messageUpdateRequest- Update message metadata request. (required)- Returns:
- ConversationMessage
- Throws:
ApiException- if fails to make API call
-