import { ApiListPromise } from '@sinch/sdk-client'; import { ConversationMessage, DeleteMessageRequestData, GetMessageRequestData, ListLastMessagesByChannelIdentityRequestData, ListMessagesRequestData, Recipient, SendCardMessageRequestData, SendCarouselMessageRequestData, SendChoiceMessageRequestData, SendContactInfoMessageRequestData, SendListMessageRequestData, SendLocationMessageRequestData, SendMediaMessageRequestData, SendMessageRequest, SendMessageRequestData, SendMessageResponse, SendTemplateMessageRequestData, SendTextMessageRequestData, UpdateMessageRequestData } from '../../../models'; import { ConversationDomainApi } from '../conversation-domain-api'; import { LazyConversationApiClient } from '../conversation-service'; export declare class MessagesApi extends ConversationDomainApi { constructor(lazyApiClient: LazyConversationApiClient); /** * Delete a message * 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. * @param { DeleteMessageRequestData } data - The data to provide to the API call. */ delete(data: DeleteMessageRequestData): Promise; /** * Get a message * Retrieves a specific message by its ID. * @param { GetMessageRequestData } data - The data to provide to the API call. */ get(data: GetMessageRequestData): Promise; /** * List messages * This operation lists all messages sent or received via particular [Processing Modes](https://developers.sinch.com/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. 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. * @param { ListMessagesRequestData } data - The data to provide to the API call. * @return {ApiListPromise} */ list(data?: ListMessagesRequestData): ApiListPromise; /** * List messages by channel identity * 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. * @param { ListLastMessagesByChannelIdentityRequestData } data - The data to provide to the API call. */ listLastMessagesByChannelIdentity(data: ListLastMessagesByChannelIdentityRequestData): ApiListPromise; /** * Send a message * You 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/convapi/overview). * @param { SendCardMessageRequestData } data - The data to provide to the API call. */ send(data: SendMessageRequestData): Promise; /** * Send a card message * You 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/convapi/overview). * @param { SendCardMessageRequestData } data - The data to provide to the API call. */ sendCardMessage(data: SendCardMessageRequestData): Promise; /** * Send a carousel message * You 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/convapi/overview). * @param { SendCarouselMessageRequestData } data - The data to provide to the API call. */ sendCarouselMessage(data: SendCarouselMessageRequestData): Promise; /** * Send a choice message * You 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/convapi/overview). * @param { SendChoiceMessageRequestData } data - The data to provide to the API call. */ sendChoiceMessage(data: SendChoiceMessageRequestData): Promise; /** * Send a contact info message * You 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/convapi/overview). * @param { SendContactInfoMessageRequestData } data - The data to provide to the API call. */ sendContactInfoMessage(data: SendContactInfoMessageRequestData): Promise; /** * Send a list message * You 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/convapi/overview). * @param { SendListMessageRequestData } data - The data to provide to the API call. */ sendListMessage(data: SendListMessageRequestData): Promise; /** * Send a location message * You 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/convapi/overview). * @param { SendLocationMessageRequestData } data - The data to provide to the API call. */ sendLocationMessage(data: SendLocationMessageRequestData): Promise; /** * Send a media message * You 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/convapi/overview). * @param { SendCardMessageRequestData } data - The data to provide to the API call. */ sendMediaMessage(data: SendMediaMessageRequestData): Promise; /** * Send a template message * You 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/convapi/overview). * @param { SendCardMessageRequestData } data - The data to provide to the API call. */ sendTemplateMessage(data: SendTemplateMessageRequestData): Promise; /** * Send a text message * You 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/convapi/overview). * @param { SendTextMessageRequestData } data - The data to provide to the API call. */ sendTextMessage(data: SendTextMessageRequestData): Promise; private sendMessage; performSendMessageRequestBodyTransformation(body: SendMessageRequest): SendMessageRequest; /** * Update message metadata * Update a specific message metadata by its ID. * @param { UpdateMessageRequestData } data - The data to provide to the API call. */ update(data: UpdateMessageRequestData): Promise; }