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]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
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]]
Send a text message to a Conversation
the Conversation's id
the Body of the message
whether to send the text as raw or not (default: false, not recommended)
the timestamp of the message
[[include: snippet_SendTextMessage.txt]]
Starts an emergency call.
Optional options: Nullable<EmergencyCallOptionsJS>Optional EmergencyCallOptions containing call options
the result containing callId and reconnectToken
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.