Clear all callbacks for an event.
the event to unregister from (e.g. 'legStatusUpdate')
void
[[include: snippet_ClearCallbacks.txt]]
This is useful for cleaning up callbacks when you no longer need them.
Create a session with a token and optional sessionId If no sessionId is provided, a new one will be generated and returned. If a sessionId is provided, it will be used to resume an existing session.
Optional
sessionId: null | stringoptional sessionId to use
the sessionId
of the session
[[include: snippet_SessionCreate.txt]]
Get a Conversation
the Conversation's id or conversation name
the Conversation
[[include: snippet_GetConversation.txt]]
Unregister a callback for an event.
the event to register for (e.g. 'legStatusUpdate')
the callback symbol to unregister
true if the callback was unregistered, false otherwise
[[include: snippet_UnregisterListener.txt]]
We recommend deregistering callbacks when you no longer need them.
Register a callback for an event.
the event to register for (e.g. 'legStatusUpdate')
the callback to register for the event
a symbol that can be used to unregister the callback
[[include: snippet_OnConversationEventListener.txt]]
Be sure to store the symbol returned by this method so you can unregister the callback later. We recommend unregistering callbacks when you no longer need them. See off.
Set a configuration for the client SDK
A configuration object
void
[[include: snippet_SetClientConfig.txt]]
Updates a conversation object identified by its unique conversation ID.
This method overrides the conversation properties to the provided parameters and rest remains as it is.
the Conversation's id.
The properties of the conversation. These will replace existing values to the provided ones, rest will remain as they are.
conversation
, this object will contain the updated conversation properties if the update is successful.
[[include: snippet_UpdateConversation.txt]]
Beta
Create a conversation
Optional
parameters: Nullable<CreateConversationParameters>A CreateConversationParameters object containing the parameters for the creation request.
the cid
of the conversation
[[include: snippet_CreateConversation.txt]]
Beta
Create a conversation
Optional
name: stringthe name of the conversation
Optional
displayName: stringthe display name of the conversation
the cid
of the conversation
Use (parameters) instead.
Beta
Get a Conversation's Events
the Conversation's id
Optional
parameters: Nullable<GetConversationEventsParameters>A GetConversationEventsParameters object containing the parameters for the request.
a EventsPage containing the events
[[include: snippet_GetConversationEvents.txt]]
Beta
Get a Conversation's Events
the Conversation's id
Optional
order: PresentingOrderthe order to return the events in (default: 'asc')
Optional
pageSize: numberthe number of events to return per page (default: 100)
Optional
cursor: null | stringthe cursor to use for pagination (default: null)
Optional
eventFilter: null | string[]the event types to filter by (default: null)
Optional
includeDeletedEvents: booleanA boolean, which when sent as true, will include deletedEvents
in the list, default is false
Optional
startId: numberA number, the starting id of the events to be returned (default: null)
a EventsPage containing the events
Use (id, parameters) instead.
Beta
Get a Conversation's Members
the Conversation's id
Optional
parameters: Nullable<GetConversationMembersParameters>A GetConversationMembersParameters object containing the parameters for the request.
a MembersPage
containing the members
[[include: snippet_GetConversationMembers.txt]]
Beta
Get a Conversation's Members
the Conversation's id
Optional
order: PresentingOrderthe order to return the members in (default: 'asc')
Optional
pageSize: numberthe number of members to return per page (default: 100)
Optional
cursor: null | stringthe cursor to use for pagination (default: null)
a MembersPage
containing the members
Use (id, parameters) instead.
Beta
Get a list of Conversations for the user.
Optional
parameters: Nullable<GetConversationsParameters>A GetConversationsParameters object containing the parameters for the request.
a ConversationsPage
containing the conversations
[[include: snippet_GetConversations.txt]]
Beta
Get a list of Conversations for the user.
Optional
order: PresentingOrderthe order to return the conversations in (default: 'asc')
Optional
pageSize: numberthe number of conversations to return per page (default: 100)
Optional
cursor: null | stringthe cursor to use for pagination (default: null)
Optional
includeCustomData: booleaninclude custom data (default: false)
Optional
orderBy: null | OrderByorder by strategy (default: null)
a ConversationsPage
containing the conversations
Use (parameters) instead.
Beta
Send a Custom event to a Conversation
the Conversation's id
the body of the event
the timestamp
of the message
[[include: snippet_SendCustomEvent.txt]]
Beta
Send an ephemeral event to a Conversation
the Conversation's id
the body of the event
the timestamp
of the message
[[include: snippet_SendEphemeralEvent.txt]]
Beta
Send a custom message to a Conversation
the Conversation's id
the body of the message
the timestamp
of the message
[[include: snippet_SendCustomMessage.txt]]
Beta
Send a Location message to a Conversation.
the Conversation's id
the description of the location.
the timestamp
of the message
[[include: snippet_SendLocationMessage.txt]]
Beta
Get a Call's Legs
Optional
parameters: Nullable<GetCallLegsParameters>A GetCallLegsParameters object containing the parameters for the request.
a LegsPage
containing the legs
[[include: snippet_GetCallLegs.txt]]
Hangup a call.
the callId
of the call to hangup
Optional
reasonText: stringoptional reason text to send to the other party
Optional
reasonCode: stringoptional reason code to send to the other party
void
[[include: snippet_CallHangup.txt]]
Sends a TTS message to the Call
the callId
of the call to send the message to
the text to send
void
Sends a TTS message to the Call
the callId
of the call to send the message to
the CallSayParams
to send
void
[[include: snippet_Say.txt]]
Make a server call to the Vonage API. This is used to initiate a call using the Voice API and NCCO.
Optional
context: Jsonthe context to send to the server passed as Custom data to the voice answer webhook
the callId
of the call
[[include: snippet_OutboundCall.txt]]
VonageClient is the main entry point for the Vonage Client SDK.