Skip to content

Vonage Messages

github-actions edited this page Dec 10, 2024 · 66 revisions

Vonage Messages


Documentation / Vonage Messages

Vonage Messages

Other

Channels

Enumeration Members

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

MessengerCategory

Enum representing categories for Facebook Messenger messages.

Enumeration Members

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

MessengerTags

Enum representing message tags for Facebook Messenger messages.

These tags are used to categorize the purpose and relevance of the message.

Enumeration Members

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

UpdateMessageStatus

Enumeration Members

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

ViberCategory

Enum representing message categories for Viber messages.

These categories are used to classify the type and purpose of Viber messages.

Enumeration Members

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

WhatsAppLanguageCode

Enum representing language codes for WhatsApp messages.

These language codes are used to specify the language of WhatsApp messages.

Enumeration Members

Enumeration Member Value Defined in
AFRIKAANS "af" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:9
ALBANIAN "sq" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:10
ARABIC "ar" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:11
AZERBAIJANI "az" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:12
BENGALI "bn" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:13
BULGARIAN "bg" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:14
CATALAN "ca" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:15
CHINESE_CHN "zh_CN" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:16
CHINESE_HKG "zh_HK" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:17
CHINESE_TAI "zh_TW" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:18
CROATIAN "hr" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:19
CZECH "cs" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:20
DANISH "da" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:21
DUTCH "nl" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:22
ENGLISH "en" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:23
ENGLISH_UK "en_GB" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:24
ENGLISH_US "en_US" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:25
ESTONIAN "et" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:26
FILIPINO "fil" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:27
FINNISH "fi" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:28
FRENCH "fr" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:29
GEORGIAN "ka" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:30
GERMAN "de" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:31
GREEK "el" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:32
GUJARATI "gu" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:33
HAUSA "ha" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:34
HEBREW "he" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:35
HINDI "hi" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:36
HUNGARIAN "hu" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:37
INDONESIAN "id" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:38
IRISH "ga" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:39
ITALIAN "it" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:40
JAPANESE "ja" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:41
KANNADA "kn" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:42
KAZAKH "kk" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:43
KINYARWANDA "rw_RW" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:44
KOREAN "ko" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:45
KYRGYZ_KYRGYZSTAN "ky_KG" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:46
LAO "lo" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:47
LATVIAN "lv" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:48
LITHUANIAN "lt" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:49
MACEDONIAN "mk" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:50
MALAY "ms" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:51
MALAYALAM "ml" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:52
MARATHI "mr" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:53
NORWEGIAN "nb" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:54
PERSIAN "fa" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:55
POLISH "pl" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:56
PORTUGUESE_BR "pt_BR" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:57
PORTUGUESE_POR "pt_PT" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:58
PUNJABI "pa" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:59
ROMANIAN "ro" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:60
RUSSIAN "ru" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:61
SERBIAN "sr" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:62
SLOVAK "sk" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:63
SLOVENIAN "sl" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:64
SPANISH "es" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:65
SPANISH_ARG "es_AR" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:66
SPANISH_MEX "es_MX" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:68
SPANISH_SPA "es_ES" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:67
SWAHILI "sw" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:69
SWEDISH "sv" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:70
TAMIL "ta" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:71
TELUGU "te" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:72
THAI "th" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:73
TURKISH "tr" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:74
UKRAINIAN "uk" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:75
URDU "ur" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:76
UZBEK "uz" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:77
VIETNAMESE "vi" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:78
ZULU "zu" messages/lib/enums/WhatsApp/WhatsAppLanguageCodes.ts:79

abstract AbstractAudioMessage

An abstract base class for audio messages.

Extends

Extended by

Implements

Constructors

new AbstractAudioMessage()
new AbstractAudioMessage(params): AbstractAudioMessage

Constructs a new AbstractAudioMessage instance.

Parameters
params

MessageParamsAudio

The parameters for creating an audio message.

Returns

AbstractAudioMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:20

Properties

audio
audio: MessageAudioType;

The audio message content.

Implementation of

MessageParamsAudio.audio

Defined in

messages/lib/classes/AbstractAudioMessage.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsAudio.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsAudio.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "audio";
Defined in

messages/lib/classes/AbstractAudioMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

MessageParamsAudio.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsAudio.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsAudio.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractFileMessage

An abstract base class for file messages.

Extends

Extended by

Implements

Constructors

new AbstractFileMessage()
protected new AbstractFileMessage(params): AbstractFileMessage

Constructs a new AbstractFileMessage instance.

Parameters
params

MessageParamsFile

The parameters for creating a file message.

Returns

AbstractFileMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:19

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsFile.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

file
file: MessageFileType;

The file attachment content.

Implementation of

MessageParamsFile.file

Defined in

messages/lib/classes/AbstractFileMessage.ts:12

from
from: string;

The sender of the message.

Implementation of

MessageParamsFile.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "file";
Defined in

messages/lib/classes/AbstractFileMessage.ts:11

to
to: string;

The recipient of the message.

Implementation of

MessageParamsFile.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsFile.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsFile.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractImageMessage

An abstract base class for image messages.

Extends

Extended by

Implements

Constructors

new AbstractImageMessage()
new AbstractImageMessage(params): AbstractImageMessage

Constructs a new AbstractImageMessage instance.

Parameters
params

MessageParamsImage

The parameters for creating an image message.

Returns

AbstractImageMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:20

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsImage.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsImage.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

MessageParamsImage.image

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Defined in

messages/lib/classes/AbstractImageMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

MessageParamsImage.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsImage.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsImage.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractMessage

An abstract base class for message objects.

Extended by

Implements

Constructors

new AbstractMessage()
new AbstractMessage(params): AbstractMessage

Constructs a new AbstractMessage instance.

Parameters
params

MessageParams

The parameters for creating a message.

Returns

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:43

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParams.clientRef

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParams.from

Defined in

messages/lib/classes/AbstractMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

MessageParams.to

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParams.webhookUrl

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParams.webhookVersion

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractTextMessage

An abstract base class for text message objects.

Extends

Extended by

Implements

Constructors

new AbstractTextMessage()
new AbstractTextMessage(params): AbstractTextMessage

Constructs a new AbstractTextMessage instance for text messages.

Parameters
params

MessageParamsText

The parameters for creating a text message.

Returns

AbstractTextMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:26

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsText.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsText.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

text
text: string;

The text content of the message.

Implementation of

MessageParamsText.text

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

MessageParamsText.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsText.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsText.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractVcardMessage

An abstract base class for vCard (contact card) message objects.

Extends

Extended by

Implements

Constructors

new AbstractVcardMessage()
new AbstractVcardMessage(params): AbstractVcardMessage

Constructs a new AbstractVcardMessage instance for vCard messages.

Parameters
params

MessageParamsVcard

The parameters for creating a vCard message.

Returns

AbstractVcardMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractVcardMessage.ts:27

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsVcard.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsVcard.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "vcard";

The type of message, which is 'vcard' for vCard messages.

Defined in

messages/lib/classes/AbstractVcardMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

MessageParamsVcard.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

vcard
vcard: MessageVcardType;

The vCard (contact card) content of the message.

Implementation of

MessageParamsVcard.vcard

Defined in

messages/lib/classes/AbstractVcardMessage.ts:20

webhookUrl?
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.

Implementation of

MessageParamsVcard.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsVcard.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


abstract AbstractVideoMessage

An abstract base class for video message objects.

Extends

Extended by

Implements

Constructors

new AbstractVideoMessage()
new AbstractVideoMessage(params): AbstractVideoMessage

Constructs a new AbstractVideoMessage instance for video messages.

Parameters
params

MessageParamsVideo

The parameters for creating a video message.

Returns

AbstractVideoMessage

Overrides

AbstractMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:27

Properties

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsVideo.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsVideo.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

MessageParamsVideo.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

video
video: MessageVideoType;

The video content of the message.

Implementation of

MessageParamsVideo.video

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

MessageParamsVideo.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsVideo.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


Messages

Client class to interact with the Messages API which enables users to manage send messages through various channels programmatically.

See

https://developer.nexmo.com/en/messages/overview

Examples

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;

Extends

Constructors

new Messages()
new Messages(credentials, options?): Messages

Creates a new instance of the Client.

Parameters
credentials

The authentication credentials or an authentication instance.

AuthInterface | AuthParams

options?

ConfigParams

Optional configuration settings for the client.

Returns

Messages

Inherited from

Client.constructor

Defined in

server-client/dist/lib/client.d.ts:35

Methods

addAuthenticationToRequest()
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

Parameters
request

VetchOptions

The request to which authentication should be added.

Returns

Promise<VetchOptions>

A promise that resolves to the request with added authentication.

Overrides

Client.addAuthenticationToRequest

Defined in

messages/lib/messages.ts:57

addBasicAuthToRequest()
protected addBasicAuthToRequest(request): Promise<VetchOptions>

Adds basic authentication headers to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addBasicAuthToRequest

Defined in

server-client/dist/lib/client.d.ts:71

addJWTToRequest()
protected addJWTToRequest(request): Promise<VetchOptions>

Adds a JWT to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addJWTToRequest

Defined in

server-client/dist/lib/client.d.ts:64

addQueryKeySecretToRequest()
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>

Adds API key and secret to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequest

Defined in

server-client/dist/lib/client.d.ts:57

addQueryKeySecretToRequestBody()
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>

Adds API key and secret to the request body.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequestBody

Defined in

server-client/dist/lib/client.d.ts:50

getConfig()
getConfig(): ConfigParams
Returns

ConfigParams

Inherited from

Client.getConfig

Defined in

server-client/dist/lib/client.d.ts:36

parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>

Parses the response based on its content type.

Type Parameters

T

The expected type of the parsed response data.

Parameters
request

VetchOptions

The request options.

response

Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

Defined in

server-client/dist/lib/client.d.ts:168

prepareBody()
protected prepareBody(request): undefined | string

Prepares the body for the request based on the content type.

Parameters
request

VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

Defined in

server-client/dist/lib/client.d.ts:158

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>

Prepares the request with necessary headers, authentication, and query parameters.

Parameters
request

VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

Defined in

server-client/dist/lib/client.d.ts:151

send()
send(message): Promise<MessageSuccess>

Sends a message using the Vonage API.

Parameters
message

The message to be sent.

AnyChannel

Returns

Promise<MessageSuccess>

A promise that resolves to a success response with a message UUID.

Defined in

messages/lib/messages.ts:82

sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>

Sends a DELETE request to the specified URL.

Type Parameters

T

Parameters
url

string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

Defined in

server-client/dist/lib/client.d.ts:78

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request with form data to the specified URL.

Type Parameters

T

Parameters
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.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

Defined in

server-client/dist/lib/client.d.ts:86

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>

Sends a GET request to the specified URL with optional query parameters.

Type Parameters

T

Parameters
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.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

Defined in

server-client/dist/lib/client.d.ts:94

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

Defined in

server-client/dist/lib/client.d.ts:104

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a POST request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

Defined in

server-client/dist/lib/client.d.ts:114

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>

Sends a PUT request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

Defined in

server-client/dist/lib/client.d.ts:124

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters

T

Parameters
request

VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

Defined in

server-client/dist/lib/client.d.ts:144

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters

T

Parameters
method

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

POST | PUT | PATCH

url

string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

Defined in

server-client/dist/lib/client.d.ts:135

updateMessage()
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.

Parameters
messageId

string

The ID of the message to update.

status

string

The status to update the message to.

Returns

Promise<true>

A promise that resolves to true if the message was updated successfully.

Example

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);
Defined in

messages/lib/messages.ts:131

Properties

auth
protected auth: AuthInterface;

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

Defined in

server-client/dist/lib/client.d.ts:24

authType?
protected optional authType: AuthenticationType;

The type of authentication used for the client's requests.

Inherited from

Client.authType

Defined in

server-client/dist/lib/client.d.ts:20

config
protected config: ConfigParams;

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

Defined in

server-client/dist/lib/client.d.ts:28

transformers
static transformers: object;

Static property containing utility transformers.

camelCaseObjectKeys
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys
kebabCaseObjectKeys: PartialTransformFunction;
omit()
omit: (keys, obj) => TransformedObject;
Parameters
keys

string[]

obj

ObjectToTransform

Returns

TransformedObject

snakeCaseObjectKeys
snakeCaseObjectKeys: PartialTransformFunction;
Inherited from

Client.transformers

Defined in

server-client/dist/lib/client.d.ts:11


MessengerAudio

Represents an audio message for the Messenger channel.

Extends

Implements

Constructors

new MessengerAudio()
new MessengerAudio(params): MessengerAudio

Sends an audio message to the Facebook Messenger channel.

Parameters
params

MessengerAudioParams

The parameters for creating a Messenger audio message.

Returns

MessengerAudio

Example
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}`);
Overrides

AbstractAudioMessage

Defined in

messages/lib/classes/Messenger/MessengerAudio.ts:43

Properties

audio
audio: MessageAudioType;

The audio message content.

Implementation of

MessengerAudioParams.audio

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:13

channel
channel: "messenger";

The channel for this message (always 'messenger').

Defined in

messages/lib/classes/Messenger/MessengerAudio.ts:16

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessengerAudioParams.clientRef

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessengerAudioParams.from

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "audio";
Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:12

messenger
messenger: MessengerType;

The messenger information for this message.

Implementation of

MessengerAudioParams.messenger

Defined in

messages/lib/classes/Messenger/MessengerAudio.ts:21

to
to: string;

The recipient of the message.

Implementation of

MessengerAudioParams.to

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessengerAudioParams.webhookUrl

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessengerAudioParams.webhookVersion

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MessengerFile

Represents a file message for the Messenger channel.

Extends

Implements

Constructors

new MessengerFile()
new MessengerFile(params): MessengerFile

Sends a file message to the Facebook Messenger channel.

Parameters
params

MessageParams

The parameters for creating a Messenger file message.

Returns

MessengerFile

Example
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}`);
Overrides

AbstractFileMessage

Defined in

messages/lib/classes/Messenger/MessengerFile.ts:45

Properties

channel
channel: "messenger";

The channel for this message (always 'messenger').

Defined in

messages/lib/classes/Messenger/MessengerFile.ts:16

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParams.clientRef

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

file
file: MessageFileType;

The file attachment content.

Implementation of

MessengerFileParams.file

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:12

from
from: string;

The sender of the message.

Implementation of

MessageParams.from

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "file";
Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:11

messenger
messenger: MessengerType;

The messenger information for this message.

Implementation of

MessengerFileParams.messenger

Defined in

messages/lib/classes/Messenger/MessengerFile.ts:21

to
to: string;

The recipient of the message.

Implementation of

MessageParams.to

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParams.webhookUrl

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParams.webhookVersion

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MessengerImage

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.

Extends

Implements

Constructors

new MessengerImage()
new MessengerImage(params): MessengerImage

Send an image message using the Facebook Messenger channel.

Parameters
params

MessengerImageParams

The parameters for the image message.

Returns

MessengerImage

Example
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}`);
Overrides

AbstractImageMessage

Defined in

messages/lib/classes/Messenger/MessengerImage.ts:47

Properties

channel
channel: "messenger";

The channel for sending the message, which is set to 'messenger'.

Defined in

messages/lib/classes/Messenger/MessengerImage.ts:19

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessengerImageParams.clientRef

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessengerImageParams.from

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

MessengerImageParams.image

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:12

messenger
messenger: MessengerType;

Additional Messenger-specific parameters for the image message.

Implementation of

MessengerImageParams.messenger

Defined in

messages/lib/classes/Messenger/MessengerImage.ts:24

to
to: string;

The recipient of the message.

Implementation of

MessengerImageParams.to

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessengerImageParams.webhookUrl

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessengerImageParams.webhookVersion

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MessengerText

Represents a text message for the Messenger channel.

Extends

Implements

Constructors

new MessengerText()
new MessengerText(params): MessengerText

Sends a text message to the Facebook Messenger channel.

Parameters
params

MessengerTextParams

The parameters for creating a Messenger text message.

Returns

MessengerText

Example
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}`);
Overrides

AbstractTextMessage

Defined in

messages/lib/classes/Messenger/MessengerText.ts:42

Properties

channel
channel: "messenger";

The channel for this message (always 'messenger').

Defined in

messages/lib/classes/Messenger/MessengerText.ts:16

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessengerTextParams.clientRef

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessengerTextParams.from

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

messenger
messenger: MessengerType;

The messenger information for this message.

Implementation of

MessengerTextParams.messenger

Defined in

messages/lib/classes/Messenger/MessengerText.ts:21

text
text: string;

The text content of the message.

Implementation of

MessengerTextParams.text

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

MessengerTextParams.to

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessengerTextParams.webhookUrl

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessengerTextParams.webhookVersion

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MessengerVideo

Represents a video message for the Messenger channel.

Extends

Implements

Constructors

new MessengerVideo()
new MessengerVideo(params): MessengerVideo

Send a video message using the Facebook Messenger channel.

Parameters
params

MessengerVideoParams

The parameters for creating a Messenger video message.

Returns

MessengerVideo

Example
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}`);
Overrides

AbstractVideoMessage

Defined in

messages/lib/classes/Messenger/MessengerVideo.ts:44

Properties

channel
channel: "messenger";

The channel for this message (always 'messenger').

Defined in

messages/lib/classes/Messenger/MessengerVideo.ts:16

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessengerVideoParams.clientRef

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessengerVideoParams.from

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

messenger
messenger: MessengerType;

The messenger information for this message.

Implementation of

MessengerVideoParams.messenger

Defined in

messages/lib/classes/Messenger/MessengerVideo.ts:21

to
to: string;

The recipient of the message.

Implementation of

MessengerVideoParams.to

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

video
video: MessageVideoType;

The video content of the message.

Implementation of

MessengerVideoParams.video

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

MessengerVideoParams.webhookUrl

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessengerVideoParams.webhookVersion

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MMSAudio

Represents an audio message for the MMS channel.

Extends

Implements

Constructors

new MMSAudio()
new MMSAudio(params): MMSAudio

Send an MMS audio message.

Parameters
params

MessageParamsAudio

The parameters for creating the audio message.

Returns

MMSAudio

Example
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}`);
Overrides

AbstractAudioMessage

Defined in

messages/lib/classes/MMS/MMSAudio.ts:36

Properties

audio
audio: MessageAudioType;

The audio message content.

Implementation of

MessageParamsAudio.audio

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:13

channel
channel: "mms";
Defined in

messages/lib/classes/MMS/MMSAudio.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsAudio.clientRef

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsAudio.from

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "audio";
Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

MessageParamsAudio.to

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsAudio.webhookUrl

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsAudio.webhookVersion

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MMSImage

Represents an image message for the MMS channel.

Extends

Implements

Constructors

new MMSImage()
new MMSImage(params): MMSImage

Send an MMS image message.

Parameters
params

MessageParamsImage

The parameters for creating the image message.

Returns

MMSImage

Example
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}`);
Overrides

AbstractImageMessage

Defined in

messages/lib/classes/MMS/MMSImage.ts:36

Properties

channel
channel: "mms";
Defined in

messages/lib/classes/MMS/MMSImage.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsImage.clientRef

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsImage.from

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

MessageParamsImage.image

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

MessageParamsImage.to

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

MessageParamsImage.webhookUrl

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsImage.webhookVersion

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MMSVcard

Represents a vCard message for the MMS channel.

Extends

Implements

Constructors

new MMSVcard()
new MMSVcard(params): MMSVcard

Send an MMS vCard message.

Parameters
params

MessageParamsVcard

The parameters for creating the vCard message.

Returns

MMSVcard

Example
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}`);
Overrides

AbstractVcardMessage

Defined in

messages/lib/classes/MMS/MMSVcard.ts:36

Properties

channel
channel: "mms";
Defined in

messages/lib/classes/MMS/MMSVcard.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsVcard.clientRef

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsVcard.from

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "vcard";

The type of message, which is 'vcard' for vCard messages.

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractVcardMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

MessageParamsVcard.to

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

vcard
vcard: MessageVcardType;

The vCard (contact card) content of the message.

Implementation of

MessageParamsVcard.vcard

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractVcardMessage.ts:20

webhookUrl?
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.

Implementation of

MessageParamsVcard.webhookUrl

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsVcard.webhookVersion

Inherited from

AbstractVcardMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


MMSVideo

Represents a video message for the MMS channel.

Extends

Implements

Constructors

new MMSVideo()
new MMSVideo(params): MMSVideo

Send an MMS video message.

Parameters
params

MessageParamsVideo

The parameters for creating the video message.

Returns

MMSVideo

Example
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}`);
Overrides

AbstractVideoMessage

Defined in

messages/lib/classes/MMS/MMSVideo.ts:35

Properties

channel
channel: "mms";
Defined in

messages/lib/classes/MMS/MMSVideo.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

MessageParamsVideo.clientRef

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

MessageParamsVideo.from

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

MessageParamsVideo.to

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

video
video: MessageVideoType;

The video content of the message.

Implementation of

MessageParamsVideo.video

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

MessageParamsVideo.webhookUrl

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

MessageParamsVideo.webhookVersion

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


RCSCustom

Represents a custom message for RCS.

Extends

Implements

Constructors

new RCSCustom()
new RCSCustom(params): RCSCustom

Sends a custom message through RCS

Parameters
params

RCSCustomParams

The parameters for creating a RCS custom message.

Returns

RCSCustom

Example
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}`);
Overrides

AbstractMessage

Defined in

messages/lib/classes/RCS/RCSCustom.ts:54

Properties

channel
channel: RCS = Channels.RCS;

The channel through which the message will be sent. Always rcs

Implementation of

RCSCustomParams.channel

Defined in

messages/lib/classes/RCS/RCSCustom.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

RCSCustomParams.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

custom
custom: Record<string, unknown>;

A custom payload. The schema of a custom object can vary widely.

Implementation of

RCSCustomParams.custom

Defined in

messages/lib/classes/RCS/RCSCustom.ts:24

from
from: string;

The sender of the message.

Implementation of

RCSCustomParams.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: string = 'custom';

The type of message. For a custom message, this will always be custom.

Defined in

messages/lib/classes/RCS/RCSCustom.ts:19

to
to: string;

The recipient of the message.

Implementation of

RCSCustomParams.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

ttl?
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.

Implementation of

RCSCustomParams.ttl

Defined in

messages/lib/classes/RCS/RCSCustom.ts:32

webhookUrl?
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.

Implementation of

RCSCustomParams.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

RCSCustomParams.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


RCSFile

Represents a file message for the RCS channel.

Extends

Implements

Constructors

new RCSFile()
new RCSFile(params): RCSFile

Sends a file message to the RCS channel.

Parameters
params

MessageParams & object & object

The parameters for creating a RCS file message.

Returns

RCSFile

Example
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}`);
Overrides

AbstractFileMessage

Defined in

messages/lib/classes/RCS/RCSFile.ts:48

Properties

channel
channel: RCS = Channels.RCS;

The channel for this message (always 'rcs').

Implementation of

RCSFileParams.channel

Defined in

messages/lib/classes/RCS/RCSFile.ts:17

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

RCSFileParams.clientRef

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

file
file: MessageFileType;

The file attachment content.

Implementation of

RCSFileParams.file

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:12

from
from: string;

The sender of the message.

Implementation of

RCSFileParams.from

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "file";
Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:11

to
to: string;

The recipient of the message.

Implementation of

RCSFileParams.to

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

ttl?
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.

Implementation of

RCSFileParams.ttl

Defined in

messages/lib/classes/RCS/RCSFile.ts:25

webhookUrl?
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.

Implementation of

RCSFileParams.webhookUrl

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

RCSFileParams.webhookVersion

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


RCSImage

Represents an image message for the RCS channel.

Extends

Implements

Constructors

new RCSImage()
new RCSImage(params): RCSImage

Send an RCS image message.

Parameters
params

RCSImageParams

The parameters for creating the image message.

Returns

RCSImage

Example
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}`);
Overrides

AbstractImageMessage

Defined in

messages/lib/classes/RCS/RCSImage.ts:44

Properties

channel
channel: RCS = Channels.RCS;

The channel through which the message will be sent. Always rcs

Implementation of

RCSImageParams.channel

Defined in

messages/lib/classes/RCS/RCSImage.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

RCSImageParams.clientRef

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

RCSImageParams.from

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

RCSImageParams.image

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

RCSImageParams.to

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

ttl?
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.

Implementation of

RCSImageParams.ttl

Defined in

messages/lib/classes/RCS/RCSImage.ts:22

webhookUrl?
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.

Implementation of

RCSImageParams.webhookUrl

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

RCSImageParams.webhookVersion

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


RCSText

Represents a text message for the RCS channel.

Extends

Implements

Constructors

new RCSText()
new RCSText(params): RCSText

Sends a text message through the RCS channel.

Parameters
params

RCSTextParams

The parameters for creating a RCS text message.

Returns

RCSText

Example
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}`);
Overrides

AbstractTextMessage

Defined in

messages/lib/classes/RCS/RCSText.ts:43

Properties

channel
channel: RCS = Channels.RCS;

The channel for this message (always 'rcs').

Implementation of

RCSTextParams.channel

Defined in

messages/lib/classes/RCS/RCSText.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

RCSTextParams.clientRef

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

RCSTextParams.from

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

text
text: string;

The text content of the message.

Implementation of

RCSTextParams.text

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

RCSTextParams.to

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

ttl?
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.

Implementation of

RCSTextParams.ttl

Defined in

messages/lib/classes/RCS/RCSText.ts:22

webhookUrl?
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.

Implementation of

RCSTextParams.webhookUrl

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

RCSTextParams.webhookVersion

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


RCSVideo

Represents an video message for the RCS channel.

Extends

Implements

Constructors

new RCSVideo()
new RCSVideo(params): RCSVideo

Send an RCS video message.

Parameters
params

RCSVideoParams

The parameters for creating the video message.

Returns

RCSVideo

Example
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}`);
Overrides

AbstractVideoMessage

Defined in

messages/lib/classes/RCS/RCSVideo.ts:45

Properties

channel
channel: RCS;

The channel through which the message will be sent. Always rcs

Implementation of

RCSVideoParams.channel

Defined in

messages/lib/classes/RCS/RCSVideo.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

RCSVideoParams.clientRef

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

RCSVideoParams.from

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

RCSVideoParams.to

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

ttl?
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.

Implementation of

RCSVideoParams.ttl

Defined in

messages/lib/classes/RCS/RCSVideo.ts:22

video
video: MessageVideoType;

The video content of the message.

Implementation of

RCSVideoParams.video

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

RCSVideoParams.webhookUrl

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

RCSVideoParams.webhookVersion

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


SMS

Send a text message using the SMS channel.

Extends

Implements

Constructors

new SMS()
new SMS(
   params, 
   to?, 
   from?, 
   clientRef?): SMS

Send an SMS message

Parameters
params

The message parameters or text message.

string | SMSParams

to?

string

The recipient's phone number.

from?

string

The sender's phone number.

clientRef?

string

The client reference for the message.

Returns

SMS

Examples
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}`);
Overrides

AbstractTextMessage

Defined in

messages/lib/classes/SMS/SMS.ts:58

Properties

channel
channel: "sms";
Defined in

messages/lib/classes/SMS/SMS.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

SMSParams.clientRef

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

SMSParams.from

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

sms?
optional sms: SMSExtraParams;
Implementation of

SMSParams.sms

Defined in

messages/lib/classes/SMS/SMS.ts:15

text
text: string;

The text content of the message.

Implementation of

SMSParams.text

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

SMSParams.to

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

SMSParams.webhookUrl

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

SMSParams.webhookVersion

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


ViberFile

Represents a file message for the Viber Service channel.

Extends

Implements

Constructors

new ViberFile()
new ViberFile(params): ViberFile

Send a file message using the Viber Service channel.

Parameters
params

ViberFileParams

The parameters for the ViberFile message.

Returns

ViberFile

Example
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}`);
Overrides

AbstractFileMessage

Defined in

messages/lib/classes/Viber/ViberFile.ts:38

Properties

channel
channel: "viber_service";
Defined in

messages/lib/classes/Viber/ViberFile.ts:10

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

ViberFileParams.clientRef

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

file
file: MessageFileType;

The file attachment content.

Implementation of

ViberFileParams.file

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:12

from
from: string;

The sender of the message.

Implementation of

ViberFileParams.from

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "file";
Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:11

to
to: string;

The recipient of the message.

Implementation of

ViberFileParams.to

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

ViberFileParams.webhookUrl

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

ViberFileParams.webhookVersion

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


ViberImage

Represents an image message for the Viber Service channel.

Extends

Implements

Constructors

new ViberImage()
new ViberImage(params): ViberImage

Send an image message using the Viber Service channel.

Parameters
params

ViberImageParams

The parameters for the ViberImage message.

Returns

ViberImage

Example
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}`);
Overrides

AbstractImageMessage

Defined in

messages/lib/classes/Viber/ViberImage.ts:43

Properties

channel
channel: "viber_service";
Defined in

messages/lib/classes/Viber/ViberImage.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

ViberImageParams.clientRef

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

ViberImageParams.from

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

ViberImageParams.image

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

ViberImageParams.to

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

viberService
viberService: ViberActionParams;

The Viber action parameters for sending the image.

Implementation of

ViberImageParams.viberService

Defined in

messages/lib/classes/Viber/ViberImage.ts:15

webhookUrl?
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.

Implementation of

ViberImageParams.webhookUrl

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

ViberImageParams.webhookVersion

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


ViberText

Represents a text message for the Viber Service channel.

Extends

Implements

Constructors

new ViberText()
new ViberText(params): ViberText

Send a text message using the Viber Service channel.

Parameters
params

ViberTextParams

The parameters for the ViberText message.

Returns

ViberText

Example
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}`);
Overrides

AbstractTextMessage

Defined in

messages/lib/classes/Viber/ViberText.ts:42

Properties

channel
channel: "viber_service";
Defined in

messages/lib/classes/Viber/ViberText.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

ViberTextParams.clientRef

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

ViberTextParams.from

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

text
text: string;

The text content of the message.

Implementation of

ViberTextParams.text

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

ViberTextParams.to

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

viberService
viberService: ViberActionParams;

The Viber service and action parameters for the message.

Implementation of

ViberTextParams.viberService

Defined in

messages/lib/classes/Viber/ViberText.ts:15

webhookUrl?
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.

Implementation of

ViberTextParams.webhookUrl

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

ViberTextParams.webhookVersion

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


ViberVideo

Represents a video message for the Viber Service channel.

Extends

Implements

Constructors

new ViberVideo()
new ViberVideo(params): ViberVideo

Send a video message using the Viber Service channel.

Parameters
params

ViberVideoParams

The parameters for the ViberVideo message.

Returns

ViberVideo

Example
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}`);
Overrides

AbstractVideoMessage

Defined in

messages/lib/classes/Viber/ViberVideo.ts:43

Properties

channel
channel: "viber_service";
Defined in

messages/lib/classes/Viber/ViberVideo.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

ViberVideoParams.clientRef

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

from
from: string;

The sender of the message.

Implementation of

ViberVideoParams.from

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

ViberVideoParams.to

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

viberService
viberService: object & object & ViberService;

The Viber service, action parameters, and video message details.

Type declaration
duration
duration: string;

The duration of the video in seconds.

fileSize
fileSize: string;

The file size of the video in MB.

Type declaration
action
action: ViberAction;

The action associated with the Viber message.

Implementation of

ViberVideoParams.viberService

Defined in

messages/lib/classes/Viber/ViberVideo.ts:14

video
video: MessageVideoType;

The video content of the message.

Implementation of

ViberVideoParams.video

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

ViberVideoParams.webhookUrl

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

ViberVideoParams.webhookVersion

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppAudio

Represents an audio message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppAudio()
new WhatsAppAudio(params): WhatsAppAudio

Sends an audio message to a WhatsApp user.

Parameters
params

WhatsAppAudioParams

The parameters for creating a WhatsApp audio message.

Returns

WhatsAppAudio

Example
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}`);
Overrides

AbstractAudioMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppAudio.ts:37

Properties

audio
audio: MessageAudioType;

The audio message content.

Implementation of

WhatsAppAudioParams.audio

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:13

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppAudio.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppAudioParams.clientRef

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppAudioParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppAudio.ts:15

from
from: string;

The sender of the message.

Implementation of

WhatsAppAudioParams.from

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "audio";
Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractAudioMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

WhatsAppAudioParams.to

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppAudioParams.webhookUrl

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppAudioParams.webhookVersion

Inherited from

AbstractAudioMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppCustom

Represents a custom message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppCustom()
new WhatsAppCustom(params): WhatsAppCustom

Sends a custom message to a WhatsApp user.

Parameters
params

WhatsAppCustomParams

The parameters for creating a WhatsApp custom message.

Returns

WhatsAppCustom

Example
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}`);
Overrides

AbstractMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppCustom.ts:47

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppCustom.ts:17

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppCustomParams.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppCustomParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppCustom.ts:21

custom
custom: WhatsAppCustomType;

The custom WhatsApp message type.

Implementation of

WhatsAppCustomParams.custom

Defined in

messages/lib/classes/WhatsApp/WhatsAppCustom.ts:19

from
from: string;

The sender of the message.

Implementation of

WhatsAppCustomParams.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "custom";
Defined in

messages/lib/classes/WhatsApp/WhatsAppCustom.ts:18

to
to: string;

The recipient of the message.

Implementation of

WhatsAppCustomParams.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppCustomParams.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppCustomParams.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppFile

Represents a file message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppFile()
new WhatsAppFile(params): WhatsAppFile

Send a WhatsApp file message.

Parameters
params

WhatsAppFileParams

The parameters for creating a WhatsApp file message.

Returns

WhatsAppFile

Example
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}`);
Overrides

AbstractFileMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppFile.ts:38

Properties

channel
channel: Channels = Channels.WHATSAPP;
Defined in

messages/lib/classes/WhatsApp/WhatsAppFile.ts:14

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppFileParams.clientRef

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppFileParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppFile.ts:16

file
file: MessageFileType;

The file attachment content.

Implementation of

WhatsAppFileParams.file

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:12

from
from: string;

The sender of the message.

Implementation of

WhatsAppFileParams.from

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "file";
Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractFileMessage.ts:11

to
to: string;

The recipient of the message.

Implementation of

WhatsAppFileParams.to

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppFileParams.webhookUrl

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppFileParams.webhookVersion

Inherited from

AbstractFileMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppImage

Represents an image message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppImage()
new WhatsAppImage(params): WhatsAppImage

Sends an image message to a WhatsApp user.

Parameters
params

WhatsAppImageParams

The parameters for creating a WhatsApp image message.

Returns

WhatsAppImage

Example
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}`);
Overrides

AbstractImageMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppImage.ts:37

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppImage.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppImageParams.clientRef

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppImageParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppImage.ts:15

from
from: string;

The sender of the message.

Implementation of

WhatsAppImageParams.from

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

image
image: MessageImageType;

The image attachment content.

Implementation of

WhatsAppImageParams.image

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:13

messageType
messageType: "image";
Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractImageMessage.ts:12

to
to: string;

The recipient of the message.

Implementation of

WhatsAppImageParams.to

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppImageParams.webhookUrl

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppImageParams.webhookVersion

Inherited from

AbstractImageMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppReaction

Represents a reaction message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppReaction()
new WhatsAppReaction(params): WhatsAppReaction

Sends a reaction message to a WhatsApp user.

Parameters
params

WhatsAppReactionParams

The parameters for creating a WhatsApp reaction message.

Returns

WhatsAppReaction

Examples

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}`);
Overrides

AbstractMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppReaction.ts:62

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppReaction.ts:17

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppReactionParams.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppReactionParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppReaction.ts:21

from
from: string;

The sender of the message.

Implementation of

WhatsAppReactionParams.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "reaction";
Defined in

messages/lib/classes/WhatsApp/WhatsAppReaction.ts:18

reaction
reaction: WhatsAppReactionType;
Implementation of

WhatsAppReactionParams.reaction

Defined in

messages/lib/classes/WhatsApp/WhatsAppReaction.ts:19

to
to: string;

The recipient of the message.

Implementation of

WhatsAppReactionParams.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppReactionParams.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppReactionParams.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppSticker

Represents a sticker message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppSticker()
new WhatsAppSticker(params): WhatsAppSticker

Send a sticker message to a WhatsApp user.

Parameters
params

WhatsAppStickerParams

The parameters for creating a WhatsApp sticker message.

Returns

WhatsAppSticker

Examples

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}`);
Overrides

AbstractMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppSticker.ts:62

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppSticker.ts:18

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppStickerParams.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppStickerParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppSticker.ts:22

from
from: string;

The sender of the message.

Implementation of

WhatsAppStickerParams.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "sticker";
Defined in

messages/lib/classes/WhatsApp/WhatsAppSticker.ts:19

sticker
sticker: WhatsAppStickerIdType | WhatsAppStickerUrlType;

The sticker to be sent, which can be either a sticker ID or a sticker URL.

Implementation of

WhatsAppStickerParams.sticker

Defined in

messages/lib/classes/WhatsApp/WhatsAppSticker.ts:20

to
to: string;

The recipient of the message.

Implementation of

WhatsAppStickerParams.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppStickerParams.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppStickerParams.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppTemplate

Represents a template message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppTemplate()
new WhatsAppTemplate(params): WhatsAppTemplate

Send a template message to a WhatsApp user.

Parameters
params

WhatsAppTemplateParams

The parameters for creating a WhatsApp template message.

Returns

WhatsAppTemplate

Example
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}`);
Overrides

AbstractMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:54

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:18

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppTemplateParams.clientRef

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppTemplateParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:23

from
from: string;

The sender of the message.

Implementation of

WhatsAppTemplateParams.from

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "template";
Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:19

template
template: WhatsAppTemplateType;

The WhatsApp template to be sent.

Implementation of

WhatsAppTemplateParams.template

Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:21

to
to: string;

The recipient of the message.

Implementation of

WhatsAppTemplateParams.to

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppTemplateParams.webhookUrl

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppTemplateParams.webhookVersion

Inherited from

AbstractMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36

whatsapp
whatsapp: WhatsAppPolicyType;

WhatsApp policy type for the template message.

Implementation of

WhatsAppTemplateParams.whatsapp

Defined in

messages/lib/classes/WhatsApp/WhatsAppTemplate.ts:20


WhatsAppText

Represents a text message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppText()
new WhatsAppText(params): WhatsAppText

Send a WhatsApp text message.

Parameters
params

WhatsAppTextParams

The parameters for creating a WhatsApp text message.

Returns

WhatsAppText

Example
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}`);
Overrides

AbstractTextMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppText.ts:34

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppText.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppTextParams.clientRef

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppTextParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppText.ts:15

from
from: string;

The sender of the message.

Implementation of

WhatsAppTextParams.from

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "text";

The type of message, which is 'text' for text messages.

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:14

text
text: string;

The text content of the message.

Implementation of

WhatsAppTextParams.text

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractTextMessage.ts:19

to
to: string;

The recipient of the message.

Implementation of

WhatsAppTextParams.to

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

webhookUrl?
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.

Implementation of

WhatsAppTextParams.webhookUrl

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppTextParams.webhookVersion

Inherited from

AbstractTextMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


WhatsAppVideo

Represents a video message for WhatsApp.

Extends

Implements

Constructors

new WhatsAppVideo()
new WhatsAppVideo(params): WhatsAppVideo

Sends a video message to a WhatsApp user.

Parameters
params

WhatsAppVideoParams

The parameters for creating a WhatsApp video message.

Returns

WhatsAppVideo

Example
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}`);
Overrides

AbstractVideoMessage

Defined in

messages/lib/classes/WhatsApp/WhatsAppVideo.ts:38

Properties

channel
channel: "whatsapp";
Defined in

messages/lib/classes/WhatsApp/WhatsAppVideo.ts:13

clientRef?
optional clientRef: string;

An optional client reference for the message.

Implementation of

WhatsAppVideoParams.clientRef

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:20

context?
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

Implementation of

WhatsAppVideoParams.context

Defined in

messages/lib/classes/WhatsApp/WhatsAppVideo.ts:15

from
from: string;

The sender of the message.

Implementation of

WhatsAppVideoParams.from

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:15

messageType
messageType: "video";

The type of message, which is 'video' for video messages.

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:15

to
to: string;

The recipient of the message.

Implementation of

WhatsAppVideoParams.to

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:10

video
video: MessageVideoType;

The video content of the message.

Implementation of

WhatsAppVideoParams.video

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractVideoMessage.ts:20

webhookUrl?
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.

Implementation of

WhatsAppVideoParams.webhookUrl

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:27

webhookVersion?
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.

Implementation of

WhatsAppVideoParams.webhookVersion

Inherited from

AbstractVideoMessage

Defined in

messages/lib/classes/AbstractMessage.ts:36


AnyChannel

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.

Defined in

messages/lib/types/Channels/index.ts:19


AnyMessengerChannel

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.

Type declaration

channel
channel: Channels.MESSENGER;

The channel through which the message will be sent, which is 'messenger' for Messenger.

Defined in

messages/lib/types/Channels/Messenger/index.ts:38


AnyMMSChannel

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.

Type declaration

channel
channel: Channels.MMS;

The channel through which the message will be sent, which is 'mms' for MMS.

Defined in

messages/lib/types/Channels/MMS/index.ts:30


AnyRCSChannel

type AnyRCSChannel: 
  | RCSCustomParams
  | RCSFileParams
  | RCSImageParams
  | RCSTextParams
  | RCSVideoParams;

Defined in

messages/lib/types/Channels/RCS/index.ts:13


AnyViberChannel

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.

Type declaration

channel
channel: Channels.VIBER;

The channel through which the message will be sent, which is 'viber' for Viber.

Defined in

messages/lib/types/Channels/Viber/index.ts:39


AnyWhatsAppChannel

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.

Type declaration

channel
channel: Channels.WHATSAPP;

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

Defined in

messages/lib/types/Channels/WhatsApp/index.ts:56


MessageAudioType

type MessageAudioType: object;

Represents an audio message type.

Type declaration

url
url: string;

The URL of the audio attachment.

Defined in

messages/lib/types/MessageAudioType.ts:4


MessageFileType

type MessageFileType: object;

Represents a file message type.

Type declaration

url
url: string;

The URL of the file attachment.

Defined in

messages/lib/types/MessageFileType.ts:4


MessageImageType

type MessageImageType: object;

Represents an image message type.

Type declaration

url
url: string;

The URL of the image attachment.

Defined in

messages/lib/types/MessageImageType.ts:4


MessageParams

type MessageParams: object;

Represents the parameters for a message.

Type declaration

clientRef?
optional clientRef: string;

Client reference of up to 100 characters. The reference will be present in every message status.

from
from: string;

The ID of the message sender.

to
to: string;

The ID of the message recipient.

webhookUrl?
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.

webhookVersion?
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.

Defined in

messages/lib/types/MessageParams.ts:4


MessageParamsAudio

type MessageParamsAudio: object & MessageParams;

Represents the parameters for a message with audio.

Type declaration

audio
audio: MessageAudioType;

The audio message content.

Defined in

messages/lib/types/MessageParamsAudio.ts:7


MessageParamsFile

type MessageParamsFile: object & MessageParams;

Represents the parameters for a message with a file attachment.

Type declaration

file
file: MessageFileType;

The file attachment content.

Defined in

messages/lib/types/MessageParamsFile.ts:7


MessageParamsImage

type MessageParamsImage: object & MessageParams;

Represents the parameters for a message with an image attachment.

Type declaration

image
image: MessageImageType;

The image attachment content.

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Defined in

messages/lib/types/MessageParamsImage.ts:7


MessageParamsText

type MessageParamsText: object & MessageParams;

Represents the parameters for a text message.

Type declaration

text
text: string;

The text content of the message.

Defined in

messages/lib/types/MessageParamsText.ts:6


MessageParamsVcard

type MessageParamsVcard: MessageVcardParams & MessageParams;

Represents the parameters for a message containing a vCard.

Defined in

messages/lib/types/MessageParamsVcard.ts:7


MessageParamsVideo

type MessageParamsVideo: object & MessageParams;

Represents the parameters for a message containing a video.

Type declaration

video
video: MessageVideoType;

The video information to be included in the message.

Defined in

messages/lib/types/MessageParamsVideo.ts:7


MessageSuccess

type MessageSuccess: object;

Type declaration

messageUUID
messageUUID: string;

Defined in

messages/lib/types/MessageSuccess.ts:1


MessageSuccessResponse

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.

Type declaration

message_uuid
message_uuid: string;

A unique identifier for the sent message.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase

Defined in

messages/lib/types/Responses/MessageSuccessResponse.ts:12


MessageVcardParams

type MessageVcardParams: object;

Represents a vCard message type.

Type declaration

vcard
vcard: MessageVcardType;

Defined in

messages/lib/types/MessageVcardType.ts:16


MessageVcardType

type MessageVcardType: object;

Type declaration

caption?
optional caption: string;

Additional text to accompany the vCard.

url
url: string;

The URL of the vCard attachment.

Defined in

messages/lib/types/MessageVcardType.ts:1


MessageVideoType

type MessageVideoType: object;

Represents a video message type.

Type declaration

url
url: string;

The URL of the video attachment.

Defined in

messages/lib/types/MessageVideoType.ts:4


RCSCustomParams

type RCSCustomParams: MessageParams & object;

Represents the parameters for sending a custom message using RCS.

Type declaration

channel?
optional channel: Channels.RCS;

The channel to send to. You must provide rcs in this field.

custom
custom: Record<string, unknown>;

A custom payload. The schema of a custom object can vary widely.

ttl?
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.

Defined in

messages/lib/types/Channels/RCS/RCSCustomParams.ts:7


RCSFileParams

type RCSFileParams: MessageParamsFile & object;

Represents the parameters for sending a file message using RCS.

Type declaration

channel?
optional channel: Channels.RCS;

The channel to send to. You must provide rcs in this field.

ttl?
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.

Defined in

messages/lib/types/Channels/RCS/RCSFileParams.ts:7


RCSImageParams

type RCSImageParams: MessageParamsImage & object;

Represents the parameters for sending an image message using RCS.

Type declaration

channel?
optional channel: Channels.RCS;

The channel to send to. You must provide rcs in this field.

Defined in

messages/lib/types/Channels/RCS/RCSImageParams.ts:7


RCSTextParams

type RCSTextParams: MessageParams & object;

Represents the parameters for sending a text message using RCS.

Type declaration

channel?
optional channel: Channels.RCS;

The channel to send to. You must provide rcs in this field.

text
text: string;

The text of the message to send. Limited to 3072 characters, including unicode.

ttl?
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.

Defined in

messages/lib/types/Channels/RCS/RCSTextParams.ts:7


RCSVideoParams

type RCSVideoParams: MessageParams & object;

Represents the parameters for sending a video message using RCS.

Type declaration

channel?
optional channel: Channels.RCS;

The channel to send to. You must provide rcs in this field.

ttl?
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
video: MessageVideoType;

Defined in

messages/lib/types/Channels/RCS/RCSVideoParams.ts:8


SendMessageParams

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.

Defined in

messages/lib/types/SendMessageParams.ts:15


SMSChannel

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.

Type declaration

channel
channel: Channels.SMS;
sms?
optional sms: SMSExtraParams;
ttl?
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.

Defined in

messages/lib/types/Channels/SMSParams.ts:53


SMSExtraParams

type SMSExtraParams: object;

Type declaration

contentId?
optional contentId: string;

A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.

encodingType?
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.

Link

https://api.support.vonage.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions

entityId?
optional entityId: string;

A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.

Link

https://api.support.vonage.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions

Defined in

messages/lib/types/Channels/SMSParams.ts:18


UpdateMessageRequest

type UpdateMessageRequest: object;

The request object for the Messages.update method.

Type declaration

status
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.

Defined in

messages/lib/types/Requests/UpdateMessageRequest.ts:6


WhatsAppContext

type WhatsAppContext: object;

Type declaration

messageUUID
messageUUID: string;

The UUID of the message being replied to/quoted.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:3


WhatsAppCustomType

type WhatsAppCustomType: object;

Represents a custom WhatsApp message type with arbitrary properties.

Index Signature

[key: string]: unknown

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppCustomType.ts:6


WhatsAppFileParams

type WhatsAppFileParams: object & WhatsAppParams;

Represents a WhatsApp file message type.

Type declaration

file
file: object & MessageFileType;

The file attachment content.

Type declaration
caption?
optional caption: string;

An optional caption to accompany the file.

name?
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.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppFileParams.ts:9


WhatsAppParams

type WhatsAppParams: object & MessageParams;

Type declaration

context?
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

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppParams.ts:10


WhatsAppPolicyType

type WhatsAppPolicyType: object;

Represents a WhatsApp policy type for deterministic messaging.

Type declaration

locale
locale: WhatsAppLanguageCode;

The locale for the WhatsApp message, following the WhatsApp language code.

policy
policy: "deterministic";

The policy type, which is set to 'deterministic'.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppPolicyType.ts:8


WhatsAppReactionRequest

type WhatsAppReactionRequest: object;

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

context
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
context.message_uuid: string;

The UUID of the message being quoted/replied/reacted to.

from
from: string;

The sender's identifier.

message_type
message_type: "reaction";

The type of the message, which is 'reaction' for a text message.

reaction
reaction: object;
reaction.action
reaction.action: "react" | "unreact";

The action taken.

reaction.emoji?
optional reaction.emoji: string;

The emoji used as a reaction.

to
to: string;

The recipient's identifier.

webhook_url
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
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.

Defined in

messages/lib/types/Requests/WhatsAppReactionRequest.ts:1


WhatsAppReactionType

type WhatsAppReactionType: object;

Type declaration

action
action: "react" | "unreact";

The action taken.

emoji?
optional emoji: string;

The emoji used as a reaction.

Defined in

messages/lib/types/Channels/WhatsApp/WhatAppReactionType.ts:1


WhatsAppStickerIdType

type WhatsAppStickerIdType: object;

Represents a WhatsApp sticker ID type.

Type declaration

id
id: string;

The ID of the WhatsApp sticker.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppStickerIdType.ts:6


WhatsAppStickerUrlType

type WhatsAppStickerUrlType: object;

Represents a WhatsApp sticker by URL.

Type declaration

url
url: string;

The URL of the WhatsApp sticker.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppStickerUrlType.ts:6


WhatsAppTemplateType

type WhatsAppTemplateType: object;

Represents a WhatsApp template for sending structured template messages.

Type declaration

name
name: string;

The name of the WhatsApp template.

parameters
parameters: string[];

An array of parameters for the WhatsApp template.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppTemplateType.ts:6

Parameters

AnyMessengerParams

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.

Defined in

messages/lib/types/Channels/Messenger/index.ts:25


AnyMMSParams

type AnyMMSParams: MMSAudioParams | MMSImageParams | MMSVcardParams | MMSVideoParams;

Represents a union type that can be any of the MMS-specific message parameters.

Defined in

messages/lib/types/Channels/MMS/index.ts:18


AnyViberParams

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.

Defined in

messages/lib/types/Channels/Viber/index.ts:24


AnyWhatsAppParams

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.

Defined in

messages/lib/types/Channels/WhatsApp/index.ts:37


MessengerAudioParams

type MessengerAudioParams: MessengerParams & MessageParamsAudio;

Represents parameters for sending an audio message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsAudio.

Defined in

messages/lib/types/Channels/Messenger/MessengerAudioParams.ts:11


MessengerFileParams

type MessengerFileParams: object & MessengerParams;

Represents parameters for sending a file message via the Messenger platform.

Type declaration

file
file: MessageFileType;

Defined in

messages/lib/types/Channels/Messenger/MessengerFileParams.ts:10


MessengerImageParams

type MessengerImageParams: MessengerParams & MessageParamsImage;

Represents parameters for sending an image message via the Messenger platform. Combines parameters from both MessengerParams and MessageParamsImage.

Defined in

messages/lib/types/Channels/Messenger/MessengerImageParams.ts:11


MessengerParams

type MessengerParams: object;

Represents parameters specific to the Messenger platform.

Type declaration

messenger
messenger: MessengerType;

Defined in

messages/lib/types/Channels/Messenger/MessengerParams.ts:9


MessengerTextParams

type MessengerTextParams: MessengerParams & MessageParamsText;

Represents parameters for sending a text message via the Messenger platform.

Defined in

messages/lib/types/Channels/Messenger/MessengerTextParams.ts:10


MessengerType

type MessengerType: object;

Represents the type of message to be sent via the Messenger platform.

Type declaration

category
category: MessengerCategory;

The category of the Messenger message.

tag?
optional tag: string;

An optional tag describing the type and relevance of the 1:1 communication between your app and the end user.

Defined in

messages/lib/types/Channels/Messenger/MessengerType.ts:9


MessengerVideoParams

type MessengerVideoParams: MessengerParams & MessageParamsVideo;

Represents parameters for sending a video message via the Messenger platform.

Defined in

messages/lib/types/Channels/Messenger/MessengerVideoParams.ts:10


MMSAudioParams

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.

Defined in

messages/lib/types/Channels/MMS/MMSAudioParams.ts:13


MMSImageParams

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.

Defined in

messages/lib/types/Channels/MMS/MMSImageParams.ts:13


MMSVcardParams

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.

Type declaration

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Defined in

messages/lib/types/Channels/MMS/MMSVcardParams.ts:13


MMSVideoParams

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.

Defined in

messages/lib/types/Channels/MMS/MMSVideoParams.ts:13


SMSParams

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.

Type declaration

sms?
optional sms: SMSExtraParams;

Remarks

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.

Defined in

messages/lib/types/Channels/SMSParams.ts:16


ViberAction

type ViberAction: object;

Represents an action associated with a Viber message.

Type declaration

text
text: string;

The text displayed for the action.

url
url: string;

The URL to be opened when the action is triggered.

Defined in

messages/lib/types/Channels/Viber/ViberAction.ts:7


ViberActionParams

type ViberActionParams: object & ViberService;

Represents parameters for a Viber action message.

Type declaration

action
action: ViberAction;

The action associated with the Viber message.

Defined in

messages/lib/types/Channels/Viber/ViberActionParams.ts:9


ViberFileParams

type ViberFileParams: object & MessageParams;

Represents parameters for sending a file via Viber.

Type declaration

file
file: object & MessageFileType;
Type declaration
name?
optional name: string;

The name and extension of the file.

Defined in

messages/lib/types/Channels/Viber/ViberFileParams.ts:10


ViberImageParams

type ViberImageParams: object & MessageParamsImage;

Represents parameters for sending an image via Viber.

Type declaration

viberService
viberService: ViberActionParams;

The Viber action parameters for sending the image.

Defined in

messages/lib/types/Channels/Viber/ViberImageParams.ts:10


ViberService

type ViberService: object;

Represents parameters for a Viber service message.

Type declaration

action?
optional action: ViberAction;
category
category: ViberCategory;

The category of the Viber service message.

ttl
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
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.

Defined in

messages/lib/types/Channels/Viber/ViberService.ts:10


ViberTextParams

type ViberTextParams: object & MessageParamsText;

Represents parameters for sending a text message via Viber with action buttons.

Type declaration

text
text: string;

The text content of the message.

viberService
viberService: ViberActionParams;

The Viber service and action parameters for the message.

Defined in

messages/lib/types/Channels/Viber/ViberTextParams.ts:10


ViberVideoParams

type ViberVideoParams: object & MessageParamsVideo;

Represents parameters for sending a video message via Viber with action buttons.

Type declaration

viberService
viberService: object & ViberActionParams;

The Viber service, action parameters, and video message details.

Type declaration
duration
duration: string;

The duration of the video in seconds.

fileSize
fileSize: string;

The file size of the video in MB.

video
video: object;

The details of the video message to be sent.

video.caption?
optional video.caption: string;

The caption to be displayed with the video.

video.thumbUrl?
optional video.thumbUrl: string;

The URL of the thumbnail image to be displayed with the video.

video.url
video.url: string;

The URL of the video attachment.

Defined in

messages/lib/types/Channels/Viber/ViberVideoParams.ts:10


WhatsAppAudioParams

type WhatsAppAudioParams: object & WhatsAppParams & MessageParamsAudio;

Represents parameters for sending an audio message via WhatsApp.

Type declaration

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppAudioParams.ts:10


WhatsAppCustomParams

type WhatsAppCustomParams: object & WhatsAppParams;

Represents parameters for sending a custom WhatsApp message with a file attachment.

Type declaration

custom
custom: WhatsAppCustomType;

The custom WhatsApp message type.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppCustomParams.ts:10


WhatsAppImageParams

type WhatsAppImageParams: WhatsAppParams & MessageParamsImage;

Represents a WhatsApp image message type.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppImageParams.ts:10


WhatsAppReactionParams

type WhatsAppReactionParams: object & WhatsAppParams;

Represents WhatsApp reaction message parameters.

Type declaration

reaction
reaction: WhatsAppReactionType;

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppReactionParams.ts:9


WhatsAppStickerParams

type WhatsAppStickerParams: object & WhatsAppParams;

Represents WhatsApp sticker parameters for sending stickers in a message.

Type declaration

sticker
sticker: WhatsAppStickerIdType | WhatsAppStickerUrlType;

The sticker to be sent, which can be either a sticker ID or a sticker URL.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppStickerParams.ts:11


WhatsAppTemplateParams

type WhatsAppTemplateParams: object & WhatsAppParams;

Represents WhatsApp template message parameters.

Type declaration

template
template: WhatsAppTemplateType;

The WhatsApp template to be sent.

whatsapp
whatsapp: WhatsAppPolicyType;

WhatsApp policy type for the template message.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppTemplateParams.ts:11


WhatsAppTextParams

type WhatsAppTextParams: WhatsAppParams & MessageParamsText;

Represents a text message type for WhatsApp.

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppTextParams.ts:10


WhatsAppVideoParams

type WhatsAppVideoParams: object & WhatsAppParams & MessageParamsVideo;

Represents a video message type for WhatsApp.

Type declaration

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Defined in

messages/lib/types/Channels/WhatsApp/WhatsAppVideoParams.ts:10

Requests

MessengerAudioRequest

type MessengerAudioRequest: object;

Represents a request to send an audio message via the Messenger channel.

Type declaration

audio
audio: object;

The audio content of the message, including the URL of the audio file.

audio.url
audio.url: string;

The URL of the audio file.

channel
channel: "messenger";

The channel for sending the message, which is set to 'messenger'.

client_ref
client_ref: string;

A client reference string for tracking the message.

from
from: string;

The sender of the message.

message_type
message_type: "audio";

The message type, which is set to 'audio' for an audio message.

messenger
messenger: MessengerType;

Additional details about the Messenger message type.

to
to: string;

The recipient of the message.

Remarks

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.

Defined in

messages/lib/types/Requests/MessengerAudioRequest.ts:13


MessengerFileRequest

type MessengerFileRequest: object;

Represents a request to send a file message via the Messenger channel.

Type declaration

channel
channel: "messenger";

The channel for sending the message, which is set to 'messenger'.

client_ref
client_ref: string;

A client reference string for tracking the message.

file
file: object;

The file content of the message, including the URL of the file.

file.url
file.url: string;

The URL of the file.

from
from: string;

The sender of the message.

message_type
message_type: "file";

The message type, which is set to 'file' for a file message.

messenger
messenger: MessengerType;

Additional details about the Messenger message type.

to
to: string;

The recipient of the message.

Remarks

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.

Defined in

messages/lib/types/Requests/MessengerFileRequest.ts:13


MessengerImageRequest

type MessengerImageRequest: object;

Represents a request to send an image message via the Messenger channel.

Type declaration

channel
channel: "messenger";

The channel for sending the message, which is set to 'messenger'.

client_ref
client_ref: string;

A client reference string for tracking the message.

from
from: string;

The sender of the message.

image
image: object;

The image content of the message, including the URL of the image.

image.url
image.url: string;

The URL of the image.

message_type
message_type: "image";

The message type, which is set to 'image' for an image message.

messenger
messenger: MessengerType;

Additional details about the Messenger message type.

to
to: string;

The recipient of the message.

Remarks

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.

Defined in

messages/lib/types/Requests/MessengerImageRequest.ts:13


MessengerTextRequest

type MessengerTextRequest: object;

Represents a request for sending a text message via the Messenger channel.

Type declaration

channel
channel: "messenger";

The channel through which the message will be sent, which is 'messenger' for Messenger.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "text";

The type of the message, which is 'text' for a text message.

messenger
messenger: MessengerType;

Additional information specific to the Messenger channel.

text
text: string;

The text content of the message.

to
to: string;

The recipient's phone number or identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MessengerTextRequest.ts:12


MessengerVideoRequest

type MessengerVideoRequest: object;

Represents a request for sending a video message via the Messenger channel.

Type declaration

channel
channel: "messenger";

The channel through which the message will be sent, which is 'messenger' for Messenger.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "video";

The type of the message, which is 'video' for a video message.

messenger
messenger: MessengerType;

Additional information specific to the Messenger channel.

to
to: string;

The recipient's phone number or identifier.

video
video: object;

The video content of the message.

video.url
video.url: string;

The URL of the video to be sent in the message.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MessengerVideoRequest.ts:13


MMSAudioRequest

type MMSAudioRequest: object;

Represents a request for sending an audio message via the MMS (Multimedia Messaging Service) channel.

Type declaration

audio
audio: object;

The audio content of the message, including the URL of the audio and an optional caption.

audio.caption?
optional audio.caption: string;

An optional caption or description for the audio message.

audio.url
audio.url: string;

The URL of the audio file to be sent in the message.

channel
channel: "mms";

The channel through which the message will be sent, which is 'mms' for MMS.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "audio";

The type of the message, which is 'audio' for an audio message.

to
to: string;

The recipient's phone number or identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MMSAudioRequest.ts:11


MMSImageRequest

type MMSImageRequest: object;

Represents a request for sending an image message via the MMS (Multimedia Messaging Service) channel.

Type declaration

channel
channel: "mms";

The channel through which the message will be sent, which is 'mms' for MMS.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

image
image: object;

The image content of the message, including the URL of the image and an optional caption.

image.caption?
optional image.caption: string;

An optional caption or description for the image message.

image.url
image.url: string;

The URL of the image file to be sent in the message.

message_type
message_type: "image";

The type of the message, which is 'image' for an image message.

to
to: string;

The recipient's phone number or identifier.

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MMSImageRequest.ts:11


MMSVcardRequest

type MMSVcardRequest: object;

Represents a request for sending a vCard message via the MMS (Multimedia Messaging Service) channel.

Type declaration

channel
channel: "mms";

The channel through which the message will be sent, which is 'mms' for MMS.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "vcard";

The type of the message, which is 'vcard' for a vCard message.

to
to: string;

The recipient's phone number or identifier.

vcard
vcard: object;

The vCard content of the message, including the URL of the vCard file.

vcard.url
vcard.url: string;

The URL of the vCard file to be sent in the message.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MMSVcardRequest.ts:11


MMSVideoRequest

type MMSVideoRequest: object;

Represents a request for sending a video message via the MMS (Multimedia Messaging Service) channel.

Type declaration

channel
channel: "mms";

The channel through which the message will be sent, which is 'mms' for MMS.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "video";

The type of the message, which is 'video' for a video message.

to
to: string;

The recipient's phone number or identifier.

video
video: object;

The video content of the message, including the URL of the video file and an optional caption.

video.caption?
optional video.caption: string;

An optional caption for the video.

video.url
video.url: string;

The URL of the video file to be sent in the message.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/MMSVideoRequest.ts:11


SMSMessageRequest

type SMSMessageRequest: object;

Represents a request for sending a text message via the SMS (Short Message Service) channel.

Type declaration

channel
channel: "sms";

The channel through which the message will be sent, which is 'sms' for SMS.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's phone number or identifier.

message_type
message_type: "text";

The type of the message, which is 'text' for a text message.

sms?
optional sms: object;
sms.content_id?
optional sms.content_id: string;

A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.

sms.encoding_type?
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.

Link

https://api.support.vonage.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions

sms.entity_id?
optional sms.entity_id: string;

A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.

Link

https://api.support.vonage.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions

text
text: string;

The text content of the message.

to
to: string;

The recipient's phone number.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/SMSMessageRequest.ts:11


ViberFileRequest

type ViberFileRequest: object;

Represents a request for sending a file message via the Viber Service channel.

Type declaration

channel
channel: "viber_service";

The channel through which the message will be sent, which is 'viber_service' for Viber Service.

client_ref
client_ref: string;

A client-defined reference string for the message.

file
file: object;

The file content to be sent, including the URL and name.

file.name
file.name: string;

The name of the file.

file.url
file.url: string;

The URL of the file to be sent.

from
from: string;

The sender's identifier.

message_type
message_type: "file";

The type of the message, which is 'file' for a file message.

to
to: string;

The recipient's identifier.

viber_service
viber_service: ViberService;

The Viber service configuration.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/ViberFileRequest.ts:13


ViberImageRequest

type ViberImageRequest: object;

Represents a request for sending an image message via the Viber Service channel.

Type declaration

channel
channel: "viber_service";

The channel through which the message will be sent, which is 'viber_service' for Viber Service.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

image
image: object;

The image content to be sent, including the URL and optional caption.

image.caption?
optional image.caption: string;

An optional caption for the image.

image.url
image.url: string;

The URL of the image to be sent.

message_type
message_type: "image";

The type of the message, which is 'image' for an image message.

to
to: string;

The recipient's identifier.

viber_service
viber_service: ViberService;

The Viber service configuration.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/ViberImageRequest.ts:13


ViberTextRequest

type ViberTextRequest: object;

Represents a request for sending a text message via the Viber Service channel.

Type declaration

channel
channel: "viber_service";

The channel through which the message will be sent, which is 'viber_service' for Viber Service.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "text";

The type of the message, which is 'text' for a text message.

text
text: string;

The text content of the message.

to
to: string;

The recipient's identifier.

viber_service
viber_service: ViberService;

The Viber service configuration.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/ViberTextRequest.ts:13


ViberVideoRequest

type ViberVideoRequest: object;

Represents a request for sending a video message via the Viber Service channel.

Type declaration

channel
channel: "viber_service";

The channel through which the message will be sent, which is 'viber_service' for Viber Service.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "video";

The type of the message, which is 'video' for a video message.

to
to: string;

The recipient's identifier.

viber_service
viber_service: ViberService;

The Viber service configuration.

video
video: object;

The video content of the message, including its URL and optional caption and thumbnail URL.

video.caption?
optional video.caption: string;

An optional caption for the video.

video.thumb_url?
optional video.thumb_url: string;

An optional URL for the video's thumbnail.

video.url
video.url: string;

The URL of the video.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/ViberVideoRequest.ts:13


WhatsAppAudioRequest

type WhatsAppAudioRequest: object;

Represents a request for sending an audio message via the WhatsApp channel.

Type declaration

audio
audio: object;

The audio content of the message, including its URL.

audio.url
audio.url: string;

The URL of the audio.

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "audio";

The type of the message, which is 'audio' for an audio message.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppAudioRequest.ts:11


WhatsAppCustomRequest

type WhatsAppCustomRequest: object;

Represents a request for sending a custom message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

custom
custom: Record<string, unknown>;

The custom content of the message as a record of unknown type.

from
from: string;

The sender's identifier.

message_type
message_type: "custom";

The type of the message, which is 'custom' for a custom message.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppCustomRequest.ts:11


WhatsAppFileRequest

type WhatsAppFileRequest: object;

Represents a request for sending a file message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

file
file: object;

The file content of the message, including the URL of the file and an optional caption.

file.caption?
optional file.caption: string;

An optional caption for the file.

file.url
file.url: string;

The URL of the file to be sent.

from
from: string;

The sender's identifier.

message_type
message_type: "file";

The type of the message, which is 'file' for a file message.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppFileRequest.ts:11


WhatsAppImageRequest

type WhatsAppImageRequest: object;

Represents a request for sending an image message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

image
image: object;

The image content of the message, including the URL of the image and an optional caption.

image.caption?
optional image.caption: string;

An optional caption for the image.

image.url
image.url: string;

The URL of the image to be sent.

message_type
message_type: "image";

The type of the message, which is 'image' for an image message.

to
to: string;

The recipient's identifier.

ttl?
optional ttl: number;

The amount of time in seconds the message will live for

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppImageRequest.ts:11


WhatsAppStickerIdRequest

type WhatsAppStickerIdRequest: object;

Represents a request for sending a sticker message via the WhatsApp channel using a sticker ID.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "sticker";

The type of the message, which is 'sticker' for a sticker message.

sticker
sticker: object;

The sticker content of the message, including the sticker ID.

sticker.id
sticker.id: string;

The ID of the sticker to be sent.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppStickerIdRequest.ts:11


WhatsAppStickerUrlRequest

type WhatsAppStickerUrlRequest: object;

Represents a request for sending a sticker message via the WhatsApp channel using a sticker URL.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "sticker";

The type of the message, which is 'sticker' for a sticker message.

sticker
sticker: object;

The sticker content of the message, including the sticker URL.

sticker.url
sticker.url: string;

The URL of the sticker to be sent.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppStickerUrlRequest.ts:11


WhatsAppTemplateRequest

type WhatsAppTemplateRequest: object;

Represents a request for sending a template message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "template";

The type of the message, which is 'template' for a template message.

template
template: WhatsAppTemplateType;

The template content of the message, including the template type.

to
to: string;

The recipient's identifier.

whatsapp
whatsapp: WhatsAppPolicyType;

The policy and locale settings for sending the WhatsApp template message.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppTemplateRequest.ts:13


WhatsAppTextRequest

type WhatsAppTextRequest: object;

Represents a request for sending a text message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "text";

The type of the message, which is 'text' for a text message.

text
text: string;

The text content of the message.

to
to: string;

The recipient's identifier.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppTextRequest.ts:11


WhatsAppVideoRequest

type WhatsAppVideoRequest: object;

Represents a request for sending a video message via the WhatsApp channel.

Type declaration

channel
channel: "whatsapp";

The channel through which the message will be sent, which is 'whatsapp' for WhatsApp.

client_ref
client_ref: string;

A client-defined reference string for the message.

from
from: string;

The sender's identifier.

message_type
message_type: "video";

The type of the message, which is 'video' for a video message.

to
to: string;

The recipient's identifier.

video
video: object;

The video content of the message, including the URL and an optional caption.

video.caption?
optional video.caption: string;

An optional caption for the video.

video.url
video.url: string;

The URL of the video.

Remarks

Vonage API's will return information using snake_case. This represents the pure response before the client will transform the keys into camelCase.

Defined in

messages/lib/types/Requests/WhatsAppVideoRequest.ts:11

Clone this wiki locally