-
Notifications
You must be signed in to change notification settings - Fork 181
Vonage Messages
Vonage Messages • Docs
Documentation / Vonage Messages
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 |
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 |
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 |
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 |
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 |
Enum representing language codes for WhatsApp messages.
These language codes are used to specify the language of WhatsApp messages.
An abstract base class for audio messages.
new AbstractAudioMessage(params): AbstractAudioMessage
Constructs a new AbstractAudioMessage
instance.
• params: MessageParamsAudio
The parameters for creating an audio message.
messages/lib/classes/AbstractAudioMessage.ts:20
audio: MessageAudioType;
The audio message content.
MessageParamsAudio.audio
messages/lib/classes/AbstractAudioMessage.ts:13
optional clientRef: string;
An optional client reference for the message.
MessageParamsAudio.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsAudio.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "audio";
messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
The recipient of the message.
MessageParamsAudio.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsAudio.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsAudio.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for file messages.
protected new AbstractFileMessage(params): AbstractFileMessage
Constructs a new AbstractFileMessage
instance.
• params: MessageParamsFile
The parameters for creating a file message.
messages/lib/classes/AbstractFileMessage.ts:19
optional clientRef: string;
An optional client reference for the message.
MessageParamsFile.clientRef
messages/lib/classes/AbstractMessage.ts:20
file: MessageFileType;
The file attachment content.
MessageParamsFile.file
messages/lib/classes/AbstractFileMessage.ts:12
from: string;
The sender of the message.
MessageParamsFile.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "file";
messages/lib/classes/AbstractFileMessage.ts:11
to: string;
The recipient of the message.
MessageParamsFile.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsFile.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsFile.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for image messages.
new AbstractImageMessage(params): AbstractImageMessage
Constructs a new AbstractImageMessage
instance.
• params: MessageParamsImage
The parameters for creating an image message.
messages/lib/classes/AbstractImageMessage.ts:20
optional clientRef: string;
An optional client reference for the message.
MessageParamsImage.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsImage.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
MessageParamsImage.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
to: string;
The recipient of the message.
MessageParamsImage.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsImage.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsImage.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for message objects.
AbstractAudioMessage
AbstractFileMessage
AbstractImageMessage
AbstractTextMessage
AbstractVcardMessage
AbstractVideoMessage
WhatsAppCustom
WhatsAppSticker
WhatsAppTemplate
WhatsAppReaction
RCSCustom
new AbstractMessage(params): AbstractMessage
Constructs a new AbstractMessage
instance.
• params: MessageParams
The parameters for creating a message.
messages/lib/classes/AbstractMessage.ts:43
optional clientRef: string;
An optional client reference for the message.
MessageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParams.from
messages/lib/classes/AbstractMessage.ts:15
to: string;
The recipient of the message.
MessageParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for text message objects.
new AbstractTextMessage(params): AbstractTextMessage
Constructs a new AbstractTextMessage
instance for text messages.
• params: MessageParamsText
The parameters for creating a text message.
messages/lib/classes/AbstractTextMessage.ts:26
optional clientRef: string;
An optional client reference for the message.
MessageParamsText.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsText.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
text: string;
The text content of the message.
MessageParamsText.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
MessageParamsText.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsText.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsText.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for vCard (contact card) message objects.
new AbstractVcardMessage(params): AbstractVcardMessage
Constructs a new AbstractVcardMessage
instance for vCard messages.
• params: MessageParamsVcard
The parameters for creating a vCard message.
messages/lib/classes/AbstractVcardMessage.ts:27
optional clientRef: string;
An optional client reference for the message.
MessageParamsVcard.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsVcard.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "vcard";
The type of message, which is 'vcard' for vCard messages.
messages/lib/classes/AbstractVcardMessage.ts:15
to: string;
The recipient of the message.
MessageParamsVcard.to
messages/lib/classes/AbstractMessage.ts:10
vcard: MessageVcardType;
The vCard (contact card) content of the message.
MessageParamsVcard.vcard
messages/lib/classes/AbstractVcardMessage.ts:20
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.
MessageParamsVcard.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsVcard.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
An abstract base class for video message objects.
new AbstractVideoMessage(params): AbstractVideoMessage
Constructs a new AbstractVideoMessage
instance for video messages.
• params: MessageParamsVideo
The parameters for creating a video message.
messages/lib/classes/AbstractVideoMessage.ts:27
optional clientRef: string;
An optional client reference for the message.
MessageParamsVideo.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsVideo.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
to: string;
The recipient of the message.
MessageParamsVideo.to
messages/lib/classes/AbstractMessage.ts:10
video: MessageVideoType;
The video content of the message.
MessageParamsVideo.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
MessageParamsVideo.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsVideo.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
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
Creates a new instance of the Client.
• credentials: AuthInterface
| AuthParams
The authentication credentials or an authentication instance.
• options?: ConfigParams
Optional configuration settings for the client.
server-client/dist/lib/client.d.ts:35
addAuthenticationToRequest(request): Promise<VetchOptions>
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
• request: VetchOptions
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>
Adds basic authentication headers to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
server-client/dist/lib/client.d.ts:71
protected addJWTToRequest(request): Promise<VetchOptions>
Adds a JWT to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
server-client/dist/lib/client.d.ts:64
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>
Adds API key and secret to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequest
server-client/dist/lib/client.d.ts:57
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>
Adds API key and secret to the request body.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequestBody
server-client/dist/lib/client.d.ts:50
getConfig(): ConfigParams
server-client/dist/lib/client.d.ts:36
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>
Parses the response based on its content type.
• T
The expected type of the parsed response data.
• request: VetchOptions
The request options.
• response: Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
server-client/dist/lib/client.d.ts:168
protected prepareBody(request): undefined | string
Prepares the body for the request based on the content type.
• request: VetchOptions
The request options.
undefined
| string
- The prepared request body as a string or undefined.
server-client/dist/lib/client.d.ts:158
protected prepareRequest(request): Promise<VetchOptions>
Prepares the request with necessary headers, authentication, and query parameters.
• request: VetchOptions
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
server-client/dist/lib/client.d.ts:151
send(message): Promise<MessageSuccess>
Sends a message using the Vonage API.
• message: AnyChannel
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>>
Sends a DELETE request to the specified URL.
• T
• url: string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
server-client/dist/lib/client.d.ts:78
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a POST request with form data to the specified URL.
• T
• url: string
The URL endpoint for the POST request.
• payload?: Record
<string
, undefined
| string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
server-client/dist/lib/client.d.ts:86
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>
Sends a GET request to the specified URL with optional query parameters.
• T
• url: string
The URL endpoint for the GET request.
• queryParams?
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.
server-client/dist/lib/client.d.ts:94
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a PATCH request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the PATCH request.
• payload?
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
server-client/dist/lib/client.d.ts:104
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a POST request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the POST request.
• payload?
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
server-client/dist/lib/client.d.ts:114
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a PUT request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the PUT request.
• payload?
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
server-client/dist/lib/client.d.ts:124
sendRequest<T>(request): Promise<VetchResponse<T>>
Sends a request adding necessary headers, handling authentication, and parsing the response.
• T
• request: VetchOptions
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
server-client/dist/lib/client.d.ts:144
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
• T
• method: POST
| PUT
| PATCH
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
• url: string
The URL endpoint for the request.
• payload?
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
server-client/dist/lib/client.d.ts:135
updateMessage(messageId, status): Promise<true>
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.
• messageId: string
The ID of the message to update.
• status: 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;
The authentication instance responsible for generating authentication headers and query parameters.
server-client/dist/lib/client.d.ts:24
protected optional authType: AuthenticationType;
The type of authentication used for the client's requests.
server-client/dist/lib/client.d.ts:20
protected config: ConfigParams;
Configuration settings for the client, including default hosts for various services and other request settings.
server-client/dist/lib/client.d.ts:28
static transformers: object;
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
• keys: string
[]
• obj: ObjectToTransform
snakeCaseObjectKeys: PartialTransformFunction;
server-client/dist/lib/client.d.ts:11
Represents an audio message for the Messenger channel.
new MessengerAudio(params): MessengerAudio
Sends an audio message to the Facebook Messenger channel.
• params: MessengerAudioParams
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}`);
messages/lib/classes/Messenger/MessengerAudio.ts:43
audio: MessageAudioType;
The audio message content.
MessengerAudioParams.audio
messages/lib/classes/AbstractAudioMessage.ts:13
channel: "messenger";
The channel for this message (always 'messenger').
messages/lib/classes/Messenger/MessengerAudio.ts:16
optional clientRef: string;
An optional client reference for the message.
MessengerAudioParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessengerAudioParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "audio";
messages/lib/classes/AbstractAudioMessage.ts:12
messenger: MessengerType;
The messenger information for this message.
MessengerAudioParams.messenger
messages/lib/classes/Messenger/MessengerAudio.ts:21
to: string;
The recipient of the message.
MessengerAudioParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessengerAudioParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessengerAudioParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a file message for the Messenger channel.
new MessengerFile(params): MessengerFile
Sends a file message to the Facebook Messenger channel.
• params: MessageParams
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}`);
messages/lib/classes/Messenger/MessengerFile.ts:45
channel: "messenger";
The channel for this message (always 'messenger').
messages/lib/classes/Messenger/MessengerFile.ts:16
optional clientRef: string;
An optional client reference for the message.
MessageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
file: MessageFileType;
The file attachment content.
MessengerFileParams.file
messages/lib/classes/AbstractFileMessage.ts:12
from: string;
The sender of the message.
MessageParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "file";
messages/lib/classes/AbstractFileMessage.ts:11
messenger: MessengerType;
The messenger information for this message.
MessengerFileParams.messenger
messages/lib/classes/Messenger/MessengerFile.ts:21
to: string;
The recipient of the message.
MessageParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
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
Send an image message using the Facebook Messenger channel.
• params: MessengerImageParams
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}`);
messages/lib/classes/Messenger/MessengerImage.ts:47
channel: "messenger";
The channel for sending the message, which is set to 'messenger'.
messages/lib/classes/Messenger/MessengerImage.ts:19
optional clientRef: string;
An optional client reference for the message.
MessengerImageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessengerImageParams.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
MessengerImageParams.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
messenger: MessengerType;
Additional Messenger-specific parameters for the image message.
MessengerImageParams.messenger
messages/lib/classes/Messenger/MessengerImage.ts:24
to: string;
The recipient of the message.
MessengerImageParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessengerImageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessengerImageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a text message for the Messenger channel.
new MessengerText(params): MessengerText
Sends a text message to the Facebook Messenger channel.
• params: MessengerTextParams
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}`);
messages/lib/classes/Messenger/MessengerText.ts:42
channel: "messenger";
The channel for this message (always 'messenger').
messages/lib/classes/Messenger/MessengerText.ts:16
optional clientRef: string;
An optional client reference for the message.
MessengerTextParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessengerTextParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
messenger: MessengerType;
The messenger information for this message.
MessengerTextParams.messenger
messages/lib/classes/Messenger/MessengerText.ts:21
text: string;
The text content of the message.
MessengerTextParams.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
MessengerTextParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessengerTextParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessengerTextParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a video message for the Messenger channel.
new MessengerVideo(params): MessengerVideo
Send a video message using the Facebook Messenger channel.
• params: MessengerVideoParams
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}`);
messages/lib/classes/Messenger/MessengerVideo.ts:44
channel: "messenger";
The channel for this message (always 'messenger').
messages/lib/classes/Messenger/MessengerVideo.ts:16
optional clientRef: string;
An optional client reference for the message.
MessengerVideoParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessengerVideoParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
messenger: MessengerType;
The messenger information for this message.
MessengerVideoParams.messenger
messages/lib/classes/Messenger/MessengerVideo.ts:21
to: string;
The recipient of the message.
MessengerVideoParams.to
messages/lib/classes/AbstractMessage.ts:10
video: MessageVideoType;
The video content of the message.
MessengerVideoParams.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
MessengerVideoParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessengerVideoParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an audio message for the MMS channel.
new MMSAudio(params): MMSAudio
Send an MMS audio message.
• params: MessageParamsAudio
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}`);
messages/lib/classes/MMS/MMSAudio.ts:36
audio: MessageAudioType;
The audio message content.
MessageParamsAudio.audio
messages/lib/classes/AbstractAudioMessage.ts:13
channel: "mms";
messages/lib/classes/MMS/MMSAudio.ts:13
optional clientRef: string;
An optional client reference for the message.
MessageParamsAudio.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsAudio.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "audio";
messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
The recipient of the message.
MessageParamsAudio.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsAudio.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsAudio.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an image message for the MMS channel.
new MMSImage(params): MMSImage
Send an MMS image message.
• params: MessageParamsImage
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}`);
messages/lib/classes/MMS/MMSImage.ts:36
channel: "mms";
messages/lib/classes/MMS/MMSImage.ts:13
optional clientRef: string;
An optional client reference for the message.
MessageParamsImage.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsImage.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
MessageParamsImage.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
to: string;
The recipient of the message.
MessageParamsImage.to
messages/lib/classes/AbstractMessage.ts:10
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.
MessageParamsImage.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsImage.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a vCard message for the MMS channel.
new MMSVcard(params): MMSVcard
Send an MMS vCard message.
• params: MessageParamsVcard
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}`);
messages/lib/classes/MMS/MMSVcard.ts:36
channel: "mms";
messages/lib/classes/MMS/MMSVcard.ts:13
optional clientRef: string;
An optional client reference for the message.
MessageParamsVcard.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsVcard.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "vcard";
The type of message, which is 'vcard' for vCard messages.
messages/lib/classes/AbstractVcardMessage.ts:15
to: string;
The recipient of the message.
MessageParamsVcard.to
messages/lib/classes/AbstractMessage.ts:10
vcard: MessageVcardType;
The vCard (contact card) content of the message.
MessageParamsVcard.vcard
messages/lib/classes/AbstractVcardMessage.ts:20
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.
MessageParamsVcard.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsVcard.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a video message for the MMS channel.
new MMSVideo(params): MMSVideo
Send an MMS video message.
• params: MessageParamsVideo
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}`);
messages/lib/classes/MMS/MMSVideo.ts:35
channel: "mms";
messages/lib/classes/MMS/MMSVideo.ts:13
optional clientRef: string;
An optional client reference for the message.
MessageParamsVideo.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
MessageParamsVideo.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
to: string;
The recipient of the message.
MessageParamsVideo.to
messages/lib/classes/AbstractMessage.ts:10
video: MessageVideoType;
The video content of the message.
MessageParamsVideo.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
MessageParamsVideo.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
MessageParamsVideo.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a custom message for RCS.
new RCSCustom(params): RCSCustom
Sends a custom message through RCS
• params: RCSCustomParams
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}`);
messages/lib/classes/RCS/RCSCustom.ts:54
channel: RCS = Channels.RCS;
The channel through which the message will be sent. Always rcs
RCSCustomParams.channel
messages/lib/classes/RCS/RCSCustom.ts:14
optional clientRef: string;
An optional client reference for the message.
RCSCustomParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
custom: Record<string, unknown>;
A custom payload. The schema of a custom object can vary widely.
RCSCustomParams.custom
messages/lib/classes/RCS/RCSCustom.ts:24
from: string;
The sender of the message.
RCSCustomParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: string = 'custom';
The type of message. For a custom message, this will always be custom
.
messages/lib/classes/RCS/RCSCustom.ts:19
to: string;
The recipient of the message.
RCSCustomParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
RCSCustomParams.ttl
messages/lib/classes/RCS/RCSCustom.ts:32
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.
RCSCustomParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
RCSCustomParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a file message for the RCS channel.
new RCSFile(params): RCSFile
Sends a file message to the RCS channel.
• params: 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}`);
messages/lib/classes/RCS/RCSFile.ts:48
channel: RCS = Channels.RCS;
The channel for this message (always 'rcs').
RCSFileParams.channel
messages/lib/classes/RCS/RCSFile.ts:17
optional clientRef: string;
An optional client reference for the message.
RCSFileParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
file: MessageFileType;
The file attachment content.
RCSFileParams.file
messages/lib/classes/AbstractFileMessage.ts:12
from: string;
The sender of the message.
RCSFileParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "file";
messages/lib/classes/AbstractFileMessage.ts:11
to: string;
The recipient of the message.
RCSFileParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
RCSFileParams.ttl
messages/lib/classes/RCS/RCSFile.ts:25
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.
RCSFileParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
RCSFileParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an image message for the RCS channel.
new RCSImage(params): RCSImage
Send an RCS image message.
• params: RCSImageParams
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}`);
messages/lib/classes/RCS/RCSImage.ts:44
channel: RCS = Channels.RCS;
The channel through which the message will be sent. Always rcs
RCSImageParams.channel
messages/lib/classes/RCS/RCSImage.ts:14
optional clientRef: string;
An optional client reference for the message.
RCSImageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
RCSImageParams.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
RCSImageParams.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
to: string;
The recipient of the message.
RCSImageParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
RCSImageParams.ttl
messages/lib/classes/RCS/RCSImage.ts:22
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.
RCSImageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
RCSImageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a text message for the RCS channel.
new RCSText(params): RCSText
Sends a text message through the RCS channel.
• params: RCSTextParams
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}`);
messages/lib/classes/RCS/RCSText.ts:43
channel: RCS = Channels.RCS;
The channel for this message (always 'rcs').
RCSTextParams.channel
messages/lib/classes/RCS/RCSText.ts:14
optional clientRef: string;
An optional client reference for the message.
RCSTextParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
RCSTextParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
text: string;
The text content of the message.
RCSTextParams.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
RCSTextParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
RCSTextParams.ttl
messages/lib/classes/RCS/RCSText.ts:22
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.
RCSTextParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
RCSTextParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an video message for the RCS channel.
new RCSVideo(params): RCSVideo
Send an RCS video message.
• params: RCSVideoParams
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}`);
messages/lib/classes/RCS/RCSVideo.ts:45
channel: RCS;
The channel through which the message will be sent. Always rcs
RCSVideoParams.channel
messages/lib/classes/RCS/RCSVideo.ts:14
optional clientRef: string;
An optional client reference for the message.
RCSVideoParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
RCSVideoParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
to: string;
The recipient of the message.
RCSVideoParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
RCSVideoParams.ttl
messages/lib/classes/RCS/RCSVideo.ts:22
video: MessageVideoType;
The video content of the message.
RCSVideoParams.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
RCSVideoParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
RCSVideoParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Send a text message using the SMS channel.
new SMS(
params,
to?,
from?,
clientRef?): SMS
Send an SMS message
• params: string
| SMSParams
The message parameters or text message.
• to?: string
The recipient's phone number.
• from?: string
The sender's phone number.
• clientRef?: 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}`);
messages/lib/classes/SMS/SMS.ts:58
channel: "sms";
messages/lib/classes/SMS/SMS.ts:13
optional clientRef: string;
An optional client reference for the message.
SMSParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
SMSParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
optional sms: SMSExtraParams;
SMSParams.sms
messages/lib/classes/SMS/SMS.ts:15
text: string;
The text content of the message.
SMSParams.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
SMSParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
SMSParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
SMSParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a file message for the Viber Service channel.
new ViberFile(params): ViberFile
Send a file message using the Viber Service channel.
• params: ViberFileParams
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}`);
messages/lib/classes/Viber/ViberFile.ts:38
channel: "viber_service";
messages/lib/classes/Viber/ViberFile.ts:10
optional clientRef: string;
An optional client reference for the message.
ViberFileParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
file: MessageFileType;
The file attachment content.
ViberFileParams.file
messages/lib/classes/AbstractFileMessage.ts:12
from: string;
The sender of the message.
ViberFileParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "file";
messages/lib/classes/AbstractFileMessage.ts:11
to: string;
The recipient of the message.
ViberFileParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
ViberFileParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
ViberFileParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an image message for the Viber Service channel.
new ViberImage(params): ViberImage
Send an image message using the Viber Service channel.
• params: ViberImageParams
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}`);
messages/lib/classes/Viber/ViberImage.ts:43
channel: "viber_service";
messages/lib/classes/Viber/ViberImage.ts:14
optional clientRef: string;
An optional client reference for the message.
ViberImageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
ViberImageParams.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
ViberImageParams.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
to: string;
The recipient of the message.
ViberImageParams.to
messages/lib/classes/AbstractMessage.ts:10
viberService: ViberActionParams;
The Viber action parameters for sending the image.
ViberImageParams.viberService
messages/lib/classes/Viber/ViberImage.ts:15
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.
ViberImageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
ViberImageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a text message for the Viber Service channel.
new ViberText(params): ViberText
Send a text message using the Viber Service channel.
• params: ViberTextParams
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}`);
messages/lib/classes/Viber/ViberText.ts:42
channel: "viber_service";
messages/lib/classes/Viber/ViberText.ts:14
optional clientRef: string;
An optional client reference for the message.
ViberTextParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
ViberTextParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
text: string;
The text content of the message.
ViberTextParams.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
ViberTextParams.to
messages/lib/classes/AbstractMessage.ts:10
viberService: ViberActionParams;
The Viber service and action parameters for the message.
ViberTextParams.viberService
messages/lib/classes/Viber/ViberText.ts:15
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.
ViberTextParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
ViberTextParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a video message for the Viber Service channel.
new ViberVideo(params): ViberVideo
Send a video message using the Viber Service channel.
• params: ViberVideoParams
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}`);
messages/lib/classes/Viber/ViberVideo.ts:43
channel: "viber_service";
messages/lib/classes/Viber/ViberVideo.ts:13
optional clientRef: string;
An optional client reference for the message.
ViberVideoParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
from: string;
The sender of the message.
ViberVideoParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
to: string;
The recipient of the message.
ViberVideoParams.to
messages/lib/classes/AbstractMessage.ts:10
viberService: object & object & ViberService;
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
messages/lib/classes/Viber/ViberVideo.ts:14
video: MessageVideoType;
The video content of the message.
ViberVideoParams.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
ViberVideoParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
ViberVideoParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an audio message for WhatsApp.
new WhatsAppAudio(params): WhatsAppAudio
Sends an audio message to a WhatsApp user.
• params: WhatsAppAudioParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppAudio.ts:37
audio: MessageAudioType;
The audio message content.
WhatsAppAudioParams.audio
messages/lib/classes/AbstractAudioMessage.ts:13
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppAudio.ts:13
optional clientRef: string;
An optional client reference for the message.
WhatsAppAudioParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppAudioParams.context
messages/lib/classes/WhatsApp/WhatsAppAudio.ts:15
from: string;
The sender of the message.
WhatsAppAudioParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "audio";
messages/lib/classes/AbstractAudioMessage.ts:12
to: string;
The recipient of the message.
WhatsAppAudioParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppAudioParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppAudioParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a custom message for WhatsApp.
new WhatsAppCustom(params): WhatsAppCustom
Sends a custom message to a WhatsApp user.
• params: WhatsAppCustomParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppCustom.ts:47
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppCustom.ts:17
optional clientRef: string;
An optional client reference for the message.
WhatsAppCustomParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppCustomParams.context
messages/lib/classes/WhatsApp/WhatsAppCustom.ts:21
custom: WhatsAppCustomType;
The custom WhatsApp message type.
WhatsAppCustomParams.custom
messages/lib/classes/WhatsApp/WhatsAppCustom.ts:19
from: string;
The sender of the message.
WhatsAppCustomParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "custom";
messages/lib/classes/WhatsApp/WhatsAppCustom.ts:18
to: string;
The recipient of the message.
WhatsAppCustomParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppCustomParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppCustomParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a file message for WhatsApp.
new WhatsAppFile(params): WhatsAppFile
Send a WhatsApp file message.
• params: WhatsAppFileParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppFile.ts:38
channel: Channels = Channels.WHATSAPP;
messages/lib/classes/WhatsApp/WhatsAppFile.ts:14
optional clientRef: string;
An optional client reference for the message.
WhatsAppFileParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppFileParams.context
messages/lib/classes/WhatsApp/WhatsAppFile.ts:16
file: MessageFileType;
The file attachment content.
WhatsAppFileParams.file
messages/lib/classes/AbstractFileMessage.ts:12
from: string;
The sender of the message.
WhatsAppFileParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "file";
messages/lib/classes/AbstractFileMessage.ts:11
to: string;
The recipient of the message.
WhatsAppFileParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppFileParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppFileParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents an image message for WhatsApp.
new WhatsAppImage(params): WhatsAppImage
Sends an image message to a WhatsApp user.
• params: WhatsAppImageParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppImage.ts:37
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppImage.ts:13
optional clientRef: string;
An optional client reference for the message.
WhatsAppImageParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppImageParams.context
messages/lib/classes/WhatsApp/WhatsAppImage.ts:15
from: string;
The sender of the message.
WhatsAppImageParams.from
messages/lib/classes/AbstractMessage.ts:15
image: MessageImageType;
The image attachment content.
WhatsAppImageParams.image
messages/lib/classes/AbstractImageMessage.ts:13
messageType: "image";
messages/lib/classes/AbstractImageMessage.ts:12
to: string;
The recipient of the message.
WhatsAppImageParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppImageParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppImageParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a reaction message for WhatsApp.
new WhatsAppReaction(params): WhatsAppReaction
Sends a reaction message to a WhatsApp user.
• params: WhatsAppReactionParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppReaction.ts:62
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppReaction.ts:17
optional clientRef: string;
An optional client reference for the message.
WhatsAppReactionParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppReactionParams.context
messages/lib/classes/WhatsApp/WhatsAppReaction.ts:21
from: string;
The sender of the message.
WhatsAppReactionParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "reaction";
messages/lib/classes/WhatsApp/WhatsAppReaction.ts:18
reaction: WhatsAppReactionType;
WhatsAppReactionParams.reaction
messages/lib/classes/WhatsApp/WhatsAppReaction.ts:19
to: string;
The recipient of the message.
WhatsAppReactionParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppReactionParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppReactionParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a sticker message for WhatsApp.
new WhatsAppSticker(params): WhatsAppSticker
Send a sticker message to a WhatsApp user.
• params: WhatsAppStickerParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppSticker.ts:62
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppSticker.ts:18
optional clientRef: string;
An optional client reference for the message.
WhatsAppStickerParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppStickerParams.context
messages/lib/classes/WhatsApp/WhatsAppSticker.ts:22
from: string;
The sender of the message.
WhatsAppStickerParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "sticker";
messages/lib/classes/WhatsApp/WhatsAppSticker.ts:19
sticker: WhatsAppStickerIdType | WhatsAppStickerUrlType;
The sticker to be sent, which can be either a sticker ID or a sticker URL.
WhatsAppStickerParams.sticker
messages/lib/classes/WhatsApp/WhatsAppSticker.ts:20
to: string;
The recipient of the message.
WhatsAppStickerParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppStickerParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppStickerParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a template message for WhatsApp.
new WhatsAppTemplate(params): WhatsAppTemplate
Send a template message to a WhatsApp user.
• params: WhatsAppTemplateParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:54
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:18
optional clientRef: string;
An optional client reference for the message.
WhatsAppTemplateParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppTemplateParams.context
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:23
from: string;
The sender of the message.
WhatsAppTemplateParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "template";
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:19
template: WhatsAppTemplateType;
The WhatsApp template to be sent.
WhatsAppTemplateParams.template
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:21
to: string;
The recipient of the message.
WhatsAppTemplateParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppTemplateParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppTemplateParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
whatsapp: WhatsAppPolicyType;
WhatsApp policy type for the template message.
WhatsAppTemplateParams.whatsapp
messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:20
Represents a text message for WhatsApp.
new WhatsAppText(params): WhatsAppText
Send a WhatsApp text message.
• params: WhatsAppTextParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppText.ts:34
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppText.ts:13
optional clientRef: string;
An optional client reference for the message.
WhatsAppTextParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppTextParams.context
messages/lib/classes/WhatsApp/WhatsAppText.ts:15
from: string;
The sender of the message.
WhatsAppTextParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "text";
The type of message, which is 'text' for text messages.
messages/lib/classes/AbstractTextMessage.ts:14
text: string;
The text content of the message.
WhatsAppTextParams.text
messages/lib/classes/AbstractTextMessage.ts:19
to: string;
The recipient of the message.
WhatsAppTextParams.to
messages/lib/classes/AbstractMessage.ts:10
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.
WhatsAppTextParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppTextParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
Represents a video message for WhatsApp.
new WhatsAppVideo(params): WhatsAppVideo
Sends a video message to a WhatsApp user.
• params: WhatsAppVideoParams
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}`);
messages/lib/classes/WhatsApp/WhatsAppVideo.ts:38
channel: "whatsapp";
messages/lib/classes/WhatsApp/WhatsAppVideo.ts:13
optional clientRef: string;
An optional client reference for the message.
WhatsAppVideoParams.clientRef
messages/lib/classes/AbstractMessage.ts:20
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
WhatsAppVideoParams.context
messages/lib/classes/WhatsApp/WhatsAppVideo.ts:15
from: string;
The sender of the message.
WhatsAppVideoParams.from
messages/lib/classes/AbstractMessage.ts:15
messageType: "video";
The type of message, which is 'video' for video messages.
messages/lib/classes/AbstractVideoMessage.ts:15
to: string;
The recipient of the message.
WhatsAppVideoParams.to
messages/lib/classes/AbstractMessage.ts:10
video: MessageVideoType;
The video content of the message.
WhatsAppVideoParams.video
messages/lib/classes/AbstractVideoMessage.ts:20
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.
WhatsAppVideoParams.webhookUrl
messages/lib/classes/AbstractMessage.ts:27
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.
WhatsAppVideoParams.webhookVersion
messages/lib/classes/AbstractMessage.ts:36
type AnyChannel:
| AnyMessengerChannel
| AnyMMSChannel
| AnyViberChannel
| AnyWhatsAppChannel
| SMSChannel
| AnyRCSChannel;
Represents a union type that can be any of the specific channel message parameters or configurations, including Messenger, MMS, Viber, WhatsApp, or SMS.
messages/lib/types/Channels/index.ts:19
type AnyMessengerChannel: object & AnyMessengerParams;
Represents a union type that includes the 'channel' property set to 'messenger' along with any of the Messenger-specific message parameters or MessengerType.
channel: Channels.MESSENGER;
The channel through which the message will be sent, which is 'messenger' for Messenger.
messages/lib/types/Channels/Messenger/index.ts:38
type AnyMMSChannel: object & AnyMMSParams;
Represents a union type that includes the 'channel' property set to 'mms' along with any of the MMS-specific message parameters.
channel: Channels.MMS;
The channel through which the message will be sent, which is 'mms' for MMS.
messages/lib/types/Channels/MMS/index.ts:30
type AnyRCSChannel:
| RCSCustomParams
| RCSFileParams
| RCSImageParams
| RCSTextParams
| RCSVideoParams;
messages/lib/types/Channels/RCS/index.ts:13
type AnyViberChannel: object & AnyViberParams;
Represents a union type that includes the 'channel' property set to 'viber' along with any of the Viber-specific message parameters or configurations.
channel: Channels.VIBER;
The channel through which the message will be sent, which is 'viber' for Viber.
messages/lib/types/Channels/Viber/index.ts:39
type AnyWhatsAppChannel: object & AnyWhatsAppParams;
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: Channels.WHATSAPP;
The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.
messages/lib/types/Channels/WhatsApp/index.ts:56
type MessageAudioType: object;
Represents an audio message type.
url: string;
The URL of the audio attachment.
messages/lib/types/MessageAudioType.ts:4
type MessageFileType: object;
Represents a file message type.
url: string;
The URL of the file attachment.
messages/lib/types/MessageFileType.ts:4
type MessageImageType: object;
Represents an image message type.
url: string;
The URL of the image attachment.
messages/lib/types/MessageImageType.ts:4
type MessageParams: object;
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.
messages/lib/types/MessageParams.ts:4
type MessageParamsAudio: object & MessageParams;
Represents the parameters for a message with audio.
audio: MessageAudioType;
The audio message content.
messages/lib/types/MessageParamsAudio.ts:7
type MessageParamsFile: object & MessageParams;
Represents the parameters for a message with a file attachment.
file: MessageFileType;
The file attachment content.
messages/lib/types/MessageParamsFile.ts:7
type MessageParamsImage: object & MessageParams;
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
messages/lib/types/MessageParamsImage.ts:7
type MessageParamsText: object & MessageParams;
Represents the parameters for a text message.
text: string;
The text content of the message.
messages/lib/types/MessageParamsText.ts:6
type MessageParamsVcard: MessageVcardParams & MessageParams;
Represents the parameters for a message containing a vCard.
messages/lib/types/MessageParamsVcard.ts:7
type MessageParamsVideo: object & MessageParams;
Represents the parameters for a message containing a video.
video: MessageVideoType;
The video information to be included in the message.
messages/lib/types/MessageParamsVideo.ts:7
type MessageSuccess: object;
messageUUID: string;
messages/lib/types/MessageSuccess.ts:1
type MessageSuccessResponse: object;
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
messages/lib/types/Responses/MessageSuccessResponse.ts:12
type MessageVcardParams: object;
Represents a vCard message type.
vcard: MessageVcardType;
messages/lib/types/MessageVcardType.ts:16
type MessageVcardType: object;
optional caption: string;
Additional text to accompany the vCard.
url: string;
The URL of the vCard attachment.
messages/lib/types/MessageVcardType.ts:1
type MessageVideoType: object;
Represents a video message type.
url: string;
The URL of the video attachment.
messages/lib/types/MessageVideoType.ts:4
type RCSCustomParams: MessageParams & object;
Represents the parameters for sending a custom message using RCS.
optional channel: Channels.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.
messages/lib/types/Channels/RCS/RCSCustomParams.ts:7
type RCSFileParams: MessageParamsFile & object;
Represents the parameters for sending a file message using RCS.
optional channel: Channels.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.
messages/lib/types/Channels/RCS/RCSFileParams.ts:7
type RCSImageParams: MessageParamsImage & object;
Represents the parameters for sending an image message using RCS.
optional channel: Channels.RCS;
The channel to send to. You must provide rcs
in this field.
messages/lib/types/Channels/RCS/RCSImageParams.ts:7
type RCSTextParams: MessageParams & object;
Represents the parameters for sending a text message using RCS.
optional channel: Channels.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.
messages/lib/types/Channels/RCS/RCSTextParams.ts:7
type RCSVideoParams: MessageParams & object;
Represents the parameters for sending a video message using RCS.
optional channel: Channels.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;
messages/lib/types/Channels/RCS/RCSVideoParams.ts:8
type SendMessageParams:
| AnyMessengerParams
| AnyViberParams
| AnyWhatsAppParams
| AnyMMSParams
| SMSParams;
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.
messages/lib/types/SendMessageParams.ts:15
type SMSChannel: object & SMSParams;
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: Channels.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.
messages/lib/types/Channels/SMSParams.ts:53
type SMSExtraParams: object;
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.
messages/lib/types/Channels/SMSParams.ts:18
type UpdateMessageRequest: object;
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.
messages/lib/types/Requests/UpdateMessageRequest.ts:6
type WhatsAppContext: object;
messageUUID: string;
The UUID of the message being replied to/quoted.
messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:3
type WhatsAppCustomType: object;
Represents a custom WhatsApp message type with arbitrary properties.
[key
: string
]: unknown
messages/lib/types/Channels/WhatsApp/WhatsAppCustomType.ts:6
type WhatsAppFileParams: object & WhatsAppParams;
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.
messages/lib/types/Channels/WhatsApp/WhatsAppFileParams.ts:9
type WhatsAppParams: object & MessageParams;
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
messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:10
type WhatsAppPolicyType: object;
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'.
messages/lib/types/Channels/WhatsApp/WhatsAppPolicyType.ts:8
type WhatsAppReactionRequest: object;
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.
messages/lib/types/Requests/WhatsAppReactionRequest.ts:1
type WhatsAppReactionType: object;
action: "react" | "unreact";
The action taken.
optional emoji: string;
The emoji used as a reaction.
messages/lib/types/Channels/WhatsApp/WhatAppReactionType.ts:1
type WhatsAppStickerIdType: object;
Represents a WhatsApp sticker ID type.
id: string;
The ID of the WhatsApp sticker.
messages/lib/types/Channels/WhatsApp/WhatsAppStickerIdType.ts:6
type WhatsAppStickerUrlType: object;
Represents a WhatsApp sticker by URL.
url: string;
The URL of the WhatsApp sticker.
messages/lib/types/Channels/WhatsApp/WhatsAppStickerUrlType.ts:6
type WhatsAppTemplateType: object;
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.
messages/lib/types/Channels/WhatsApp/WhatsAppTemplateType.ts:6
type AnyMessengerParams:
| MessengerAudioParams
| MessengerFileParams
| MessengerImageParams
| MessengerParams
| MessengerTextParams
| MessengerType
| MessengerVideoParams;
Represents a union type that can be any of the Messenger-specific message parameters or MessengerType.
messages/lib/types/Channels/Messenger/index.ts:25
type AnyMMSParams: MMSAudioParams | MMSImageParams | MMSVcardParams | MMSVideoParams;
Represents a union type that can be any of the MMS-specific message parameters.
messages/lib/types/Channels/MMS/index.ts:18
type AnyViberParams:
| ViberAction
| ViberActionParams
| ViberFileParams
| ViberImageParams
| ViberService
| ViberTextParams
| ViberVideoParams;
Represents a union type that can be any of the Viber-specific message parameters or configurations.
messages/lib/types/Channels/Viber/index.ts:24
type AnyWhatsAppParams:
| WhatsAppAudioParams
| WhatsAppCustomParams
| WhatsAppFileParams
| WhatsAppImageParams
| WhatsAppStickerIdType
| WhatsAppStickerParams
| WhatsAppTemplateParams
| WhatsAppTextParams
| WhatsAppReactionParams
| WhatsAppVideoParams;
Represents a union type that can be any of the WhatsApp-specific message parameters or configurations.
messages/lib/types/Channels/WhatsApp/index.ts:37
type MessengerAudioParams: MessengerParams & MessageParamsAudio;
Represents parameters for sending an audio message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsAudio.
messages/lib/types/Channels/Messenger/MessengerAudioParams.ts:11
type MessengerFileParams: object & MessengerParams;
Represents parameters for sending a file message via the Messenger platform.
file: MessageFileType;
messages/lib/types/Channels/Messenger/MessengerFileParams.ts:10
type MessengerImageParams: MessengerParams & MessageParamsImage;
Represents parameters for sending an image message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsImage.
messages/lib/types/Channels/Messenger/MessengerImageParams.ts:11
type MessengerParams: object;
Represents parameters specific to the Messenger platform.
messenger: MessengerType;
messages/lib/types/Channels/Messenger/MessengerParams.ts:9
type MessengerTextParams: MessengerParams & MessageParamsText;
Represents parameters for sending a text message via the Messenger platform.
messages/lib/types/Channels/Messenger/MessengerTextParams.ts:10
type MessengerType: object;
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.
messages/lib/types/Channels/Messenger/MessengerType.ts:9
type MessengerVideoParams: MessengerParams & MessageParamsVideo;
Represents parameters for sending a video message via the Messenger platform.
messages/lib/types/Channels/Messenger/MessengerVideoParams.ts:10
type MMSAudioParams: MessageParams & MessageAudioType;
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.
messages/lib/types/Channels/MMS/MMSAudioParams.ts:13
type MMSImageParams: MessageParams & MessageImageType;
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.
messages/lib/types/Channels/MMS/MMSImageParams.ts:13
type MMSVcardParams: object & MessageParams & MessageVcardType;
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
messages/lib/types/Channels/MMS/MMSVcardParams.ts:13
type MMSVideoParams: MessageParams & MessageVideoType;
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.
messages/lib/types/Channels/MMS/MMSVideoParams.ts:13
type SMSParams: object & MessageParamsText;
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.
messages/lib/types/Channels/SMSParams.ts:16
type ViberAction: object;
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.
messages/lib/types/Channels/Viber/ViberAction.ts:7
type ViberActionParams: object & ViberService;
Represents parameters for a Viber action message.
action: ViberAction;
The action associated with the Viber message.
messages/lib/types/Channels/Viber/ViberActionParams.ts:9
type ViberFileParams: object & MessageParams;
Represents parameters for sending a file via Viber.
file: object & MessageFileType;
optional name: string;
The name and extension of the file.
messages/lib/types/Channels/Viber/ViberFileParams.ts:10
type ViberImageParams: object & MessageParamsImage;
Represents parameters for sending an image via Viber.
viberService: ViberActionParams;
The Viber action parameters for sending the image.
messages/lib/types/Channels/Viber/ViberImageParams.ts:10
type ViberService: object;
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.
messages/lib/types/Channels/Viber/ViberService.ts:10
type ViberTextParams: object & MessageParamsText;
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.
messages/lib/types/Channels/Viber/ViberTextParams.ts:10
type ViberVideoParams: object & MessageParamsVideo;
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.
messages/lib/types/Channels/Viber/ViberVideoParams.ts:10
type WhatsAppAudioParams: object & WhatsAppParams & MessageParamsAudio;
Represents parameters for sending an audio message via WhatsApp.
optional ttl: number;
The amount of time in seconds the message will live for
messages/lib/types/Channels/WhatsApp/WhatsAppAudioParams.ts:10
type WhatsAppCustomParams: object & WhatsAppParams;
Represents parameters for sending a custom WhatsApp message with a file attachment.
custom: WhatsAppCustomType;
The custom WhatsApp message type.
messages/lib/types/Channels/WhatsApp/WhatsAppCustomParams.ts:10
type WhatsAppImageParams: WhatsAppParams & MessageParamsImage;
Represents a WhatsApp image message type.
messages/lib/types/Channels/WhatsApp/WhatsAppImageParams.ts:10
type WhatsAppReactionParams: object & WhatsAppParams;
Represents WhatsApp reaction message parameters.
reaction: WhatsAppReactionType;
messages/lib/types/Channels/WhatsApp/WhatsAppReactionParams.ts:9
type WhatsAppStickerParams: object & WhatsAppParams;
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.
messages/lib/types/Channels/WhatsApp/WhatsAppStickerParams.ts:11
type WhatsAppTemplateParams: object & WhatsAppParams;
Represents WhatsApp template message parameters.
template: WhatsAppTemplateType;
The WhatsApp template to be sent.
whatsapp: WhatsAppPolicyType;
WhatsApp policy type for the template message.
messages/lib/types/Channels/WhatsApp/WhatsAppTemplateParams.ts:11
type WhatsAppTextParams: WhatsAppParams & MessageParamsText;
Represents a text message type for WhatsApp.
messages/lib/types/Channels/WhatsApp/WhatsAppTextParams.ts:10
type WhatsAppVideoParams: object & WhatsAppParams & MessageParamsVideo;
Represents a video message type for WhatsApp.
optional ttl: number;
The amount of time in seconds the message will live for
messages/lib/types/Channels/WhatsApp/WhatsAppVideoParams.ts:10
type MessengerAudioRequest: object;
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.
messages/lib/types/Requests/MessengerAudioRequest.ts:13
type MessengerFileRequest: object;
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.
messages/lib/types/Requests/MessengerFileRequest.ts:13
type MessengerImageRequest: object;
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.
messages/lib/types/Requests/MessengerImageRequest.ts:13
type MessengerTextRequest: object;
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
.
messages/lib/types/Requests/MessengerTextRequest.ts:12
type MessengerVideoRequest: object;
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
.
messages/lib/types/Requests/MessengerVideoRequest.ts:13
type MMSAudioRequest: object;
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
.
messages/lib/types/Requests/MMSAudioRequest.ts:11
type MMSImageRequest: object;
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
.
messages/lib/types/Requests/MMSImageRequest.ts:11
type MMSVcardRequest: object;
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
.
messages/lib/types/Requests/MMSVcardRequest.ts:11
type MMSVideoRequest: object;
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
.
messages/lib/types/Requests/MMSVideoRequest.ts:11
type SMSMessageRequest: object;
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
.
messages/lib/types/Requests/SMSMessageRequest.ts:11
type ViberFileRequest: object;
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
.
messages/lib/types/Requests/ViberFileRequest.ts:13
type ViberImageRequest: object;
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
.
messages/lib/types/Requests/ViberImageRequest.ts:13
type ViberTextRequest: object;
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
.
messages/lib/types/Requests/ViberTextRequest.ts:13
type ViberVideoRequest: object;
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
.
messages/lib/types/Requests/ViberVideoRequest.ts:13
type WhatsAppAudioRequest: object;
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
.
messages/lib/types/Requests/WhatsAppAudioRequest.ts:11
type WhatsAppCustomRequest: object;
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
.
messages/lib/types/Requests/WhatsAppCustomRequest.ts:11
type WhatsAppFileRequest: object;
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
.
messages/lib/types/Requests/WhatsAppFileRequest.ts:11
type WhatsAppImageRequest: object;
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
.
messages/lib/types/Requests/WhatsAppImageRequest.ts:11
type WhatsAppStickerIdRequest: object;
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
.
messages/lib/types/Requests/WhatsAppStickerIdRequest.ts:11
type WhatsAppStickerUrlRequest: object;
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
.
messages/lib/types/Requests/WhatsAppStickerUrlRequest.ts:11
type WhatsAppTemplateRequest: object;
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
.
messages/lib/types/Requests/WhatsAppTemplateRequest.ts:13
type WhatsAppTextRequest: object;
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
.
messages/lib/types/Requests/WhatsAppTextRequest.ts:11
type WhatsAppVideoRequest: object;
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
.