-
Notifications
You must be signed in to change notification settings - Fork 182
Vonage Messages
Documentation / Vonage Messages
Defined in: messages/lib/enums/Channels.ts:1
Enumeration Member | Value | Defined in |
---|---|---|
MESSENGER
|
"messenger" |
messages/lib/enums/Channels.ts:2 |
MMS
|
"mms" |
messages/lib/enums/Channels.ts:3 |
RCS
|
"rcs" |
messages/lib/enums/Channels.ts:7 |
SMS
|
"sms" |
messages/lib/enums/Channels.ts:4 |
VIBER
|
"viber_service" |
messages/lib/enums/Channels.ts:6 |
WHATSAPP
|
"whatsapp" |
messages/lib/enums/Channels.ts:5 |
Defined in: messages/lib/enums/Messenger/MessengerCategory.ts:6
Enum representing categories for Facebook Messenger messages.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
MESSAGE_TAG
|
"message_tag" |
Represents a message tag message category. | messages/lib/enums/Messenger/MessengerCategory.ts:20 |
RESPONSE
|
"response" |
Represents a response message category. | messages/lib/enums/Messenger/MessengerCategory.ts:10 |
UPDATE
|
"update" |
Represents an update message category. | messages/lib/enums/Messenger/MessengerCategory.ts:15 |
Defined in: messages/lib/enums/Messenger/MessengerTags.ts:8
Enum representing message tags for Facebook Messenger messages.
These tags are used to categorize the purpose and relevance of the message.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
ACCOUNT_UPDATE
|
"ACCOUNT_UPDATE" |
Represents an account update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:22 |
APPOINTMENT_UPDATE
|
"APPOINTMENT_UPDATE" |
Represents an appointment update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:47 |
CONFIRMED_EVENT_UPDATE
|
"CONFIRMED_EVENT_UPDATE" |
Represents a confirmed event update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:12 |
FEATURE_FUNCTIONALITY_UPDATE
|
"FEATURE_FUNCTIONALITY_UPDATE" |
Represents a feature functionality update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:62 |
GAME_EVENT
|
"GAME_EVENT" |
Represents a game event message tag. | messages/lib/enums/Messenger/MessengerTags.ts:52 |
HUMAN_AGENT
|
"HUMAN_AGENT" |
Represents a message tag for human agent communication. | messages/lib/enums/Messenger/MessengerTags.ts:27 |
ISSUE_RESOLUTION
|
"ISSUE_RESOLUTION" |
Represents a message tag for issue resolution. | messages/lib/enums/Messenger/MessengerTags.ts:42 |
PAYMENT_UPDATE
|
"PAYMENT_UPDATE" |
Represents a payment update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:72 |
PERSONAL_FINANCE_UPDATE
|
"PERSONAL_FINANCE_UPDATE" |
Represents a personal finance update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:77 |
POST_PURCHASE_UPDATE
|
"POST_PURCHASE_UPDATE" |
Represents a post-purchase update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:17 |
RESERVATION_UPDATE
|
"RESERVATION_UPDATE" |
Represents a reservation update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:37 |
SHIPPING_UPDATE
|
"SHIPPING_UPDATE" |
Represents a shipping update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:32 |
TICKET_UPDATE
|
"TICKET_UPDATE" |
Represents a ticket update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:67 |
TRANSPORTATION_UPDATE
|
"TRANSPORTATION_UPDATE" |
Represents a transportation update message tag. | messages/lib/enums/Messenger/MessengerTags.ts:57 |
Defined in: messages/lib/enums/UpdateMessageStatus.ts:2
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
READ
|
"read" |
The status to set for the message. Setting the status of an inbound WhatsApp message to read indicates to the sender of the message that the message has been read (blue ticks are shown on that message in the WhatsApp UI). The status of an outbound WhatsApp message cannot be updated via this endpoint. | messages/lib/enums/UpdateMessageStatus.ts:10 |
REVOKED
|
"revoked" |
The status to set for the message. Setting the status of an outbound RCS message to revoked revokes that message if possible. | messages/lib/enums/UpdateMessageStatus.ts:17 |
Defined in: messages/lib/enums/Viber/ViberCategory.ts:8
Enum representing message categories for Viber messages.
These categories are used to classify the type and purpose of Viber messages.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
PROMOTION
|
"promotion" |
Represents the promotion message category. | messages/lib/enums/Viber/ViberCategory.ts:17 |
TRANSACTION
|
"transaction" |
Represents the transaction message category. | messages/lib/enums/Viber/ViberCategory.ts:12 |
Defined in: messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:8
Enum representing language codes for WhatsApp messages.
These language codes are used to specify the language of WhatsApp messages.
Defined in: messages/lib/classes/AbstractAudioMessage.ts:8
An abstract base class for audio messages.
new AbstractAudioMessage(params): AbstractAudioMessage
Defined in: messages/lib/classes/AbstractAudioMessage.ts:20
Constructs a new AbstractAudioMessage
instance.
The parameters for creating an audio message.
audio: MessageAudioType;
Defined in: messages/lib/classes/AbstractAudioMessage.ts:13
The audio message content.
MessageParamsAudio.audio
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsAudio.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsAudio.from
messageType: "audio";
Defined in: messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsAudio.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsAudio.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsAudio.webhookVersion
Defined in: messages/lib/classes/AbstractFileMessage.ts:7
An abstract base class for file messages.
protected new AbstractFileMessage(params): AbstractFileMessage
Defined in: messages/lib/classes/AbstractFileMessage.ts:19
Constructs a new AbstractFileMessage
instance.
The parameters for creating a file message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsFile.clientRef
file: MessageFileType;
Defined in: messages/lib/classes/AbstractFileMessage.ts:12
The file attachment content.
MessageParamsFile.file
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsFile.from
messageType: "file";
Defined in: messages/lib/classes/AbstractFileMessage.ts:11
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsFile.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsFile.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsFile.webhookVersion
Defined in: messages/lib/classes/AbstractImageMessage.ts:8
An abstract base class for image messages.
new AbstractImageMessage(params): AbstractImageMessage
Defined in: messages/lib/classes/AbstractImageMessage.ts:20
Constructs a new AbstractImageMessage
instance.
The parameters for creating an image message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsImage.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsImage.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
MessageParamsImage.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsImage.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsImage.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsImage.webhookVersion
Defined in: messages/lib/classes/AbstractMessage.ts:6
An abstract base class for message objects.
AbstractAudioMessage
AbstractFileMessage
AbstractImageMessage
AbstractTextMessage
AbstractVcardMessage
AbstractVideoMessage
WhatsAppCustom
WhatsAppSticker
WhatsAppTemplate
WhatsAppReaction
RCSCustom
new AbstractMessage(params): AbstractMessage
Defined in: messages/lib/classes/AbstractMessage.ts:43
Constructs a new AbstractMessage
instance.
The parameters for creating a message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParams.from
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParams.webhookVersion
Defined in: messages/lib/classes/AbstractTextMessage.ts:7
An abstract base class for text message objects.
new AbstractTextMessage(params): AbstractTextMessage
Defined in: messages/lib/classes/AbstractTextMessage.ts:26
Constructs a new AbstractTextMessage
instance for text messages.
The parameters for creating a text message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsText.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsText.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
MessageParamsText.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsText.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsText.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsText.webhookVersion
Defined in: messages/lib/classes/AbstractVcardMessage.ts:8
An abstract base class for vCard (contact card) message objects.
new AbstractVcardMessage(params): AbstractVcardMessage
Defined in: messages/lib/classes/AbstractVcardMessage.ts:27
Constructs a new AbstractVcardMessage
instance for vCard messages.
The parameters for creating a vCard message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsVcard.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsVcard.from
messageType: "vcard";
Defined in: messages/lib/classes/AbstractVcardMessage.ts:15
The type of message, which is 'vcard' for vCard messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsVcard.to
vcard: MessageVcardType;
Defined in: messages/lib/classes/AbstractVcardMessage.ts:20
The vCard (contact card) content of the message.
MessageParamsVcard.vcard
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsVcard.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsVcard.webhookVersion
Defined in: messages/lib/classes/AbstractVideoMessage.ts:8
An abstract base class for video message objects.
new AbstractVideoMessage(params): AbstractVideoMessage
Defined in: messages/lib/classes/AbstractVideoMessage.ts:27
Constructs a new AbstractVideoMessage
instance for video messages.
The parameters for creating a video message.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsVideo.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsVideo.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsVideo.to
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
MessageParamsVideo.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsVideo.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsVideo.webhookVersion
Defined in: messages/lib/messages.ts:47
Client class to interact with the Messages API which enables users to manage send messages through various channels programmatically.
https://developer.nexmo.com/en/messages/overview
Create a standalone Messages client
import { Messages } from '@vonage/messages';
const messagesClient = new Messages({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
Create an Messages client from the Vonage client
import { Vonage } from '@vonage/server-client';
const vonage = new Vonage({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
const messagesClient = vonage.messages;
new Messages(credentials, options?): Messages
Defined in: server-client/dist/lib/client.d.ts:35
Creates a new instance of the Client.
The authentication credentials or an authentication instance.
Optional configuration settings for the client.
addAuthenticationToRequest(request): Promise<VetchOptions>
Defined in: messages/lib/messages.ts:57
Adds authentication details to the given request based on the configured authentication type. Handle various ways the Messages API handles auth The Messages API handles both JWT (preferred) as well as Basic so we cannot just set a local authType
The request to which authentication should be added.
Promise
<VetchOptions
>
A promise that resolves to the request with added authentication.
Client
.addAuthenticationToRequest
protected addBasicAuthToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:71
Adds basic authentication headers to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addJWTToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:64
Adds a JWT to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:57
Adds API key and secret to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequest
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:50
Adds API key and secret to the request body.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequestBody
getConfig(): ConfigParams
Defined in: server-client/dist/lib/client.d.ts:36
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:168
Parses the response based on its content type.
• T
The expected type of the parsed response data.
The request options.
Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
protected prepareBody(request): undefined | string
Defined in: server-client/dist/lib/client.d.ts:158
Prepares the body for the request based on the content type.
The request options.
undefined
| string
- The prepared request body as a string or undefined.
protected prepareRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:151
Prepares the request with necessary headers, authentication, and query parameters.
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
send(message): Promise<MessageSuccess>
Defined in: messages/lib/messages.ts:82
Sends a message using the Vonage API.
The message to be sent.
Promise
<MessageSuccess
>
A promise that resolves to a success response with a message UUID.
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:78
Sends a DELETE request to the specified URL.
• T
string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:86
Sends a POST request with form data to the specified URL.
• T
string
The URL endpoint for the POST request.
Record
<string
, undefined
| string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:94
Sends a GET request to the specified URL with optional query parameters.
• T
string
The URL endpoint for the GET request.
Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.
Promise
<VetchResponse
<T
>>
- The response from the GET request.
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:104
Sends a PATCH request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PATCH request.
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:114
Sends a POST request to the specified URL with an optional payload.
• T
string
The URL endpoint for the POST request.
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:124
Sends a PUT request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PUT request.
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
sendRequest<T>(request): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:144
Sends a request adding necessary headers, handling authentication, and parsing the response.
• T
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:135
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
• T
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
string
The URL endpoint for the request.
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
updateMessage(messageId, status): Promise<true>
Defined in: messages/lib/messages.ts:131
Update the status of outbound and/or inbound messages for certain channels. For example, you can revoke outbound messages or mark inbound messages as read.
Please not that this endpoint is region specifc. You will need to set the region when you create the client.
string
The ID of the message to update.
string
The status to update the message to.
Promise
<true
>
A promise that resolves to true if the message was updated successfully.
Update the status of a WhatsApp message to "read"
const vonage = new Vonage(
{
applicationId: myAppId,
privateKey: myPrivateKey
},
{
apiHost: 'https://api-eu.vonage.com'
}
)
await vonage.messages.updateMessage(messageId, UpdateMessageStatus.READ);
protected auth: AuthInterface;
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
protected optional authType: AuthenticationType;
Defined in: server-client/dist/lib/client.d.ts:20
The type of authentication used for the client's requests.
protected config: ConfigParams;
Defined in: server-client/dist/lib/client.d.ts:28
Configuration settings for the client, including default hosts for various services and other request settings.
static transformers: object;
Defined in: server-client/dist/lib/client.d.ts:11
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
string
[]
snakeCaseObjectKeys: PartialTransformFunction;
Defined in: messages/lib/classes/Messenger/MessengerAudio.ts:9
Represents an audio message for the Messenger channel.
new MessengerAudio(params): MessengerAudio
Defined in: messages/lib/classes/Messenger/MessengerAudio.ts:43
Sends an audio message to the Facebook Messenger channel.
The parameters for creating a Messenger audio message.
import { MessengerAudio } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MessengerAudio({
to: TO_NUMBER,
from: FROM_NUMBER,
audio: {
url: 'https://example.com/audio.mp3',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
audio: MessageAudioType;
Defined in: messages/lib/classes/AbstractAudioMessage.ts:13
The audio message content.
MessengerAudioParams.audio
channel: "messenger";
Defined in: messages/lib/classes/Messenger/MessengerAudio.ts:16
The channel for this message (always 'messenger').
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessengerAudioParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessengerAudioParams.from
messageType: "audio";
Defined in: messages/lib/classes/AbstractAudioMessage.ts:12
messenger: MessengerType;
Defined in: messages/lib/classes/Messenger/MessengerAudio.ts:21
The messenger information for this message.
MessengerAudioParams.messenger
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessengerAudioParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessengerAudioParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessengerAudioParams.webhookVersion
Defined in: messages/lib/classes/Messenger/MessengerFile.ts:9
Represents a file message for the Messenger channel.
new MessengerFile(params): MessengerFile
Defined in: messages/lib/classes/Messenger/MessengerFile.ts:45
Sends a file message to the Facebook Messenger channel.
The parameters for creating a Messenger file message.
import { MessengerFile } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MessengerFile({
to: TO_NUMBER,
from: FROM_NUMBER,
file: {
url: 'https://example.com/image.jpg',
caption: 'This is an image',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "messenger";
Defined in: messages/lib/classes/Messenger/MessengerFile.ts:16
The channel for this message (always 'messenger').
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParams.clientRef
file: MessageFileType;
Defined in: messages/lib/classes/AbstractFileMessage.ts:12
The file attachment content.
MessengerFileParams.file
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParams.from
messageType: "file";
Defined in: messages/lib/classes/AbstractFileMessage.ts:11
messenger: MessengerType;
Defined in: messages/lib/classes/Messenger/MessengerFile.ts:21
The messenger information for this message.
MessengerFileParams.messenger
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParams.webhookVersion
Defined in: messages/lib/classes/Messenger/MessengerImage.ts:12
Represents an image message for the Messenger channel.
This class extends the AbstractImageMessage
class and implements the MessengerImageParams
interface.
It is used for sending image messages on the Messenger channel.
new MessengerImage(params): MessengerImage
Defined in: messages/lib/classes/Messenger/MessengerImage.ts:47
Send an image message using the Facebook Messenger channel.
The parameters for the image message.
import { MessengerImage } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MessengerImage({
to: TO_NUMBER,
from: FROM_NUMBER,
image: {
url: 'https://example.com/image.jpg',
caption: 'This is an image',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "messenger";
Defined in: messages/lib/classes/Messenger/MessengerImage.ts:19
The channel for sending the message, which is set to 'messenger'.
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessengerImageParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessengerImageParams.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
MessengerImageParams.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
messenger: MessengerType;
Defined in: messages/lib/classes/Messenger/MessengerImage.ts:24
Additional Messenger-specific parameters for the image message.
MessengerImageParams.messenger
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessengerImageParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessengerImageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessengerImageParams.webhookVersion
Defined in: messages/lib/classes/Messenger/MessengerText.ts:9
Represents a text message for the Messenger channel.
new MessengerText(params): MessengerText
Defined in: messages/lib/classes/Messenger/MessengerText.ts:42
Sends a text message to the Facebook Messenger channel.
The parameters for creating a Messenger text message.
import { MessengerText } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MessengerText({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "messenger";
Defined in: messages/lib/classes/Messenger/MessengerText.ts:16
The channel for this message (always 'messenger').
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessengerTextParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessengerTextParams.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
messenger: MessengerType;
Defined in: messages/lib/classes/Messenger/MessengerText.ts:21
The messenger information for this message.
MessengerTextParams.messenger
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
MessengerTextParams.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessengerTextParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessengerTextParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessengerTextParams.webhookVersion
Defined in: messages/lib/classes/Messenger/MessengerVideo.ts:9
Represents a video message for the Messenger channel.
new MessengerVideo(params): MessengerVideo
Defined in: messages/lib/classes/Messenger/MessengerVideo.ts:44
Send a video message using the Facebook Messenger channel.
The parameters for creating a Messenger video message.
import { MessagengerVideo } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MessagengerVideo({
to: TO_NUMBER,
from: FROM_NUMBER,
video: {
url: 'https://example.com/video.mp4',
caption: 'This is a video',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "messenger";
Defined in: messages/lib/classes/Messenger/MessengerVideo.ts:16
The channel for this message (always 'messenger').
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessengerVideoParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessengerVideoParams.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
messenger: MessengerType;
Defined in: messages/lib/classes/Messenger/MessengerVideo.ts:21
The messenger information for this message.
MessengerVideoParams.messenger
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessengerVideoParams.to
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
MessengerVideoParams.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessengerVideoParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessengerVideoParams.webhookVersion
Defined in: messages/lib/classes/MMS/MMSAudio.ts:9
Represents an audio message for the MMS channel.
new MMSAudio(params): MMSAudio
Defined in: messages/lib/classes/MMS/MMSAudio.ts:36
Send an MMS audio message.
The parameters for creating the audio message.
import { MMSAudio } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MMSAudio({
to: TO_NUMBER,
from: FROM_NUMBER,
audio: {
url: 'https://example.com/audio.mp3',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
audio: MessageAudioType;
Defined in: messages/lib/classes/AbstractAudioMessage.ts:13
The audio message content.
MessageParamsAudio.audio
channel: "mms";
Defined in: messages/lib/classes/MMS/MMSAudio.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsAudio.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsAudio.from
messageType: "audio";
Defined in: messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsAudio.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsAudio.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsAudio.webhookVersion
Defined in: messages/lib/classes/MMS/MMSImage.ts:9
Represents an image message for the MMS channel.
new MMSImage(params): MMSImage
Defined in: messages/lib/classes/MMS/MMSImage.ts:36
Send an MMS image message.
The parameters for creating the image message.
import { MMSImage } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MMSImage({
to: TO_NUMBER,
from: FROM_NUMBER,
image: {
url: 'https://example.com/image.jpg',
caption: 'This is an example image',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "mms";
Defined in: messages/lib/classes/MMS/MMSImage.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsImage.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsImage.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
MessageParamsImage.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsImage.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsImage.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsImage.webhookVersion
Defined in: messages/lib/classes/MMS/MMSVcard.ts:9
Represents a vCard message for the MMS channel.
new MMSVcard(params): MMSVcard
Defined in: messages/lib/classes/MMS/MMSVcard.ts:36
Send an MMS vCard message.
The parameters for creating the vCard message.
import { MMSVcard } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MMSVcard({
to: TO_NUMBER,
from: FROM_NUMBER,
vcard: {
url: 'https://example.com/vcard.vcf',
caption: 'Download my contact information',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "mms";
Defined in: messages/lib/classes/MMS/MMSVcard.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsVcard.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsVcard.from
messageType: "vcard";
Defined in: messages/lib/classes/AbstractVcardMessage.ts:15
The type of message, which is 'vcard' for vCard messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsVcard.to
vcard: MessageVcardType;
Defined in: messages/lib/classes/AbstractVcardMessage.ts:20
The vCard (contact card) content of the message.
MessageParamsVcard.vcard
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsVcard.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsVcard.webhookVersion
Defined in: messages/lib/classes/MMS/MMSVideo.ts:9
Represents a video message for the MMS channel.
new MMSVideo(params): MMSVideo
Defined in: messages/lib/classes/MMS/MMSVideo.ts:35
Send an MMS video message.
The parameters for creating the video message.
import { MMSVideo } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new MMSVideo({
to: TO_NUMBER,
from: FROM_NUMBER,
video: {
url: 'https://example.com/video.mp4',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "mms";
Defined in: messages/lib/classes/MMS/MMSVideo.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
MessageParamsVideo.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
MessageParamsVideo.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
MessageParamsVideo.to
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
MessageParamsVideo.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
MessageParamsVideo.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
MessageParamsVideo.webhookVersion
Defined in: messages/lib/classes/RCS/RCSCustom.ts:10
Represents a custom message for RCS.
new RCSCustom(params): RCSCustom
Defined in: messages/lib/classes/RCS/RCSCustom.ts:54
Sends a custom message through RCS
The parameters for creating a RCS custom message.
import { RCSCustom } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new RCSCustom({
to: TO_NUMBER,
from: FROM_NUMBER,
custom: {
foo: 'bar',
}
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: RCS = Channels.RCS;
Defined in: messages/lib/classes/RCS/RCSCustom.ts:14
The channel through which the message will be sent. Always rcs
RCSCustomParams.channel
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
RCSCustomParams.clientRef
custom: Record<string, unknown>;
Defined in: messages/lib/classes/RCS/RCSCustom.ts:24
A custom payload. The schema of a custom object can vary widely.
RCSCustomParams.custom
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
RCSCustomParams.from
messageType: string = 'custom';
Defined in: messages/lib/classes/RCS/RCSCustom.ts:19
The type of message. For a custom message, this will always be custom
.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
RCSCustomParams.to
optional ttl: number;
Defined in: messages/lib/classes/RCS/RCSCustom.ts:32
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
RCSCustomParams.ttl
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
RCSCustomParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
RCSCustomParams.webhookVersion
Defined in: messages/lib/classes/RCS/RCSFile.ts:10
Represents a file message for the RCS channel.
new RCSFile(params): RCSFile
Defined in: messages/lib/classes/RCS/RCSFile.ts:48
Sends a file message to the RCS channel.
MessageParams
& object
& object
The parameters for creating a RCS file message.
import { RCSFile } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new RCSFile({
to: TO_NUMBER,
from: FROM_NUMBER,
file: {
url: 'https://example.com/image.pdf',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: RCS = Channels.RCS;
Defined in: messages/lib/classes/RCS/RCSFile.ts:17
The channel for this message (always 'rcs').
RCSFileParams.channel
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
RCSFileParams.clientRef
file: MessageFileType;
Defined in: messages/lib/classes/AbstractFileMessage.ts:12
The file attachment content.
RCSFileParams.file
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
RCSFileParams.from
messageType: "file";
Defined in: messages/lib/classes/AbstractFileMessage.ts:11
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
RCSFileParams.to
optional ttl: number;
Defined in: messages/lib/classes/RCS/RCSFile.ts:25
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
RCSFileParams.ttl
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
RCSFileParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
RCSFileParams.webhookVersion
Defined in: messages/lib/classes/RCS/RCSImage.ts:10
Represents an image message for the RCS channel.
new RCSImage(params): RCSImage
Defined in: messages/lib/classes/RCS/RCSImage.ts:44
Send an RCS image message.
The parameters for creating the image message.
import { RCSImage } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new RCSImage({
to: TO_NUMBER,
from: FROM_NUMBER,
image: {
url: 'https://example.com/image.jpg',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: RCS = Channels.RCS;
Defined in: messages/lib/classes/RCS/RCSImage.ts:14
The channel through which the message will be sent. Always rcs
RCSImageParams.channel
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
RCSImageParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
RCSImageParams.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
RCSImageParams.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
RCSImageParams.to
optional ttl: number;
Defined in: messages/lib/classes/RCS/RCSImage.ts:22
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
RCSImageParams.ttl
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
RCSImageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
RCSImageParams.webhookVersion
Defined in: messages/lib/classes/RCS/RCSText.ts:10
Represents a text message for the RCS channel.
new RCSText(params): RCSText
Defined in: messages/lib/classes/RCS/RCSText.ts:43
Sends a text message through the RCS channel.
The parameters for creating a RCS text message.
import { RCSText } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new RCSText({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: RCS = Channels.RCS;
Defined in: messages/lib/classes/RCS/RCSText.ts:14
The channel for this message (always 'rcs').
RCSTextParams.channel
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
RCSTextParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
RCSTextParams.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
RCSTextParams.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
RCSTextParams.to
optional ttl: number;
Defined in: messages/lib/classes/RCS/RCSText.ts:22
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
RCSTextParams.ttl
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
RCSTextParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
RCSTextParams.webhookVersion
Defined in: messages/lib/classes/RCS/RCSVideo.ts:10
Represents an video message for the RCS channel.
new RCSVideo(params): RCSVideo
Defined in: messages/lib/classes/RCS/RCSVideo.ts:45
Send an RCS video message.
The parameters for creating the video message.
import { RCSVideo } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new RCSVideo({
to: TO_NUMBER,
from: FROM_NUMBER,
audio: {
url: 'https://example.com/video.mp4',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: RCS;
Defined in: messages/lib/classes/RCS/RCSVideo.ts:14
The channel through which the message will be sent. Always rcs
RCSVideoParams.channel
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
RCSVideoParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
RCSVideoParams.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
RCSVideoParams.to
optional ttl: number;
Defined in: messages/lib/classes/RCS/RCSVideo.ts:22
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
RCSVideoParams.ttl
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
RCSVideoParams.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
RCSVideoParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
RCSVideoParams.webhookVersion
Defined in: messages/lib/classes/SMS/SMS.ts:12
Send a text message using the SMS channel.
new SMS(
params,
to?,
from?,
clientRef?): SMS
Defined in: messages/lib/classes/SMS/SMS.ts:58
Send an SMS message
The message parameters or text message.
string
| SMSParams
string
The recipient's phone number.
string
The sender's phone number.
string
The client reference for the message.
import { SMS } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new SMS({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
Send SMS with entity ID and content ID
import { SMS } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new SMS({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
clientRef: 'my-personal-reference',
sms: {
entityId: 'MyEntityID',
contentId: 'MyContentID'
}
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "sms";
Defined in: messages/lib/classes/SMS/SMS.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
SMSParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
SMSParams.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
optional sms: SMSExtraParams;
Defined in: messages/lib/classes/SMS/SMS.ts:15
SMSParams.sms
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
SMSParams.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
SMSParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
SMSParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
SMSParams.webhookVersion
Defined in: messages/lib/classes/Viber/ViberFile.ts:9
Represents a file message for the Viber Service channel.
new ViberFile(params): ViberFile
Defined in: messages/lib/classes/Viber/ViberFile.ts:38
Send a file message using the Viber Service channel.
The parameters for the ViberFile message.
import { ViberFile } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new ViberFile({
to: TO_NUMBER,
from: FROM_NUMBER,
file: {
url: 'https://my-host.com/my-file.pdf',
},
viberService: {
action: {
url: 'https://my-host.com/my-path',
text: 'My button text',
},
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "viber_service";
Defined in: messages/lib/classes/Viber/ViberFile.ts:10
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
ViberFileParams.clientRef
file: MessageFileType;
Defined in: messages/lib/classes/AbstractFileMessage.ts:12
The file attachment content.
ViberFileParams.file
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
ViberFileParams.from
messageType: "file";
Defined in: messages/lib/classes/AbstractFileMessage.ts:11
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
ViberFileParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
ViberFileParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
ViberFileParams.webhookVersion
Defined in: messages/lib/classes/Viber/ViberImage.ts:10
Represents an image message for the Viber Service channel.
new ViberImage(params): ViberImage
Defined in: messages/lib/classes/Viber/ViberImage.ts:43
Send an image message using the Viber Service channel.
The parameters for the ViberImage message.
import { ViberImage } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new ViberImage({
to: TO_NUMBER,
from: FROM_NUMBER,
image: {
url: 'https://my-host.com/my-image.jpg',
},
viberService: {
action: {
url: 'https://my-host.com/my-path',
text: 'My button text',
},
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "viber_service";
Defined in: messages/lib/classes/Viber/ViberImage.ts:14
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
ViberImageParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
ViberImageParams.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
ViberImageParams.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
ViberImageParams.to
viberService: ViberActionParams;
Defined in: messages/lib/classes/Viber/ViberImage.ts:15
The Viber action parameters for sending the image.
ViberImageParams.viberService
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
ViberImageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
ViberImageParams.webhookVersion
Defined in: messages/lib/classes/Viber/ViberText.ts:10
Represents a text message for the Viber Service channel.
new ViberText(params): ViberText
Defined in: messages/lib/classes/Viber/ViberText.ts:42
Send a text message using the Viber Service channel.
The parameters for the ViberText message.
import { ViberText } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new ViberText({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
viberService: {
action: {
url: 'https://my-host.com/my-path',
text: 'My button text',
},
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "viber_service";
Defined in: messages/lib/classes/Viber/ViberText.ts:14
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
ViberTextParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
ViberTextParams.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
ViberTextParams.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
ViberTextParams.to
viberService: ViberActionParams;
Defined in: messages/lib/classes/Viber/ViberText.ts:15
The Viber service and action parameters for the message.
ViberTextParams.viberService
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
ViberTextParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
ViberTextParams.webhookVersion
Defined in: messages/lib/classes/Viber/ViberVideo.ts:9
Represents a video message for the Viber Service channel.
new ViberVideo(params): ViberVideo
Defined in: messages/lib/classes/Viber/ViberVideo.ts:43
Send a video message using the Viber Service channel.
The parameters for the ViberVideo message.
import { ViberVideo } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new ViberVideo({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
video: {
url: 'https://my-host.com/my-video.mp4',
},
viberService: {
action: {
url: 'https://my-host.com/my-path',
text: 'My button text',
},
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "viber_service";
Defined in: messages/lib/classes/Viber/ViberVideo.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
ViberVideoParams.clientRef
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
ViberVideoParams.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
ViberVideoParams.to
viberService: object & object & ViberService;
Defined in: messages/lib/classes/Viber/ViberVideo.ts:14
The Viber service, action parameters, and video message details.
duration: string;
The duration of the video in seconds.
fileSize: string;
The file size of the video in MB.
action: ViberAction;
The action associated with the Viber message.
ViberVideoParams.viberService
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
ViberVideoParams.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
ViberVideoParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
ViberVideoParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppAudio.ts:9
Represents an audio message for WhatsApp.
new WhatsAppAudio(params): WhatsAppAudio
Defined in: messages/lib/classes/WhatsApp/WhatsAppAudio.ts:37
Sends an audio message to a WhatsApp user.
The parameters for creating a WhatsApp audio message.
import { WhatsAppAudio } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppAudio({
to: TO_NUMBER,
from: FROM_NUMBER,
audio: {
url: 'https://example.com/audio.mp3',
caption: 'This is an audio message',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
audio: MessageAudioType;
Defined in: messages/lib/classes/AbstractAudioMessage.ts:13
The audio message content.
WhatsAppAudioParams.audio
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppAudio.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppAudioParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppAudio.ts:15
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppAudioParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppAudioParams.from
messageType: "audio";
Defined in: messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppAudioParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppAudioParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppAudioParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:13
Represents a custom message for WhatsApp.
new WhatsAppCustom(params): WhatsAppCustom
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:47
Sends a custom message to a WhatsApp user.
The parameters for creating a WhatsApp custom message.
import { WhatsAppCustom } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppCustom({
to: TO_NUMBER,
from: FROM_NUMBER,
custom: {
type: 'template',
template: {
namespace: 'your-namespace',
name: 'your-template-name',
},
}
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:17
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppCustomParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:21
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppCustomParams.context
custom: WhatsAppCustomType;
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:19
The custom WhatsApp message type.
WhatsAppCustomParams.custom
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppCustomParams.from
messageType: "custom";
Defined in: messages/lib/classes/WhatsApp/WhatsAppCustom.ts:18
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppCustomParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppCustomParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppCustomParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppFile.ts:10
Represents a file message for WhatsApp.
new WhatsAppFile(params): WhatsAppFile
Defined in: messages/lib/classes/WhatsApp/WhatsAppFile.ts:38
Send a WhatsApp file message.
The parameters for creating a WhatsApp file message.
import { WhatsAppFile } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppFile({
to: TO_NUMBER,
from: FROM_NUMBER,
file: {
url: 'https://example.com/image.jpg',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: Channels = Channels.WHATSAPP;
Defined in: messages/lib/classes/WhatsApp/WhatsAppFile.ts:14
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppFileParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppFile.ts:16
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppFileParams.context
file: MessageFileType;
Defined in: messages/lib/classes/AbstractFileMessage.ts:12
The file attachment content.
WhatsAppFileParams.file
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppFileParams.from
messageType: "file";
Defined in: messages/lib/classes/AbstractFileMessage.ts:11
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppFileParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppFileParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppFileParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppImage.ts:9
Represents an image message for WhatsApp.
new WhatsAppImage(params): WhatsAppImage
Defined in: messages/lib/classes/WhatsApp/WhatsAppImage.ts:37
Sends an image message to a WhatsApp user.
The parameters for creating a WhatsApp image message.
import { WhatsAppImage } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppImage({
to: TO_NUMBER,
from: FROM_NUMBER,
image: {
url: 'https://example.com/image.jpg',
caption: 'This is an image message',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppImage.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppImageParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppImage.ts:15
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppImageParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppImageParams.from
image: MessageImageType;
Defined in: messages/lib/classes/AbstractImageMessage.ts:13
The image attachment content.
WhatsAppImageParams.image
messageType: "image";
Defined in: messages/lib/classes/AbstractImageMessage.ts:12
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppImageParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppImageParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppImageParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:13
Represents a reaction message for WhatsApp.
new WhatsAppReaction(params): WhatsAppReaction
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:62
Sends a reaction message to a WhatsApp user.
The parameters for creating a WhatsApp reaction message.
Send a reaction
import { WhatsAppReaction } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppReaction({
to: TO_NUMBER,
from: FROM_NUMBER,
reaction: {
action: 'react',
emoji: '😍',
}
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
Remove reaction
import { WhatsAppReaction } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppReaction({
to: TO_NUMBER,
from: FROM_NUMBER,
reaction: {
action: 'unreact',
}
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:17
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppReactionParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:21
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppReactionParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppReactionParams.from
messageType: "reaction";
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:18
reaction: WhatsAppReactionType;
Defined in: messages/lib/classes/WhatsApp/WhatsAppReaction.ts:19
WhatsAppReactionParams.reaction
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppReactionParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppReactionParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppReactionParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:14
Represents a sticker message for WhatsApp.
new WhatsAppSticker(params): WhatsAppSticker
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:62
Send a sticker message to a WhatsApp user.
The parameters for creating a WhatsApp sticker message.
Send a sticker message with a sticker ID:
import { WhatsAppSticker } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppSticker({
to: TO_NUMBER,
from: FROM_NUMBER,
sticker: {
id: '0-0',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
Send a sticker message with a sticker URL:
import { WhatsAppSticker } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppSticker({
to: TO_NUMBER,
from: FROM_NUMBER,
sticker: {
url: 'https://example.com/sticker.png',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:18
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppStickerParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:22
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppStickerParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppStickerParams.from
messageType: "sticker";
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:19
sticker:
| WhatsAppStickerIdType
| WhatsAppStickerUrlType;
Defined in: messages/lib/classes/WhatsApp/WhatsAppSticker.ts:20
The sticker to be sent, which can be either a sticker ID or a sticker URL.
WhatsAppStickerParams.sticker
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppStickerParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppStickerParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppStickerParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:14
Represents a template message for WhatsApp.
new WhatsAppTemplate(params): WhatsAppTemplate
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:54
Send a template message to a WhatsApp user.
The parameters for creating a WhatsApp template message.
import { WhatsAppTemplate, WhatsAppLanguageCode } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppTemplate({
to: TO_NUMBER,
from: FROM_NUMBER,
whatsapp: {
policy: 'deterministic',
locale: WhatsAppLanguageCode.EN,
},
template: {
name: 'your-template-name',
parameters: [
'foo',
'bar',
],
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:18
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppTemplateParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:23
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppTemplateParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppTemplateParams.from
messageType: "template";
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:19
template: WhatsAppTemplateType;
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:21
The WhatsApp template to be sent.
WhatsAppTemplateParams.template
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppTemplateParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppTemplateParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppTemplateParams.webhookVersion
whatsapp: WhatsAppPolicyType;
Defined in: messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:20
WhatsApp policy type for the template message.
WhatsAppTemplateParams.whatsapp
Defined in: messages/lib/classes/WhatsApp/WhatsAppText.ts:9
Represents a text message for WhatsApp.
new WhatsAppText(params): WhatsAppText
Defined in: messages/lib/classes/WhatsApp/WhatsAppText.ts:34
Send a WhatsApp text message.
The parameters for creating a WhatsApp text message.
import { WhatsAppText } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppText({
to: TO_NUMBER,
from: FROM_NUMBER,
text: 'Hello world',
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppText.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppTextParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppText.ts:15
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppTextParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppTextParams.from
messageType: "text";
Defined in: messages/lib/classes/AbstractTextMessage.ts:14
The type of message, which is 'text' for text messages.
text: string;
Defined in: messages/lib/classes/AbstractTextMessage.ts:19
The text content of the message.
WhatsAppTextParams.text
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppTextParams.to
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppTextParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppTextParams.webhookVersion
Defined in: messages/lib/classes/WhatsApp/WhatsAppVideo.ts:9
Represents a video message for WhatsApp.
new WhatsAppVideo(params): WhatsAppVideo
Defined in: messages/lib/classes/WhatsApp/WhatsAppVideo.ts:38
Sends a video message to a WhatsApp user.
The parameters for creating a WhatsApp video message.
import { WhatsAppVideo } from '@vonage/messages';
const { messageUUID } = await messagesClient.send(new WhatsAppVideo({
to: TO_NUMBER,
from: FROM_NUMBER,
video: {
url: 'https://example.com/video.mp4',
caption: 'This is a video message',
},
clientRef: 'my-personal-reference',
}));
console.log(`Message sent successfully with UUID ${messageUUID}`);
channel: "whatsapp";
Defined in: messages/lib/classes/WhatsApp/WhatsAppVideo.ts:13
optional clientRef: string;
Defined in: messages/lib/classes/AbstractMessage.ts:20
An optional client reference for the message.
WhatsAppVideoParams.clientRef
optional context: WhatsAppContext;
Defined in: messages/lib/classes/WhatsApp/WhatsAppVideo.ts:15
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
WhatsAppVideoParams.context
from: string;
Defined in: messages/lib/classes/AbstractMessage.ts:15
The sender of the message.
WhatsAppVideoParams.from
messageType: "video";
Defined in: messages/lib/classes/AbstractVideoMessage.ts:15
The type of message, which is 'video' for video messages.
to: string;
Defined in: messages/lib/classes/AbstractMessage.ts:10
The recipient of the message.
WhatsAppVideoParams.to
video: MessageVideoType;
Defined in: messages/lib/classes/AbstractVideoMessage.ts:20
The video content of the message.
WhatsAppVideoParams.video
optional webhookUrl: string;
Defined in: messages/lib/classes/AbstractMessage.ts:27
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
WhatsAppVideoParams.webhookUrl
optional webhookVersion: "v0.1" | "v1";
Defined in: messages/lib/classes/AbstractMessage.ts:36
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
WhatsAppVideoParams.webhookVersion
type AnyChannel =
| AnyMessengerChannel
| AnyMMSChannel
| AnyViberChannel
| AnyWhatsAppChannel
| SMSChannel
| AnyRCSChannel;
Defined in: messages/lib/types/Channels/index.ts:19
Represents a union type that can be any of the specific channel message parameters or configurations, including Messenger, MMS, Viber, WhatsApp, or SMS.
type AnyMessengerChannel = object & AnyMessengerParams;
Defined in: messages/lib/types/Channels/Messenger/index.ts:38
Represents a union type that includes the 'channel' property set to 'messenger' along with any of the Messenger-specific message parameters or MessengerType.
channel: MESSENGER;
The channel through which the message will be sent, which is 'messenger' for Messenger.
type AnyMMSChannel = object & AnyMMSParams;
Defined in: messages/lib/types/Channels/MMS/index.ts:30
Represents a union type that includes the 'channel' property set to 'mms' along with any of the MMS-specific message parameters.
channel: MMS;
The channel through which the message will be sent, which is 'mms' for MMS.
type AnyRCSChannel =
| RCSCustomParams
| RCSFileParams
| RCSImageParams
| RCSTextParams
| RCSVideoParams;
Defined in: messages/lib/types/Channels/RCS/index.ts:13
type AnyViberChannel = object & AnyViberParams;
Defined in: messages/lib/types/Channels/Viber/index.ts:39
Represents a union type that includes the 'channel' property set to 'viber' along with any of the Viber-specific message parameters or configurations.
channel: VIBER;
The channel through which the message will be sent, which is 'viber' for Viber.
type AnyWhatsAppChannel = object & AnyWhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/index.ts:56
Represents a union type that includes the 'channel' property set to 'whatsapp_service' along with any of the WhatsApp-specific message parameters or configurations.
channel: WHATSAPP;
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
type MessageAudioType = object;
Defined in: messages/lib/types/MessageAudioType.ts:4
Represents an audio message type.
url: string;
The URL of the audio attachment.
type MessageFileType = object;
Defined in: messages/lib/types/MessageFileType.ts:4
Represents a file message type.
url: string;
The URL of the file attachment.
type MessageImageType = object;
Defined in: messages/lib/types/MessageImageType.ts:4
Represents an image message type.
url: string;
The URL of the image attachment.
type MessageParams = object;
Defined in: messages/lib/types/MessageParams.ts:4
Represents the parameters for a message.
optional clientRef: string;
Client reference of up to 100 characters. The reference will be present in every message status.
from: string;
The ID of the message sender.
to: string;
The ID of the message recipient.
optional webhookUrl: string;
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
optional webhookVersion: "v0.1" | "v1";
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
type MessageParamsAudio = object & MessageParams;
Defined in: messages/lib/types/MessageParamsAudio.ts:7
Represents the parameters for a message with audio.
audio: MessageAudioType;
The audio message content.
type MessageParamsFile = object & MessageParams;
Defined in: messages/lib/types/MessageParamsFile.ts:7
Represents the parameters for a message with a file attachment.
file: MessageFileType;
The file attachment content.
type MessageParamsImage = object & MessageParams;
Defined in: messages/lib/types/MessageParamsImage.ts:7
Represents the parameters for a message with an image attachment.
image: MessageImageType;
The image attachment content.
optional ttl: number;
The amount of time in seconds the message will live for
type MessageParamsText = object & MessageParams;
Defined in: messages/lib/types/MessageParamsText.ts:6
Represents the parameters for a text message.
text: string;
The text content of the message.
type MessageParamsVcard = MessageVcardParams & MessageParams;
Defined in: messages/lib/types/MessageParamsVcard.ts:7
Represents the parameters for a message containing a vCard.
type MessageParamsVideo = object & MessageParams;
Defined in: messages/lib/types/MessageParamsVideo.ts:7
Represents the parameters for a message containing a video.
video: MessageVideoType;
The video information to be included in the message.
type MessageSuccess = object;
Defined in: messages/lib/types/MessageSuccess.ts:1
messageUUID: string;
type MessageSuccessResponse = object;
Defined in: messages/lib/types/Responses/MessageSuccessResponse.ts:12
Represents a successful response received when sending a message.
This type includes a message_uuid
field, which is a unique identifier for the sent message.
message_uuid: string;
A unique identifier for the sent message.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type MessageVcardParams = object;
Defined in: messages/lib/types/MessageVcardType.ts:16
Represents a vCard message type.
vcard: MessageVcardType;
type MessageVcardType = object;
Defined in: messages/lib/types/MessageVcardType.ts:1
optional caption: string;
Additional text to accompany the vCard.
url: string;
The URL of the vCard attachment.
type MessageVideoType = object;
Defined in: messages/lib/types/MessageVideoType.ts:4
Represents a video message type.
url: string;
The URL of the video attachment.
type RCSCustomParams = MessageParams & object;
Defined in: messages/lib/types/Channels/RCS/RCSCustomParams.ts:7
Represents the parameters for sending a custom message using RCS.
optional channel: RCS;
The channel to send to. You must provide rcs
in this field.
custom: Record<string, unknown>;
A custom payload. The schema of a custom object can vary widely.
optional ttl: number;
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
type RCSFileParams = MessageParamsFile & object;
Defined in: messages/lib/types/Channels/RCS/RCSFileParams.ts:7
Represents the parameters for sending a file message using RCS.
optional channel: RCS;
The channel to send to. You must provide rcs
in this field.
optional ttl: number;
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
type RCSImageParams = MessageParamsImage & object;
Defined in: messages/lib/types/Channels/RCS/RCSImageParams.ts:7
Represents the parameters for sending an image message using RCS.
optional channel: RCS;
The channel to send to. You must provide rcs
in this field.
type RCSTextParams = MessageParams & object;
Defined in: messages/lib/types/Channels/RCS/RCSTextParams.ts:7
Represents the parameters for sending a text message using RCS.
optional channel: RCS;
The channel to send to. You must provide rcs
in this field.
text: string;
The text of the message to send. Limited to 3072 characters, including unicode.
optional ttl: number;
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
type RCSVideoParams = MessageParams & object;
Defined in: messages/lib/types/Channels/RCS/RCSVideoParams.ts:8
Represents the parameters for sending a video message using RCS.
optional channel: RCS;
The channel to send to. You must provide rcs
in this field.
optional ttl: number;
The duration in seconds the delivery of a message will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
video: MessageVideoType;
type SendMessageParams =
| AnyMessengerParams
| AnyViberParams
| AnyWhatsAppParams
| AnyMMSParams
| SMSParams;
Defined in: messages/lib/types/SendMessageParams.ts:15
Represents parameters for sending various types of messages. This union type can be used to send messages across different platforms like Messenger, MMS, SMS, Viber, WhatsApp, etc. Use the corresponding Type for the specific message type you want to send.
type SMSChannel = object & SMSParams;
Defined in: messages/lib/types/Channels/SMSParams.ts:53
Represents an SMS channel message, combining the channel type with SMS-specific parameters.
This type includes the channel
field specifying the SMS channel and combines
it with the SMS message parameters defined in SMSParams
.
channel: SMS;
optional sms: SMSExtraParams;
optional ttl: number;
The duration in seconds the delivery of an SMS will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
type SMSExtraParams = object;
Defined in: messages/lib/types/Channels/SMSParams.ts:18
optional contentId: string;
A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.
optional encodingType: "unicode" | "text" | "auto";
The encoding type to use for the message. If set to either text or unicode the specified type will be used. If set to auto (the default), the Messages API will automatically set the type based on the content of text; i.e. if unicode characters are detected in text, then the message will be encoded as unicode, and otherwise as text.
optional entityId: string;
A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.
type UpdateMessageRequest = object;
Defined in: messages/lib/types/Requests/UpdateMessageRequest.ts:6
The request object for the Messages.update method.
status: UpdateMessageStatus | string;
The status to set for the message.
This value depends on the type of message that was sent. The SDK has no way to know which value will be correct for the message. Confirm with the API specification or the API documentation which value is correct for the message https://developer.vonage.com/en/api/messages#UpdateMessage.
type WhatsAppContext = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:3
messageUUID: string;
The UUID of the message being replied to/quoted.
type WhatsAppCustomType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppCustomType.ts:6
Represents a custom WhatsApp message type with arbitrary properties.
[key: string]: unknown
type WhatsAppFileParams = object & WhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppFileParams.ts:9
Represents a WhatsApp file message type.
file: object & MessageFileType;
The file attachment content.
optional caption: string;
An optional caption to accompany the file.
optional name: string;
Optional parameter that specifies the name of the file being sent. If not included, the value for caption will be used as the file name. If neither name or caption are included, the file name will be parsed from the url.
type WhatsAppParams = object & MessageParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:10
optional context: WhatsAppContext;
An optional context used for quoting/replying to a specific meesage in a conversation. When used, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content
type WhatsAppPolicyType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppPolicyType.ts:8
Represents a WhatsApp policy type for deterministic messaging.
locale: WhatsAppLanguageCode;
The locale for the WhatsApp message, following the WhatsApp language code.
policy: "deterministic";
The policy type, which is set to 'deterministic'.
type WhatsAppReactionRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppReactionRequest.ts:1
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
context: object;
A context used for quoting/replying/reacting to a specific message in a conversation. When used for quoting or replying, the WhatsApp UI will display the new message along with a contextual bubble that displays the quoted/replied to message's content. When used for reacting the WhatsApp UI will display the reaction emoji below the reacted to message.
context.message_uuid: string;
The UUID of the message being quoted/replied/reacted to.
from: string;
The sender's identifier.
message_type: "reaction";
The type of the message, which is 'reaction' for a text message.
reaction: object;
reaction.action: "react" | "unreact";
The action taken.
optional reaction.emoji: string;
The emoji used as a reaction.
to: string;
The recipient's identifier.
webhook_url: string;
Specifies the URL to which Status Webhook messages will be sent for this particular message. Over-rides account-level and application-level Status Webhook url settings on a per-message basis.
webhook_version: "v0.1" | "v1";
Specifies which version of the Messages API will be used to send Status Webhook messages for this particular message. For example, if v0.1 is set, then the JSON body of Status Webhook messages for this message will be sent in Messages v0.1 format. Over-rides account-level and application-level API version settings on a per-message basis.
type WhatsAppReactionType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatAppReactionType.ts:1
action: "react" | "unreact";
The action taken.
optional emoji: string;
The emoji used as a reaction.
type WhatsAppStickerIdType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppStickerIdType.ts:6
Represents a WhatsApp sticker ID type.
id: string;
The ID of the WhatsApp sticker.
type WhatsAppStickerUrlType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppStickerUrlType.ts:6
Represents a WhatsApp sticker by URL.
url: string;
The URL of the WhatsApp sticker.
type WhatsAppTemplateType = object;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppTemplateType.ts:6
Represents a WhatsApp template for sending structured template messages.
name: string;
The name of the WhatsApp template.
parameters: string[];
An array of parameters for the WhatsApp template.
type AnyMessengerParams =
| MessengerAudioParams
| MessengerFileParams
| MessengerImageParams
| MessengerParams
| MessengerTextParams
| MessengerType
| MessengerVideoParams;
Defined in: messages/lib/types/Channels/Messenger/index.ts:25
Represents a union type that can be any of the Messenger-specific message parameters or MessengerType.
type AnyMMSParams =
| MMSAudioParams
| MMSImageParams
| MMSVcardParams
| MMSVideoParams;
Defined in: messages/lib/types/Channels/MMS/index.ts:18
Represents a union type that can be any of the MMS-specific message parameters.
type AnyViberParams =
| ViberAction
| ViberActionParams
| ViberFileParams
| ViberImageParams
| ViberService
| ViberTextParams
| ViberVideoParams;
Defined in: messages/lib/types/Channels/Viber/index.ts:24
Represents a union type that can be any of the Viber-specific message parameters or configurations.
type AnyWhatsAppParams =
| WhatsAppAudioParams
| WhatsAppCustomParams
| WhatsAppFileParams
| WhatsAppImageParams
| WhatsAppStickerIdType
| WhatsAppStickerParams
| WhatsAppTemplateParams
| WhatsAppTextParams
| WhatsAppReactionParams
| WhatsAppVideoParams;
Defined in: messages/lib/types/Channels/WhatsApp/index.ts:37
Represents a union type that can be any of the WhatsApp-specific message parameters or configurations.
type MessengerAudioParams = MessengerParams & MessageParamsAudio;
Defined in: messages/lib/types/Channels/Messenger/MessengerAudioParams.ts:11
Represents parameters for sending an audio message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsAudio.
type MessengerFileParams = object & MessengerParams;
Defined in: messages/lib/types/Channels/Messenger/MessengerFileParams.ts:10
Represents parameters for sending a file message via the Messenger platform.
file: MessageFileType;
type MessengerImageParams = MessengerParams & MessageParamsImage;
Defined in: messages/lib/types/Channels/Messenger/MessengerImageParams.ts:11
Represents parameters for sending an image message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsImage.
type MessengerParams = object;
Defined in: messages/lib/types/Channels/Messenger/MessengerParams.ts:9
Represents parameters specific to the Messenger platform.
messenger: MessengerType;
type MessengerTextParams = MessengerParams & MessageParamsText;
Defined in: messages/lib/types/Channels/Messenger/MessengerTextParams.ts:10
Represents parameters for sending a text message via the Messenger platform.
type MessengerType = object;
Defined in: messages/lib/types/Channels/Messenger/MessengerType.ts:9
Represents the type of message to be sent via the Messenger platform.
category: MessengerCategory;
The category of the Messenger message.
optional tag: string;
An optional tag describing the type and relevance of the 1:1 communication between your app and the end user.
type MessengerVideoParams = MessengerParams & MessageParamsVideo;
Defined in: messages/lib/types/Channels/Messenger/MessengerVideoParams.ts:10
Represents parameters for sending a video message via the Messenger platform.
type MMSAudioParams = MessageParams & MessageAudioType;
Defined in: messages/lib/types/Channels/MMS/MMSAudioParams.ts:13
Represents the parameters for sending an audio message on the MMS channel.
This type combines the common message parameters from MessageParams
with audio-specific parameters
defined in MessageAudioType
. It is used when creating an audio message for the MMS channel.
type MMSImageParams = MessageParams & MessageImageType;
Defined in: messages/lib/types/Channels/MMS/MMSImageParams.ts:13
Represents the parameters for sending an image message on the MMS channel.
This type combines the common message parameters from MessageParams
with image-specific parameters
defined in MessageImageType
. It is used when creating an image message for the MMS channel.
type MMSVcardParams = object & MessageParams & MessageVcardType;
Defined in: messages/lib/types/Channels/MMS/MMSVcardParams.ts:13
Represents the parameters for sending a vCard message on the MMS channel.
This type combines the common message parameters from MessageParams
with vCard-specific parameters
defined in MessageVcardType
. It is used when creating a vCard message for the MMS channel.
optional ttl: number;
The amount of time in seconds the message will live for
type MMSVideoParams = MessageParams & MessageVideoType;
Defined in: messages/lib/types/Channels/MMS/MMSVideoParams.ts:13
Represents the parameters for sending a video message on the MMS channel.
This type combines the common message parameters from MessageParams
with video-specific parameters
defined in MessageVideoType
. It is used when creating a video message for the MMS channel.
type SMSParams = object & MessageParamsText;
Defined in: messages/lib/types/Channels/SMSParams.ts:16
Represents the parameters for sending an SMS message.
This type is an alias for MessageParamsText
and is used when creating an SMS message.
optional sms: SMSExtraParams;
The purpose of this type is to ensure a consistent interface for SMS
message parameters, making it easier to extend or modify the type in the
future without impacting existing code that uses it.
It is based on the MessageParamsText
type.
type ViberAction = object;
Defined in: messages/lib/types/Channels/Viber/ViberAction.ts:7
Represents an action associated with a Viber message.
text: string;
The text displayed for the action.
url: string;
The URL to be opened when the action is triggered.
type ViberActionParams = object & ViberService;
Defined in: messages/lib/types/Channels/Viber/ViberActionParams.ts:9
Represents parameters for a Viber action message.
action: ViberAction;
The action associated with the Viber message.
type ViberFileParams = object & MessageParams;
Defined in: messages/lib/types/Channels/Viber/ViberFileParams.ts:10
Represents parameters for sending a file via Viber.
file: object & MessageFileType;
optional name: string;
The name and extension of the file.
type ViberImageParams = object & MessageParamsImage;
Defined in: messages/lib/types/Channels/Viber/ViberImageParams.ts:10
Represents parameters for sending an image via Viber.
viberService: ViberActionParams;
The Viber action parameters for sending the image.
type ViberService = object;
Defined in: messages/lib/types/Channels/Viber/ViberService.ts:10
Represents parameters for a Viber service message.
optional action: ViberAction;
category: ViberCategory;
The category of the Viber service message.
ttl: number;
The time-to-live (TTL) of the message to be delivered in seconds. If the message is not delivered within this time, it will be deleted.
type: string;
The Viber-specific type definition. To use "template," please contact your Vonage Account Manager to set up templates. To find out more, please visit the product page.
type ViberTextParams = object & MessageParamsText;
Defined in: messages/lib/types/Channels/Viber/ViberTextParams.ts:10
Represents parameters for sending a text message via Viber with action buttons.
text: string;
The text content of the message.
viberService: ViberActionParams;
The Viber service and action parameters for the message.
type ViberVideoParams = object & MessageParamsVideo;
Defined in: messages/lib/types/Channels/Viber/ViberVideoParams.ts:10
Represents parameters for sending a video message via Viber with action buttons.
viberService: object & ViberActionParams;
The Viber service, action parameters, and video message details.
duration: string;
The duration of the video in seconds.
fileSize: string;
The file size of the video in MB.
video: object;
The details of the video message to be sent.
optional video.caption: string;
The caption to be displayed with the video.
optional video.thumbUrl: string;
The URL of the thumbnail image to be displayed with the video.
video.url: string;
The URL of the video attachment.
type WhatsAppAudioParams = object & WhatsAppParams & MessageParamsAudio;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppAudioParams.ts:10
Represents parameters for sending an audio message via WhatsApp.
optional ttl: number;
The amount of time in seconds the message will live for
type WhatsAppCustomParams = object & WhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppCustomParams.ts:10
Represents parameters for sending a custom WhatsApp message with a file attachment.
custom: WhatsAppCustomType;
The custom WhatsApp message type.
type WhatsAppImageParams = WhatsAppParams & MessageParamsImage;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppImageParams.ts:10
Represents a WhatsApp image message type.
type WhatsAppReactionParams = object & WhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppReactionParams.ts:9
Represents WhatsApp reaction message parameters.
reaction: WhatsAppReactionType;
type WhatsAppStickerParams = object & WhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppStickerParams.ts:11
Represents WhatsApp sticker parameters for sending stickers in a message.
sticker:
| WhatsAppStickerIdType
| WhatsAppStickerUrlType;
The sticker to be sent, which can be either a sticker ID or a sticker URL.
type WhatsAppTemplateParams = object & WhatsAppParams;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppTemplateParams.ts:11
Represents WhatsApp template message parameters.
template: WhatsAppTemplateType;
The WhatsApp template to be sent.
whatsapp: WhatsAppPolicyType;
WhatsApp policy type for the template message.
type WhatsAppTextParams = WhatsAppParams & MessageParamsText;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppTextParams.ts:10
Represents a text message type for WhatsApp.
type WhatsAppVideoParams = object & WhatsAppParams & MessageParamsVideo;
Defined in: messages/lib/types/Channels/WhatsApp/WhatsAppVideoParams.ts:10
Represents a video message type for WhatsApp.
optional ttl: number;
The amount of time in seconds the message will live for
type MessengerAudioRequest = object;
Defined in: messages/lib/types/Requests/MessengerAudioRequest.ts:13
Represents a request to send an audio message via the Messenger channel.
audio: object;
The audio content of the message, including the URL of the audio file.
audio.url: string;
The URL of the audio file.
channel: "messenger";
The channel for sending the message, which is set to 'messenger'.
client_ref: string;
A client reference string for tracking the message.
from: string;
The sender of the message.
message_type: "audio";
The message type, which is set to 'audio' for an audio message.
messenger: MessengerType;
Additional details about the Messenger message type.
to: string;
The recipient of the message.
Vonage API's will return information using snake_case
. This represents the
pure request structure before it's transformed into snake_case
for the API call.
type MessengerFileRequest = object;
Defined in: messages/lib/types/Requests/MessengerFileRequest.ts:13
Represents a request to send a file message via the Messenger channel.
channel: "messenger";
The channel for sending the message, which is set to 'messenger'.
client_ref: string;
A client reference string for tracking the message.
file: object;
The file content of the message, including the URL of the file.
file.url: string;
The URL of the file.
from: string;
The sender of the message.
message_type: "file";
The message type, which is set to 'file' for a file message.
messenger: MessengerType;
Additional details about the Messenger message type.
to: string;
The recipient of the message.
Vonage API's will return information using snake_case
. This represents the
pure request structure before it's transformed into snake_case
for the API call.
type MessengerImageRequest = object;
Defined in: messages/lib/types/Requests/MessengerImageRequest.ts:13
Represents a request to send an image message via the Messenger channel.
channel: "messenger";
The channel for sending the message, which is set to 'messenger'.
client_ref: string;
A client reference string for tracking the message.
from: string;
The sender of the message.
image: object;
The image content of the message, including the URL of the image.
image.url: string;
The URL of the image.
message_type: "image";
The message type, which is set to 'image' for an image message.
messenger: MessengerType;
Additional details about the Messenger message type.
to: string;
The recipient of the message.
Vonage API's will return information using snake_case
. This represents the
pure request structure before it's transformed into snake_case
for the API call.
type MessengerTextRequest = object;
Defined in: messages/lib/types/Requests/MessengerTextRequest.ts:12
Represents a request for sending a text message via the Messenger channel.
channel: "messenger";
The channel through which the message will be sent, which is 'messenger' for Messenger.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "text";
The type of the message, which is 'text' for a text message.
messenger: MessengerType;
Additional information specific to the Messenger channel.
text: string;
The text content of the message.
to: string;
The recipient's phone number or identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type MessengerVideoRequest = object;
Defined in: messages/lib/types/Requests/MessengerVideoRequest.ts:13
Represents a request for sending a video message via the Messenger channel.
channel: "messenger";
The channel through which the message will be sent, which is 'messenger' for Messenger.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "video";
The type of the message, which is 'video' for a video message.
messenger: MessengerType;
Additional information specific to the Messenger channel.
to: string;
The recipient's phone number or identifier.
video: object;
The video content of the message.
video.url: string;
The URL of the video to be sent in the message.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type MMSAudioRequest = object;
Defined in: messages/lib/types/Requests/MMSAudioRequest.ts:11
Represents a request for sending an audio message via the MMS (Multimedia Messaging Service) channel.
audio: object;
The audio content of the message, including the URL of the audio and an optional caption.
optional audio.caption: string;
An optional caption or description for the audio message.
audio.url: string;
The URL of the audio file to be sent in the message.
channel: "mms";
The channel through which the message will be sent, which is 'mms' for MMS.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "audio";
The type of the message, which is 'audio' for an audio message.
to: string;
The recipient's phone number or identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type MMSImageRequest = object;
Defined in: messages/lib/types/Requests/MMSImageRequest.ts:11
Represents a request for sending an image message via the MMS (Multimedia Messaging Service) channel.
channel: "mms";
The channel through which the message will be sent, which is 'mms' for MMS.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
image: object;
The image content of the message, including the URL of the image and an optional caption.
optional image.caption: string;
An optional caption or description for the image message.
image.url: string;
The URL of the image file to be sent in the message.
message_type: "image";
The type of the message, which is 'image' for an image message.
to: string;
The recipient's phone number or identifier.
optional ttl: number;
The amount of time in seconds the message will live for
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type MMSVcardRequest = object;
Defined in: messages/lib/types/Requests/MMSVcardRequest.ts:11
Represents a request for sending a vCard message via the MMS (Multimedia Messaging Service) channel.
channel: "mms";
The channel through which the message will be sent, which is 'mms' for MMS.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "vcard";
The type of the message, which is 'vcard' for a vCard message.
to: string;
The recipient's phone number or identifier.
vcard: object;
The vCard content of the message, including the URL of the vCard file.
vcard.url: string;
The URL of the vCard file to be sent in the message.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type MMSVideoRequest = object;
Defined in: messages/lib/types/Requests/MMSVideoRequest.ts:11
Represents a request for sending a video message via the MMS (Multimedia Messaging Service) channel.
channel: "mms";
The channel through which the message will be sent, which is 'mms' for MMS.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "video";
The type of the message, which is 'video' for a video message.
to: string;
The recipient's phone number or identifier.
video: object;
The video content of the message, including the URL of the video file and an optional caption.
optional video.caption: string;
An optional caption for the video.
video.url: string;
The URL of the video file to be sent in the message.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type SMSMessageRequest = object;
Defined in: messages/lib/types/Requests/SMSMessageRequest.ts:11
Represents a request for sending a text message via the SMS (Short Message Service) channel.
channel: "sms";
The channel through which the message will be sent, which is 'sms' for SMS.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's phone number or identifier.
message_type: "text";
The type of the message, which is 'text' for a text message.
optional sms: object;
optional sms.content_id: string;
A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.
optional sms.encoding_type: "unicode" | "text" | "auto";
The encoding type to use for the message. If set to either text or unicode the specified type will be used. If set to auto (the default), the Messages API will automatically set the type based on the content of text; i.e. if unicode characters are detected in text, then the message will be encoded as unicode, and otherwise as text.
optional sms.entity_id: string;
A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.
text: string;
The text content of the message.
to: string;
The recipient's phone number.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type ViberFileRequest = object;
Defined in: messages/lib/types/Requests/ViberFileRequest.ts:13
Represents a request for sending a file message via the Viber Service channel.
channel: "viber_service";
The channel through which the message will be sent, which is 'viber_service' for Viber Service.
client_ref: string;
A client-defined reference string for the message.
file: object;
The file content to be sent, including the URL and name.
file.name: string;
The name of the file.
file.url: string;
The URL of the file to be sent.
from: string;
The sender's identifier.
message_type: "file";
The type of the message, which is 'file' for a file message.
to: string;
The recipient's identifier.
viber_service: ViberService;
The Viber service configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type ViberImageRequest = object;
Defined in: messages/lib/types/Requests/ViberImageRequest.ts:13
Represents a request for sending an image message via the Viber Service channel.
channel: "viber_service";
The channel through which the message will be sent, which is 'viber_service' for Viber Service.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
image: object;
The image content to be sent, including the URL and optional caption.
optional image.caption: string;
An optional caption for the image.
image.url: string;
The URL of the image to be sent.
message_type: "image";
The type of the message, which is 'image' for an image message.
to: string;
The recipient's identifier.
viber_service: ViberService;
The Viber service configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type ViberTextRequest = object;
Defined in: messages/lib/types/Requests/ViberTextRequest.ts:13
Represents a request for sending a text message via the Viber Service channel.
channel: "viber_service";
The channel through which the message will be sent, which is 'viber_service' for Viber Service.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "text";
The type of the message, which is 'text' for a text message.
text: string;
The text content of the message.
to: string;
The recipient's identifier.
viber_service: ViberService;
The Viber service configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type ViberVideoRequest = object;
Defined in: messages/lib/types/Requests/ViberVideoRequest.ts:13
Represents a request for sending a video message via the Viber Service channel.
channel: "viber_service";
The channel through which the message will be sent, which is 'viber_service' for Viber Service.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "video";
The type of the message, which is 'video' for a video message.
to: string;
The recipient's identifier.
viber_service: ViberService;
The Viber service configuration.
video: object;
The video content of the message, including its URL and optional caption and thumbnail URL.
optional video.caption: string;
An optional caption for the video.
optional video.thumb_url: string;
An optional URL for the video's thumbnail.
video.url: string;
The URL of the video.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppAudioRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppAudioRequest.ts:11
Represents a request for sending an audio message via the WhatsApp channel.
audio: object;
The audio content of the message, including its URL.
audio.url: string;
The URL of the audio.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "audio";
The type of the message, which is 'audio' for an audio message.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppCustomRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppCustomRequest.ts:11
Represents a request for sending a custom message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
custom: Record<string, unknown>;
The custom content of the message as a record of unknown type.
from: string;
The sender's identifier.
message_type: "custom";
The type of the message, which is 'custom' for a custom message.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppFileRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppFileRequest.ts:11
Represents a request for sending a file message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
file: object;
The file content of the message, including the URL of the file and an optional caption.
optional file.caption: string;
An optional caption for the file.
file.url: string;
The URL of the file to be sent.
from: string;
The sender's identifier.
message_type: "file";
The type of the message, which is 'file' for a file message.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppImageRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppImageRequest.ts:11
Represents a request for sending an image message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
image: object;
The image content of the message, including the URL of the image and an optional caption.
optional image.caption: string;
An optional caption for the image.
image.url: string;
The URL of the image to be sent.
message_type: "image";
The type of the message, which is 'image' for an image message.
to: string;
The recipient's identifier.
optional ttl: number;
The amount of time in seconds the message will live for
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppStickerIdRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppStickerIdRequest.ts:11
Represents a request for sending a sticker message via the WhatsApp channel using a sticker ID.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "sticker";
The type of the message, which is 'sticker' for a sticker message.
sticker: object;
The sticker content of the message, including the sticker ID.
sticker.id: string;
The ID of the sticker to be sent.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppStickerUrlRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppStickerUrlRequest.ts:11
Represents a request for sending a sticker message via the WhatsApp channel using a sticker URL.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "sticker";
The type of the message, which is 'sticker' for a sticker message.
sticker: object;
The sticker content of the message, including the sticker URL.
sticker.url: string;
The URL of the sticker to be sent.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppTemplateRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppTemplateRequest.ts:13
Represents a request for sending a template message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "template";
The type of the message, which is 'template' for a template message.
template: WhatsAppTemplateType;
The template content of the message, including the template type.
to: string;
The recipient's identifier.
whatsapp: WhatsAppPolicyType;
The policy and locale settings for sending the WhatsApp template message.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppTextRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppTextRequest.ts:11
Represents a request for sending a text message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "text";
The type of the message, which is 'text' for a text message.
text: string;
The text content of the message.
to: string;
The recipient's identifier.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.
type WhatsAppVideoRequest = object;
Defined in: messages/lib/types/Requests/WhatsAppVideoRequest.ts:11
Represents a request for sending a video message via the WhatsApp channel.
channel: "whatsapp";
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
client_ref: string;
A client-defined reference string for the message.
from: string;
The sender's identifier.
message_type: "video";
The type of the message, which is 'video' for a video message.
to: string;
The recipient's identifier.
video: object;
The video content of the message, including the URL and an optional caption.
optional video.caption: string;
An optional caption for the video.
video.url: string;
The URL of the video.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
.