-
Notifications
You must be signed in to change notification settings - Fork 183
Vonage Conversations
Documentation / Vonage Conversations
Defined in: conversations/lib/enums/channelType.ts:4
Enum representing the type of communication channel.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
APP
|
"app" |
Represents an app channel. | conversations/lib/enums/channelType.ts:18 |
PHONE
|
"phone" |
Represents a phone channel. | conversations/lib/enums/channelType.ts:8 |
SIP
|
"sip" |
Represents a SIP channel. | conversations/lib/enums/channelType.ts:13 |
VBC
|
"vbc" |
Represents a VBC (Voice Business Cloud) channel. | conversations/lib/enums/channelType.ts:28 |
WEBSOCKET
|
"websocket" |
Represents a WebSocket channel. | conversations/lib/enums/channelType.ts:23 |
Defined in: conversations/lib/enums/conversationState.ts:4
Conversation state
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
ACTIVE
|
"ACTIVE" |
Conversation is still active | conversations/lib/enums/conversationState.ts:8 |
DELETED
|
"DELETED" |
Conversation is deleted | conversations/lib/enums/conversationState.ts:18 |
INACTIVE
|
"INACTIVE" |
Conversation is inactive | conversations/lib/enums/conversationState.ts:13 |
Defined in: conversations/lib/enums/eventMessageType.ts:1
Enumeration Member | Value | Defined in |
---|---|---|
AUDIO
|
"audio" |
conversations/lib/enums/eventMessageType.ts:4 |
CUSTOM
|
"custom" |
conversations/lib/enums/eventMessageType.ts:8 |
FILE
|
"file" |
conversations/lib/enums/eventMessageType.ts:6 |
IMAGE
|
"image" |
conversations/lib/enums/eventMessageType.ts:3 |
LOCATION
|
"location" |
conversations/lib/enums/eventMessageType.ts:10 |
RANDOM
|
"random" |
conversations/lib/enums/eventMessageType.ts:11 |
TEMPLATE
|
"template" |
conversations/lib/enums/eventMessageType.ts:7 |
TEXT
|
"text" |
conversations/lib/enums/eventMessageType.ts:2 |
VCARD
|
"vcard" |
conversations/lib/enums/eventMessageType.ts:9 |
VIDEO
|
"video" |
conversations/lib/enums/eventMessageType.ts:5 |
Defined in: conversations/lib/enums/eventsTypes.ts:4
Enum representing various types of events and their descriptions.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
AUDIO_DTMF
|
"audio:dtmf" |
Audio: Play DTMF audio | conversations/lib/enums/eventsTypes.ts:28 |
AUDIO_EAR_MUFF_OFF
|
"audio:earmuff:off" |
Audio: Earmuff audio | conversations/lib/enums/eventsTypes.ts:58 |
AUDIO_EAR_MUFF_ON
|
"audio:earmuff:on" |
Audio: Earmuff audio | conversations/lib/enums/eventsTypes.ts:53 |
AUDIO_MUTE_OFF
|
"audio:mute:off" |
Audio: Unmute audio | conversations/lib/enums/eventsTypes.ts:48 |
AUDIO_MUTE_ON
|
"audio:mute:on" |
Audio: Mute audio | conversations/lib/enums/eventsTypes.ts:43 |
AUDIO_PLAY
|
"audio:play" |
Audio: Play audio | conversations/lib/enums/eventsTypes.ts:8 |
AUDIO_PLAY_STOP
|
"audio:play:stop" |
Audio: Stop currently playing audio | conversations/lib/enums/eventsTypes.ts:13 |
AUDIO_RECORD
|
"audio:record" |
Audio: Record the audio in the conversation | conversations/lib/enums/eventsTypes.ts:33 |
AUDIO_RECORD_STOP
|
"audio:record:stop" |
Audio: Stop current recording of audio | conversations/lib/enums/eventsTypes.ts:38 |
AUDIO_SAY
|
"audio:say" |
Audio: Use TTS to speak the given text | conversations/lib/enums/eventsTypes.ts:18 |
AUDIO_SAY_STOP
|
"audio:say:stop" |
Audio: Stop currently playing TTS | conversations/lib/enums/eventsTypes.ts:23 |
AUDIO_SPEAKING_OFF
|
"audio:speaking:off" |
Audio: Speaking on | conversations/lib/enums/eventsTypes.ts:68 |
AUDIO_SPEAKING_ON
|
"audio:speaking:on" |
Audio: Speaking on | conversations/lib/enums/eventsTypes.ts:63 |
CUSTOM
|
"custom" |
Custom: Custom event | conversations/lib/enums/eventsTypes.ts:73 |
EPHEMERAL
|
"ephemeral" |
Ephemeral: Ephemeral | conversations/lib/enums/eventsTypes.ts:78 |
MESSAGE
|
"message" |
Message: Message (Text, Image, Audio, Video, File, Template, Custom, VCard, Location, Random) | conversations/lib/enums/eventsTypes.ts:83 |
MESSAGE_DELIVERED
|
"message:delivered" |
Message: Message delivered | conversations/lib/enums/eventsTypes.ts:108 |
MESSAGE_REJECTED
|
"message:rejected" |
Message: Message rejected | conversations/lib/enums/eventsTypes.ts:93 |
MESSAGE_SEEN
|
"message:seen" |
Message: Message seen | conversations/lib/enums/eventsTypes.ts:103 |
MESSAGE_SUBMITTED
|
"message:submitted" |
Message: Message submitted | conversations/lib/enums/eventsTypes.ts:88 |
MESSAGE_UNDELIVERABLE
|
"message:undeliverable" |
Message: Message undeliverable | conversations/lib/enums/eventsTypes.ts:98 |
Defined in: conversations/lib/enums/legStatus.ts:4
The status of a leg
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
ANSWERED
|
"answered" |
The leg is answered | conversations/lib/enums/legStatus.ts:18 |
RINGING
|
"ringing" |
The leg is ringing | conversations/lib/enums/legStatus.ts:13 |
STARTED
|
"started" |
The leg is started | conversations/lib/enums/legStatus.ts:8 |
Defined in: conversations/lib/enums/memberState.ts:4
Enum representing the state of a member.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
INVITED
|
"INVITED" |
The member has been invited to join the conversation. | conversations/lib/enums/memberState.ts:8 |
JOINED
|
"JOINED" |
The member has joined the conversation. | conversations/lib/enums/memberState.ts:13 |
LEFT
|
"LEFT" |
The member has left the conversation. | conversations/lib/enums/memberState.ts:18 |
UNKNOWN
|
"UNKNOWN" |
The state of the member is unknown or undefined. | conversations/lib/enums/memberState.ts:23 |
Defined in: conversations/lib/enums/reasonMessages.ts:4
Enum representing various reasons
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
ADDRESS_INCOMPLETE
|
"address_incomplete" |
Address incomplete. | conversations/lib/enums/reasonMessages.ts:83 |
BAD_EXTENSION
|
"bad_extension" |
Bad extension. | conversations/lib/enums/reasonMessages.ts:48 |
BAD_GATEWAY
|
"bad_gateway" |
Bad gateway. | conversations/lib/enums/reasonMessages.ts:78 |
BANNED_CALL_ENDED
|
"banned_call_ended" |
Call ended due to being banned. | conversations/lib/enums/reasonMessages.ts:118 |
BUSY
|
"busy" |
The recipient is currently busy. | conversations/lib/enums/reasonMessages.ts:13 |
BUSY_HERE
|
"busy_here" |
Recipient is busy here. | conversations/lib/enums/reasonMessages.ts:53 |
CANCELLED
|
"cancelled" |
The request was cancelled. | conversations/lib/enums/reasonMessages.ts:23 |
FAILED
|
"failed" |
General failure. | conversations/lib/enums/reasonMessages.ts:8 |
FLOW_FAILED
|
"flow_failed" |
Flow execution failed. | conversations/lib/enums/reasonMessages.ts:123 |
FORBIDDEN
|
"forbidden" |
Forbidden access. | conversations/lib/enums/reasonMessages.ts:68 |
GONE
|
"gone" |
Resource has gone away. | conversations/lib/enums/reasonMessages.ts:73 |
NOT_FOUND
|
"not_found" |
Resource not found. | conversations/lib/enums/reasonMessages.ts:38 |
NOT_IMPLEMENTED
|
"not_implemented" |
Not implemented. | conversations/lib/enums/reasonMessages.ts:93 |
OK
|
"ok" |
Operation was successful. | conversations/lib/enums/reasonMessages.ts:33 |
PAYMENT_REQUIRED
|
"payment_required" |
Payment is required. | conversations/lib/enums/reasonMessages.ts:113 |
REJECTED
|
"rejected" |
The request was rejected. | conversations/lib/enums/reasonMessages.ts:28 |
REQUEST_TERMINATED
|
"request_terminated" |
Request terminated. | conversations/lib/enums/reasonMessages.ts:43 |
REQUEST_TIMEOUT
|
"request_timeout" |
Request timeout. | conversations/lib/enums/reasonMessages.ts:58 |
SERVER_INTERNAL_ERROR
|
"server_internal_error" |
Internal server error. | conversations/lib/enums/reasonMessages.ts:88 |
SERVER_TIMEOUT
|
"server_timeout" |
Server timeout. | conversations/lib/enums/reasonMessages.ts:98 |
SERVICE_UNAVAILABLE
|
"service_unavailable" |
Service is unavailable. | conversations/lib/enums/reasonMessages.ts:108 |
TEMPORARILY_UNAVAILABLE
|
"temporarily_unavailable" |
Temporarily unavailable. | conversations/lib/enums/reasonMessages.ts:63 |
TIMEOUT
|
"timeout" |
Operation timed out. | conversations/lib/enums/reasonMessages.ts:18 |
VERSION_NOT_SUPPORTED
|
"version_not_supported" |
Version not supported. | conversations/lib/enums/reasonMessages.ts:103 |
Defined in: conversations/lib/conversations.ts:173
A client for talking to the Vonage Conversation API.
Create a standalone Conversation client
import { Conversations } from '@vonage/conversation';
const conversationClient = new Conversations({
applicationId: VONAGE_APPLICATION_ID,
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
});
Create an Conversation client from the Vonage client
import { Vonage } from '@vonage/server-client';
const vonage = new Vonage({
applicationId: VONAGE_APPLICATION_ID,
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
});
const conversationClient = vonage.conversations
new Conversations(credentials, options?): Conversations
Defined in: server-client/dist/lib/client.d.ts:35
Creates a new instance of the Client.
The authentication credentials or an authentication instance.
Optional configuration settings for the client.
protected auth: AuthInterface;
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
authType: AuthenticationType = AuthenticationType.JWT;
Defined in: conversations/lib/conversations.ts:174
The type of authentication used for the client's requests.
protected config: ConfigParams;
Defined in: server-client/dist/lib/client.d.ts:28
Configuration settings for the client, including default hosts for various services and other request settings.
static transformers: object;
Defined in: server-client/dist/lib/client.d.ts:11
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
string
[]
snakeCaseObjectKeys: PartialTransformFunction;
addAuthenticationToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:43
Adds the appropriate authentication headers or parameters to the request based on the authentication type.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addAuthenticationToRequest
protected addBasicAuthToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:71
Adds basic authentication headers to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addJWTToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:64
Adds a JWT to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:57
Adds API key and secret to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequest
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:50
Adds API key and secret to the request body.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequestBody
createConversation(conversation): Promise<Conversation>
Defined in: conversations/lib/conversations.ts:273
Creates a new conversation with the provided details.
The conversation details to be created.
Promise
<Conversation
>
- A promise resolving to the created conversation.
API Specification https://developer.vonage.com/en/api/conversation#createConversation
Create a new conversation
const conversation = await conversationClient.createConversation({
name: 'My Conversation',
});
console.log(conversation.id);
createEvent(conversationId, event): Promise<Event>
Defined in: conversations/lib/conversations.ts:806
Creates a new event with the provided details.
string
The conversation id to create the event in.
The event details to be created.
Promise
<Event
>
- A promise resolving to the created event.
API Specification https://developer.vonage.com/en/api/event#createEvent
Create a new event
const event = await eventClient.createEvent({
name: 'My Event',
});
console.log(event.id);
createMember(conversationId, member): Promise<Member>
Defined in: conversations/lib/conversations.ts:577
Creates a new member with the provided details.
string
The conversation id to create the member in.
The member details to be created.
Promise
<Member
>
- A promise resolving to the created member.
API Specification https://developer.vonage.com/en/api/conversation#createMember
Create a new member
const member = await memberClient.createMember(
CONVERSATION_ID,
{
name: 'My Member',
},
);
console.log(member.id);
deleteConversation(conversationId): Promise<void>
Defined in: conversations/lib/conversations.ts:354
Deletes an conversation by its unique identifier.
string
The unique identifier of the conversation to delete.
Promise
<void
>
- A promise indicating the successful deletion of the conversation.
API Specification https://developer.vonage.com/en/api/conversation#deleteConversation
Delete an conversation
await conversationClient.deleteConversation(conversation_ID);
deleteEvent(conversationId, eventId): Promise<void>
Defined in: conversations/lib/conversations.ts:839
Deletes an event by its unique identifier.
string
The conversation id to delete the event from.
string
The unique identifier of the conversation to delete.
Promise
<void
>
- A promise indicating the successful deletion of the event.
API Specification https://developer.vonage.com/en/api/event#deleteEvent
Delete an event
await eventClient.deleteEvent(conversation_ID);
getConfig(): ConfigParams
Defined in: server-client/dist/lib/client.d.ts:36
getConversation(conversationId): Promise<Conversation>
Defined in: conversations/lib/conversations.ts:300
Retrieves an conversation by its unique identifier.
string
The unique identifier of the conversation to retrieve.
Promise
<Conversation
>
- A promise resolving to the retrieved conversation.
API Specification https://developer.vonage.com/en/api/conversation#getConversation
Retrieve an conversation
const conversation = await conversationClient.getConversation(conversation_ID);
console.log(conversation.name);
getConversationPage(filter): Promise<ConversationPage>
Defined in: conversations/lib/conversations.ts:230
Retrieves a page of conversations based on filter parameters.
The filter parameters for pagination.
Promise
<ConversationPage
>
- A promise resolving to a page of conversations.
API Specification https://developer.vonage.com/en/api/conversation#listConversation
Get a single page of conversations
const conversations = await conversationClient.getConversationPage({
page: 1,
size: 10
});
conversations.conversations.forEach(conversation => {
console.log(conversation.name);
});
getEvent(conversationId, eventId): Promise<Event>
Defined in: conversations/lib/conversations.ts:775
Retrieves an event by its unique identifier.
string
The conversation id to retrieve the event from.
string
The unique identifier of the event to retrieve.
Promise
<Event
>
- A promise resolving to the retrieved event.
API Specification https://developer.vonage.com/en/api/conversation#getEvent
Retrieve an event
const event = await eventClient.getEvent(CONVERSATION_ID, event_ID);
console.log(event.name);
getEventPage(conversationId, filter): Promise<EventPage>
Defined in: conversations/lib/conversations.ts:737
Retrieves a page of events based on filter parameters.
string
The conversation id to retrieve events from.
The filter parameters for pagination.
Promise
<EventPage
>
- A promise resolving to a page of events.
API Specification https://developer.vonage.com/en/api/event#listEvent
Get a single page of events
const events = await eventClient.getEventPage({
page: 1,
size: 10
});
events.events.forEach(event => {
console.log(event.name);
});
getMe(conversationId): Promise<Member>
Defined in: conversations/lib/conversations.ts:633
This retrieves the member associated with the sub claim on the JWT
string
The conversation id to retrieve the member from.
Promise
<Member
>
- A promise resolving to the retrieved member.
API Specification https://developer.vonage.com/en/api/conversation#getMe
Retrieve an member
const member = await memberClient.getMe(CONVERSATION_ID);
console.log(member.name);
getMember(conversationId, memberId): Promise<Member>
Defined in: conversations/lib/conversations.ts:606
Retrieves an member by its unique identifier.
string
The conversation id to retrieve the member from.
string
The unique identifier of the member to retrieve.
Promise
<Member
>
- A promise resolving to the retrieved member.
API Specification https://developer.vonage.com/en/api/conversation#getMember
Retrieve an member
const member = await memberClient.getMember(CONVERSATION_ID, MEMBER_ID);
console.log(member.name);
getMemberPage(conversationId, filter): Promise<MemberPage>
Defined in: conversations/lib/conversations.ts:536
Retrieves a page of members in a conversation based on filter parameters.
string
The conversation id to retrieve members from.
ListMemberParameters
= {}
The filter parameters for pagination.
Promise
<MemberPage
>
- A promise resolving to a page of members.
API Specification https://developer.vonage.com/en/api/conversation#listMember
Get a single page of members
const members = await memberClient.getMemberPage(
CONVERSATION_ID,
{
page: 1,
size: 10
}
);
members.members.forEach(member => {
console.log(member.name);
});
getUserSessionsPage(userId, filter): Promise<SessionPage>
Defined in: conversations/lib/conversations.ts:457
Retrieves a page of sessions based on filter parameters.
string
The user id to retrieve sessions from.
The filter parameters for pagination.
Promise
<SessionPage
>
- A promise resolving to a page of sessions.
API Specification https://developer.vonage.com/en/api/session#listSession
Get a single page of sessions
const sessions = await conversationClient.getUserSessionPage(
USER_ID,
{
page: 1,
size: 10
}
);
sessions.sessions.forEach(session => {
console.log(session.id);
});
listAllConversations(params?): AsyncGenerator<Conversation, void & Conversation, undefined>
Defined in: conversations/lib/conversations.ts:192
Retrieves all conversations, iterating over paginated results.
ListConversationsParameters
= {}
Optional filter parameters.
AsyncGenerator
<Conversation
, undefined
>
- An asynchronous generator.
- Yields conversation items.
List conversations with pagination using an iterator
for await (const conversation of conversationClient.listAllConversations()) {
console.log(conversation.name);
}
listAllEvents(conversationId, params?): AsyncGenerator<Event, void & Event, undefined>
Defined in: conversations/lib/conversations.ts:697
Retrieves all events, iterating over paginated results.
string
The conversation id to retrieve events from.
ListEventParameters
= {}
Optional filter parameters.
AsyncGenerator
<Event
, undefined
>
- An asynchronous generator.
- Yields event items.
List events with pagination using an iterator
for await (const event of eventClient.listAllEvents()) {
console.log(event.name);
}
listAllMembers(conversationId, params?): AsyncGenerator<Member, void & Member, undefined>
Defined in: conversations/lib/conversations.ts:493
Retrieves all members, iterating over paginated results.
string
The conversation id to retrieve members from.
ListMemberParameters
= {}
Optional filter parameters.
AsyncGenerator
<Member
, undefined
>
- An asynchronous generator.
- Yields member items.
List members with pagination using an iterator
for await (const member of memberClient.listAllMembers(CONVERSATION_ID)) {
console.log(member.name);
}
listAllUserConversations(userId, params?): AsyncGenerator<Conversation, void & Conversation, undefined>
Defined in: conversations/lib/conversations.ts:377
Retrieves all conversations, for a user
string
The user id to retrieve conversations from.
ListConversationsParameters
= {}
Optional filter parameters.
AsyncGenerator
<Conversation
, undefined
>
- An asynchronous generator.
- Yields conversation items.
List conversations with pagination using an iterator
for await (const conversation of conversationClient.listAllUserConversations(USER_ID)) {
console.log(conversation.name);
}
listAllUserSessions(userId, params?): AsyncGenerator<Session, void & Session, undefined>
Defined in: conversations/lib/conversations.ts:414
Retrieves all session, for a user
string
The user id to retrieve sessions from.
Optional filter parameters.
AsyncGenerator
<Session
, undefined
>
- An asynchronous generator.
- Yields session items.
List sessions with pagination using an iterator
for await (const session of conversationClient.listAllUserSessions(USER_ID)) {
console.log(session.id);
}
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:168
Parses the response based on its content type.
• T
The expected type of the parsed response data.
The request options.
Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
protected prepareBody(request): undefined | string
Defined in: server-client/dist/lib/client.d.ts:158
Prepares the body for the request based on the content type.
The request options.
undefined
| string
- The prepared request body as a string or undefined.
protected prepareRequest(request): Promise<VetchOptions>
Defined in: server-client/dist/lib/client.d.ts:151
Prepares the request with necessary headers, authentication, and query parameters.
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:78
Sends a DELETE request to the specified URL.
• T
string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:86
Sends a POST request with form data to the specified URL.
• T
string
The URL endpoint for the POST request.
Record
<string
, undefined
| string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:94
Sends a GET request to the specified URL with optional query parameters.
• T
string
The URL endpoint for the GET request.
Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.
Promise
<VetchResponse
<T
>>
- The response from the GET request.
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:104
Sends a PATCH request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PATCH request.
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:114
Sends a POST request to the specified URL with an optional payload.
• T
string
The URL endpoint for the POST request.
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:124
Sends a PUT request to the specified URL with an optional payload.
• T
string
The URL endpoint for the PUT request.
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
sendRequest<T>(request): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:144
Sends a request adding necessary headers, handling authentication, and parsing the response.
• T
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>
Defined in: server-client/dist/lib/client.d.ts:135
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
• T
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
string
The URL endpoint for the request.
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
updateConversation(conversation): Promise<Conversation>
Defined in: conversations/lib/conversations.ts:329
Updates an existing conversation with the provided details.
The conversation details to be updated.
Promise
<Conversation
>
- A promise resolving to the updated conversation.
API Specification https://developer.vonage.com/en/api/conversation#updateConversation
Update an conversation
const conversation = await conversationClient.updateConversation({
id: conversation_ID,
name: 'My Conversation',
});
console.log(conversation.name);
updateMember(
conversationId,
memberId,
params): Promise<Member>
Defined in: conversations/lib/conversations.ts:667
Updates an existing member with the provided details.
Setting the state to left will result in the member leaving the conversation.
string
The conversation id to update the member in.
string
The member details to be updated.
The update parameters.
Promise
<Member
>
- A promise resolving to the updated member.
API Specification https://developer.vonage.com/en/api/conversation#updateMember
import { MemberState } from '@vonage/conversation';
const member = await memberClient.updateMember(
CONVERSATION_ID,
MEMBER_ID,
{
state: MemberState.LEFT,
from: USER_ID,
},
);
console.log(member.name);
type AnyChannel =
| PhoneNumberChannel
| SipChannel
| AppChannel
| WebSocketChannel
| VbcChannel;
Defined in: conversations/lib/types/anyChannel.ts:7
type AnyMessageBody =
| MessageASRBody
| MessageChannelBody
| MessageConversationBody
| MessageCustomBody
| MessageEventBody
| MessageFileBody
| MessageImageBody
| MessageLegBody
| MessageLocationBody
| MessageMemberBody
| MessageRTCAnswerBody
| MessageRTCIdBody
| MessageRecordBody
| MessageRecordIdBody
| MessageSIPDirectionBody
| MessageSIPHangupBody
| MessageSIPMachineBody
| MessageSIPStatusBody
| MessageSayBody
| MessageSayIdBody
| MessageStatusBody
| MessageTemplateBody
| MessageTextBody
| MessageVCardBody
| MessageVideoBody
| MessageAudioBody;
Defined in: conversations/lib/types/anyMessageBody.ts:29
type AnyMessageBodyResponse = { [P in keyof AnyMessageBody as SnakeToCamelCase<P>]: AnyMessageBody[P] };
Defined in: conversations/lib/types/responses/eventResponse.ts:14
type AppChannel = object;
Defined in: conversations/lib/types/appChannel.ts:6
Type representing an app channel.
type: APP;
The type of channel (app).
user: string;
The app user.
type ASRResult = object;
Defined in: conversations/lib/types/messageASRBody.ts:3
confidence: number;
Confidence of the word
word: string;
Word recognized
type AudioSettings = object;
Defined in: conversations/lib/types/audioSettings.ts:4
Type representing audio settings.
earmuffed: boolean;
Indicates whether audio is earmuffed.
enabled: boolean;
Indicates whether audio is enabled.
muted: boolean;
Indicates whether audio is muted.
type AudioSettingsRequest = object;
Defined in: conversations/lib/types/requests/createMemberRequest.ts:4
audio: boolean;
Indicates whether audio is active.
earmuffed: boolean;
Indicates whether audio is earmuffed.
enabled: boolean;
Indicates whether audio is enabled.
muted: boolean;
Indicates whether audio is muted.
type AudioSettingsResponse = object;
Defined in: conversations/lib/types/responses/memberResponse.ts:6
audio: boolean;
Indicates whether audio is active.
earmuffed: boolean;
Indicates whether audio is earmuffed.
enabled: boolean;
Indicates whether audio is enabled.
muted: boolean;
Indicates whether audio is muted.
type Conversation = object;
Defined in: conversations/lib/types/conversation.ts:8
Represents a conversation
optional callback: ConversationCallback;
Callback information (optional).
This is not set when fetching a converstion from the API.
optional displayName: string;
The public-facing name of the conversation.
readonly optional id: string;
The unique identifier for this conversation.
optional imageUrl: string;
An image URL associated with the conversation.
optional name: string;
Your internal conversation name. Must be unique.
optional numbers: AnyChannel[];
Communication channels (optional).
This is not set when fetching a converstion from the API.
optional properties: object;
The conversation's properties
properties.customData: Record<string, unknown>;
Custom key-value pairs to be included with the conversation.
properties.customSortKey: string;
The conversation's custom sort key.
optional properties.ttl: number;
The conversation's time to leave.
After how many seconds the conversation is deleted.
properties.type: string;
The conversation's type.
readonly optional sequenceNumber: number;
The last Event ID in this conversation.
This ID can be used to retrieve a specific event.
optional state: ConversationState;
The conversation's state.
readonly optional status: ConversationState;
The conversation's status.
readonly optional timestamp: object;
Timestamps for when the conversation was created, updated, and destroyed.
readonly optional timestamp.created: string;
The time the conversation was created.
readonly optional timestamp.destroyed: string;
The time the conversation was destroyed (if applicable).
readonly optional timestamp.updated: string;
The time the conversation was last updated.
type ConversationCallback = object;
Defined in: conversations/lib/types/conversationCallback.ts:5
Type representing a callback object in a conversation request.
optional eventMask: string;
The event mask for the callback.
optional method: "POST" | "GET";
The callback method.
optional params: object;
Callback parameters.
optional params.applicationId: string;
The application ID for the callback.
optional params.nccoUrl: string;
The NCCO URL for the callback.
optional url: string;
The callback URL.
type ConversationCallbackRequest = object;
Defined in: conversations/lib/types/requests/conversationCallbackRequest.ts:4
Type representing a callback object in a conversation request.
optional event_mask: string;
The event mask for the callback.
method: "POST" | "GET";
The callback method.
optional params: object;
Callback parameters.
optional params.applicationId: string;
The application ID for the callback.
optional params.ncco_url: string;
The NCCO URL for the callback.
optional url: string;
The callback URL.
type ConversationPage = object;
Defined in: conversations/lib/types/conversationPage.ts:7
A page of conversations.
conversations: Conversation[];
Conversations for the page.
optional links: Record<string, APILink>;
HAL links for the page.
pageSize: number;
How many items are in the page.
type ConversationPageResponse = object & APILinks;
Defined in: conversations/lib/types/responses/conversationPageResponse.ts:7
Represents the response for listing conversations retrieved from the API.
_embedded: object;
Embedded data containing a list of conversations.
_embedded.conversations: ConversationResponse[];
page_size: number;
The number of records returned in this response.
type ConversationResponse = object & Omit<Conversation, "sequenceNumber" | "displayName" | "imageUrl" | "properties"> & APILinks;
Defined in: conversations/lib/types/responses/conversationResponse.ts:7
Represents a conversation as it is returned from the API.
optional display_name: string;
The public-facing name of the conversation.
optional image_url: string;
An image URL associated with the conversation.
optional properties: object;
The conversation's properties
properties.custom_data: Record<string, unknown>;
Custom key-value pairs to be included with the conversation.
properties.custom_sort_key: string;
The conversation's custom sort key.
optional properties.ttl: number;
The conversation's time to leave.
After how many seconds the conversation is deleted.
properties.type: string;
The conversation's type.
sequence_number: number;
The last Event ID in this conversation. This ID can be used to retrieve a specific event.
type CreateConversationRequest = object;
Defined in: conversations/lib/types/requests/createConversationRequest.ts:11
Type representing a request to create a conversation.
optional callback: ConversationCallbackRequest;
Callback information (optional).
display_name: string;
The public-facing name of the conversation.
image_url: string;
An image URL associated with the conversation.
name: string;
Your internal conversation name.
optional numbers: (
| PhoneNumberChannel
| SipChannel
| AppChannel
| WebSocketChannel
| VbcChannel)[];
Communication channels (optional).
optional properties: object;
Conversation properties (optional).
optional properties.custom_data: Record<string, unknown>;
Custom data as key-value pairs (optional).
optional properties.custom_sort_key: string;
Custom sort key (optional).
optional properties.ttl: number;
Time to leave in seconds for an empty conversation (optional).
optional properties.type: string;
Custom conversation type (optional).
type CreateEventRequest = object & Pick<Event, "type" | "from">;
Defined in: conversations/lib/types/requests/createEventRequest.ts:4
body: AnyMessageBodyResponse;
type CreateMemberRequest = object;
Defined in: conversations/lib/types/requests/createMemberRequest.ts:29
A Member as its sent to the API
channel: AnyChannel;
The channel associated with the member.
from: string;
The user who invited the member.
knocking_id: string;
The knocking ID for the member.
media: object;
Media-related information for the member.
media.audio: boolean;
Indicates whether the member has audio.
media.audio_settings: AudioSettingsRequest;
Audio settings for the member.
member_id_inviting: string;
The member who invited the member.
state: MemberState;
The member's state
user: object;
The matching user for this member.
user.id: string;
The user's ID.
user.name: string;
The user's name.
type Event = object;
Defined in: conversations/lib/types/event.ts:5
body: AnyMessageBody;
Data of the event.
from: string;
Member ID of the event.
optional fromMember: object;
Sender Memeber
fromMember.id: string;
Member ID
optional fromUser: EventUser;
Sender User
id: number;
The ID of the message.
optional timestamp: string;
Timestamp of the event.
type: EventType;
Message type
type EventPage = object;
Defined in: conversations/lib/types/eventPage.ts:4
events: Event[];
Embedded events.
optional links: Record<string, APILink>;
Links to other resources.
pageSize: number;
The number of items returned on this page.
type EventPageResponse = object & APILinks;
Defined in: conversations/lib/types/responses/eventPageResponse.ts:4
_embedded: EventResponse[];
Embedded events.
page_size: number;
The number of items returned on this page.
type EventResponse = object & Omit<Event, "fromUser" | "body" | "fromMember"> & APILinks;
Defined in: conversations/lib/types/responses/eventResponse.ts:18
_embedded: object;
_embedded.from_member: object;
_embedded.from_member.id: string;
_embedded.from_user: EventUserResponse;
body: AnyMessageBodyResponse;
type EventUser = object;
Defined in: conversations/lib/types/eventUser.ts:1
optional customData: Record<string, unknown>;
The user's custom data.
displayName: string;
The user's display name.
id: string;
The user's ID.
optional imageUrl: string;
The user's avatar URL.
name: string;
The user's name.
type EventUserResponse = object & Omit<EventUser, "displayName">;
Defined in: conversations/lib/types/responses/eventResponse.ts:10
display_name: string;
type InitiatorInvited = object;
Defined in: conversations/lib/types/member.ts:31
invited: object;
Details about the initiator when the member invited.
invited.isSystem: boolean;
true if the user was invited by an admin JWT
type InitiatorInvitedResponse = object;
Defined in: conversations/lib/types/responses/memberResponse.ts:56
Type representing the invited initiator as its returned from the API.
invited: object;
Details about the initiator when the member invited.
invited.is_system: boolean;
true if the user was invited by an admin JWT
type InitiatorJoined = object;
Defined in: conversations/lib/types/member.ts:9
Type representing the joined initiator.
joined: object;
Details about the initiator when the member joined.
joined.isSystem: boolean;
true if the user was invited by an admin JWT
joined.memberId: string;
The member ID of the initiator.
joined.userId: string;
The user ID of the initiator.
type InitiatorJoinedResponse = object;
Defined in: conversations/lib/types/responses/memberResponse.ts:31
Type representing the joined initiator as its returned from the API.
joined: object;
Details about the initiator when the member joined.
joined.is_system: boolean;
true if the user was invited by an admin JWT
joined.member_id: string;
The member ID of the initiator.
joined.user_id: string;
The user ID of the initiator.
type LegState = object;
Defined in: conversations/lib/types/messageLegBody.ts:5
optional reason: ReasonCode;
Reason code of the message leg
status: LegStatus;
Status of the message leg
optional succssful: boolean;
If the leg is successful
type ListConversationsParameters = object;
Defined in: conversations/lib/types/parameters/listConversationsParameters.ts:4
Represents the query parameters for listing conversations.
optional byUser: string;
Return the records that were created by this user.
optional cursor: string;
The cursor to start returning results from. You are not expected to provide this manually but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.
When using the generator from the client, this is handled for you.
optional dateEnd: string;
Return the records that occurred before this point in time.
optional dateStart: string;
Return the records that occurred after this point in time.
optional includeCustomData: boolean;
Include custom data for the conversation
optional order: "asc" | "desc";
Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.
optional pageSize: number;
Return this amount of records in the response.
type ListEventParameters = object;
Defined in: conversations/lib/types/parameters/listEventParameters.ts:4
List Event Parameters
optional cursor: string;
The cursor to start returning results from. You are not expected to provide this manually, but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.
optional endId: string;
The ID to end returning events at.
optional eventType: string;
The type of event to search for. Does not currently support custom events.
optional excludeDeletedEvents: boolean;
Exclude deleted events.
optional order: "asc" | "desc";
Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.
optional pageSize: number;
Return this amount of records in the response.
optional startId: string;
The ID to start returning events at.
type ListMemberParameters = object;
Defined in: conversations/lib/types/parameters/listMemberParameters.ts:1
optional cursor: string;
Return the records starting from this cursor
You are not expected to provide this manually, but to follow the url provided in _links.next.href or _links.prev.href in the response which contains a cursor value.
optional order: "asc" | "desc";
Return the records in ascending or descending order
optional pageSize: number;
Return this number of members
type ListMemberResponse = object & APILinks;
Defined in: conversations/lib/types/responses/listMemberResponse.ts:9
A Mmbmer as its returned from the API in the listMembers
_embedded: object;
_embedded.user: MemberUserResponse;
The matching user for this member.
id: string;
The member's id
state: MemberState;
The member's state
type ListSessionParameters = object;
Defined in: conversations/lib/types/parameters/listSessionParameters.ts:1
optional cursor: string;
The cursor to start returning results from.
You are not expected to provide this manually but to follow the URL provided in _links.next.href or _links.prev.href in the response which contains a cursor value.
When using the generator from the client, this is handled for you.
optional order: "asc" | "desc";
Return the records in ascending or descending order.
optional pageSize: number;
Return the records per page
type Member = object;
Defined in: conversations/lib/types/member.ts:46
Type representing a member in a conversation.
optional channel: AnyChannel;
The channel associated with the member.
optional conversationId: string;
optional id: string;
The unique ID of the member.
optional initiator:
| InitiatorJoined
| InitiatorInvited;
The initiator of the member's joining.
invitedBy: string;
The user who invited the member.
knockingId: string;
The knocking ID for the member.
optional media: object;
Media-related information for the member.
media.audio: boolean;
Indicates whether audio is active.
media.audioSettings: AudioSettings;
Audio settings for the member.
optional state: MemberState;
The state of the member (INVITED, JOINED, LEFT, UNKNOWN).
optional timestamp: object;
Timestamps for various states of the member.
timestamp.invited: string;
Timestamp when the member was invited.
timestamp.joined: string;
Timestamp when the member joined.
timestamp.left: string;
Timestamp when the member left.
user: UserType;
The user associated with the member.
Either the user id or name is required.
type MemberPage = object;
Defined in: conversations/lib/types/memberPage.ts:4
optional links: Record<string, APILink>;
HAL links for the page.
members: Member[];
The list of members.
pageSize: number;
The list of members.
type MemberPageResponse = object & APILinks;
Defined in: conversations/lib/types/responses/memberPageResponse.ts:5
_embedded: object;
HAL Page response
_embedded.members: ListMemberResponse[];
The members in the page.
page_size: number;
Number of members in the page.
type MemberResponse = object & APILinks;
Defined in: conversations/lib/types/responses/memberResponse.ts:71
A Mmbmer as its returned from the API
_embedded: object;
_embedded.user: MemberUserResponse;
The matching user for this member.
channel: AnyChannel;
The channel associated with the member.
id: string;
The member's id
initiator:
| InitiatorJoinedResponse
| InitiatorInvitedResponse;
The initiator of the member's joining.
invited_by: string;
The user who invited the member.
knocking_id: string;
The knocking ID for the member.
media: object;
Media-related information for the member.
media.audio: boolean;
Indicates whether audio is active.
media.audio_settings: AudioSettingsResponse;
Audio settings for the member.
state: MemberState;
The member's state
timestamp: object;
Timestamps for various states of the member.
timestamp.invited: string;
Timestamp when the member was invited.
timestamp.joined: string;
Timestamp when the member joined.
timestamp.left: string;
Timestamp when the member left.
type MemberUserResponse = object & APILinks;
Defined in: conversations/lib/types/responses/memberUserResponse.ts:6
The user as its returned from the API
display_name: string;
A string to be displayed for the user. This does not have to be unique.
id: string;
The user's id
name: string;
The Unique name for the user
type MessageASRBody = object;
Defined in: conversations/lib/types/messageASRBody.ts:15
asr: object;
ASR Result
asr.asrId: string;
ASR Id
asr.callId: string;
ASR Call Id
optional asr.endTime: string;
ASR End Time
Present only when recording is done
asr.error: string;
ASR Error
optional asr.format: string;
ASR Audio Format
Present only when recording is done
optional asr.mediaServiceUUID: string;
ASR Media Service UUID
Present only when recording is done
optional asr.result: ASRResult[];
ASR Results
Present only when recording is happening
optional asr.size: number;
ASR File size
Present only when recording is done
optional asr.startTime: string;
ASR Start Time
Present only when recording is done
optional asr.timeoutReason: string;
ASR Timeout Reason
Present only when recording is happening
channel: MessageChannelBody;
Channel Information
type MessageAudioBody = object;
Defined in: conversations/lib/types/messageAudioBody.ts:3
audio: object;
Message audio
audio.url: string;
Audio URL
messageType: AUDIO;
Message type
type MessageChannelBody = object;
Defined in: conversations/lib/types/messageChannelBody.ts:4
channel: object;
Channel Details
channel.from: AnyChannel;
Channel is coming from user/type
channel.to: AnyChannel;
Channel is going to user/type
headers: Record<string, string>;
Message headers
id: string;
Message ID
type: ChannelType;
Message Type
type MessageConversationBody = object;
Defined in: conversations/lib/types/messageConversationBody.ts:3
optional displayName: string;
The conversation display name.
id: string;
The conversation id.
optional imageUrl: string;
The image for the conversation.
name: string;
The conversation name.
state: ConversationState;
The conversation state.
readonly optional timestamp: object;
Timestamps for when the conversation was created, updated, and destroyed.
readonly optional timestamp.created: string;
The time the conversation was created.
readonly optional timestamp.destroyed: string;
The time the conversation was destroyed (if applicable).
readonly optional timestamp.updated: string;
The time the conversation was last updated.
type MessageCustomBody = object;
Defined in: conversations/lib/types/messageCustomBody.ts:4
custom: Record<string, number | string | boolean>;
Custom data for message
messageType: CUSTOM;
Message type
type MessageEventBody = object;
Defined in: conversations/lib/types/messageEventBody.ts:1
eventId: string;
The event id.
type MessageFileBody = object;
Defined in: conversations/lib/types/messageFileBody.ts:3
file: object;
file.url: string;
File URL
messageType: FILE;
Message type
type MessageImageBody = object;
Defined in: conversations/lib/types/messageImageBody.ts:3
image: object;
Message image
image.url: string;
Image URL
messageType: IMAGE;
Message type
type MessageLegBody = object;
Defined in: conversations/lib/types/messageLegBody.ts:23
direction: CallDirection;
Call direction of the message leg
legId: string;
Id of the message leg
state: LegState;
State of the message leg
status: CallStatus;
Call status of the message leg
statusHistory: object;
Last status of the leg
optional statusHistory.conversationId: string;
Conversation Id
optional statusHistory.knockerId: string;
Id of the knocker
optional statusHistory.memberId: string;
Member Id
statusHistory.state: LegState;
Last state of the leg
statusHistory.status: CallStatus;
Call status of the leg
type: Channels;
Channel type of the message leg
type MessageLocationBody = object;
Defined in: conversations/lib/types/messageLocationBody.ts:3
location: object;
location.address: string;
Address
location.latitude: string;
Latitude
location.longitude: string;
Longitude
location.name: string;
Name
messageType: LOCATION;
Message Type
type MessageMemberBody = object & Omit<Member, "status" | "id" | "conversationId"> & Omit<UpdateMemberParameters, "state" | "from">;
Defined in: conversations/lib/types/messageMemberBody.ts:4
optional audio: boolean;
Audio Message
memberId: string;
Member ID
type MessagePlayDTMFBody = object;
Defined in: conversations/lib/types/messagePlayDTMFBody.ts:3
channel: object;
Channel information.
channel.from: object;
Channel message was sent from.
channel.from.from: object;
From Channel information.
channel.from.from.type: Channels;
Channel type.
channel.from.to: object;
To Channel information.
channel.from.to.type: string;
Channel type.
channel.from.to.user: string;
User ID.
channel.from.type: Channels;
Channel type.
channel.headers: Record<string, string>;
Message headers
channel.id: string;
Mmessage Id
channel.to: object;
Channel message was sent to.
channel.to.from: object;
From Channel information.
channel.to.from.type: Channels;
Channel type.
channel.to.to: object;
To Channel information.
channel.to.to.type: string;
Channel type.
channel.to.to.user: string;
User ID.
channel.to.type: Channels;
Channel type.
channel.type: "app" | "phone" | "sip" | "websocket" | "vcp";
Message type
digits: string;
The digits to play.
optional dtmfSeq: number;
The sequence number of the DTMF event.
duration: number;
The duration of the DTMF event.
method: "in";
The method used to send the DTMF event.
type MessageRandomBody = object;
Defined in: conversations/lib/types/messageRandomBody.ts:3
messageType: RANDOM;
type MessageRecordBody = object;
Defined in: conversations/lib/types/messageRecordBody.ts:1
beepEnd: boolean;
Play beep at the end of the recording
beepStart: boolean;
Play beep at the beginning of the recording
channels: number;
Number of channels
detectSpeach: boolean;
Detect speech
format: string;
Audio format
multiTrack: boolean;
Recording has multiple tracks
recordId: string;
Recording ID
split: boolean;
Split the audio
streamed: boolean;
Audio is streamed
transcription: object;
Transcription settings
transcription.language: string;
Transcription language
transcription.sentimentAnalysis: boolean;
Include sentiment analysis
validity: number;
Recording URL
type MessageRecordIdBody = object;
Defined in: conversations/lib/types/messageRecordIdBody.ts:1
recordId: string;
Recording ID
type MessageRTCAnswerBody = object & MessageRTCIdBody;
Defined in: conversations/lib/types/messageRTCAnswerBody.ts:3
answer: string;
isFromMb: boolean;
sessionDestination: string;
type MessageRTCIdBody = object;
Defined in: conversations/lib/types/messageRTCIdBody.ts:1
rtcId: string;
RTC ID
type MessageSayBody = object;
Defined in: conversations/lib/types/messageSayBody.ts:1
language: string;
The language of the voice
level: number;
Volume level
loop: number;
Number of times to repeat the audio
premium: boolean;
Whether to use the premium voice
queue: boolean;
Queue the audio
ssml: boolean;
Whether to use SSML
style: number;
The style of the voice
text: string;
The text to say
voiceName: string;
The name of the voice to use
type MessageSayIdBody = object;
Defined in: conversations/lib/types/messageSayIdBody.ts:1
sayId: string;
The ID of the message.
type MessageSIPBody = object;
Defined in: conversations/lib/types/messageSIPBody.ts:8
Standard SIP and RTC message body
channel: AnyChannel;
Call channel
This is the same body for RTC and SIP
type MessageSIPDirectionBody = object & MessageSIPBody;
Defined in: conversations/lib/types/messageSIPDirectionBody.ts:9
Standard SIP and RTC message body with direction
direction: CallDirection;
Direction of the call
This is the same body for RTC and SIP
type MessageSIPHangupBody = object & MessageSIPDirectionBody;
Defined in: conversations/lib/types/messageSIPHangupBody.ts:8
Standard SIP and RTC
bandwidth: object;
Bandwidth of the call
bandwidth.byteIn: number;
Total number of bytes received
bandwidth.byteOut: number;
Total number of bytes sent
quality: object;
Quality of the call
quality.flawTotal: number;
Total number of packets that had flaws
quality.jitterBurstRate: number;
Average amount of jitter burst
quality.jitterLossRate: number;
Average amount of jitter loss
quality.jitterMaxVar: number;
Most amount ofjitter
quality.jitterMinVar: number;
Least amount of jitter
quality.mosScore: number;
The MOS score of the call
quality.packetCnt: number;
Total number of packets
quality.packetLossPerc: number;
Total number of packets lost
quality.qualityPercentage: number;
The percentage of the call that was not silence
reason: object;
The reason of the call hangup
reason.code: string;
The SIP reason Code of the call
reason.sipCode: string;
The SIP code of the call
reason.text: string;
The reason of the call
This is the same body for RTC and SIP
type MessageSIPMachineBody = object & MessageSIPBody;
Defined in: conversations/lib/types/messageSIPMachineBody.ts:3
confidence: number;
Confidence of the machine detection
type: string;
Type of SIP call
type MessageSIPStatusBody = object & MessageSIPBody;
Defined in: conversations/lib/types/messageSIPStatusBody.ts:9
SIP and RTC message body with status
direction: CallDirection;
Direction of the call
duration: string;
Call duration
endTime: string;
Time of the end of the call
from: string;
Phone number of the caller
networkCode: string;
Network code of the caller
price: string;
Price for the call
rate: string;
Rate per minute
requestTime: string;
Time of the request
startTime: string;
Time of the start of the call
state: object;
State of the call
state.status: CallStatus;
Status of the call
status: CallStatus;
Status of the call
to: string;
Phone number
This is the same body for RTC and SIP
type MessageStatusBody = object;
Defined in: conversations/lib/types/messageStatusBody.ts:3
optional audio: object;
audio.url: string;
Audio URL
optional channelType: "sms" | "mms" | "whatsapp" | "viber" | "messenger";
Channel type
optional custom: Record<string, unknown>;
optional error: Record<string, unknown>;
Message error
optional file: object;
file.url: string;
File URL
optional from: string;
Member ID of the sender.
optional image: object;
image.url: string;
Image URL
optional location: object;
location.address: string;
Location address
location.latitude: number;
Latitude
location.longitude: number;
Longitude
location.name: string;
Location name
optional messageType: EventMessageType;
Type of event
optional messageUUID: string;
The ID of the message.
optional originalEventId: string;
The ID of the message.
optional template: object;
template.name: string;
template.parameters: string[];
Template variables
optional text: string;
Message text
optional to: string;
Member ID of the recipient.
optional vcard: object;
vcard.url: string;
VCard URL
optional video: object;
video.url: string;
Video URL
optional whatsapp: object;
whatsapp.locale: string;
Whats App locale
whatsapp.policy: string;
Whats App policy
type MessageTemplateBody = object;
Defined in: conversations/lib/types/messageTemplateBody.ts:3
messageType: TEMPLATE;
Message type
template: object;
Message template
template.name: string;
Template name
template.parameters: unknown[];
Template parameters
template.whatsapp: object;
Whatsapp settings
template.whatsapp.locale: string;
Template locale
template.whatsapp.policy: string;
Template policy
type MessageTextBody = object;
Defined in: conversations/lib/types/messageTextBody.ts:3
messageType: TEXT;
Message type
text: string;
Message text
type MessageVCardBody = object;
Defined in: conversations/lib/types/messageVCardBody.ts:3
image: object;
image.url: string;
Image URL
messageType: VCARD;
Message type
vcard: object;
Message vcard
vcard.url: string;
Vcard url
type MessageVideoBody = object;
Defined in: conversations/lib/types/messageVideoBody.ts:3
messageType: VIDEO;
Message type
video: object;
Message video
video.url: string;
Video URL
type PhoneNumberChannel = object;
Defined in: conversations/lib/types/phoneNumberChannel.ts:6
Type representing a phone number channel.
number: string;
The phone number.
type: PHONE;
The type of channel (phone).
type Session = object;
Defined in: conversations/lib/types/session.ts:13
apiKey: string;
The API Key for the session.
id: string;
The ID of the session.
properties: object;
Session properties
properties.ttl: number;
Time to live in seconds.
user: SessionUser;
User for the session
type SessionPage = object;
Defined in: conversations/lib/types/sessionPage.ts:4
optional links: Record<string, APILink>;
HAL links for the page.
pageSize: number;
The number of items in the page.
sessions: Session[];
Sessions in the page.
type SessionPageResponse = object & APILinks;
Defined in: conversations/lib/types/responses/sessionPageResponse.ts:4
_embedded: object;
HAL Page response
_embedded.sessions: SessionResponse[];
The sessions in the page.
page_size: number;
Number of members in the page.
type SessionResponse = object & Omit<Session, "user">;
Defined in: conversations/lib/types/responses/sessionResponse.ts:6
A session as its returned from the API
_embedded: object;
_embedded.api_key: string;
API Key for the session.
_embedded.user: SessionUser;
The matching user for this member.
type SessionUser = object;
Defined in: conversations/lib/types/session.ts:1
id: string;
The ID of the user.
name: string;
The name of the user.
type SipChannel = object;
Defined in: conversations/lib/types/sipChannel.ts:6
Type representing a SIP channel.
password: string;
The SIP password.
type: SIP;
The type of channel (SIP).
uri: string;
The SIP URI.
username: string;
The SIP username.
type UpdateMemberParameters = object;
Defined in: conversations/lib/types/parameters/updateMemberParameters.ts:6
Parameters for updating a member.
from: string;
Member ID of who is making the update.
optional reason: object;
The reason for the update.
reason.code: string;
The reason code.
reason.text: string;
The reason text.
state: LEFT | JOINED;
The new state to public set
Setting to MemberState.LEFT
will remove the member from the reason
is
required when setting to MemberState.JOINED
type VbcChannel = object;
Defined in: conversations/lib/types/vbcChannel.ts:6
Type representing a VBC (Voice Business Cloud) channel.
extension: string;
The VBC extension.
type: VBC;
The type of channel (VBC).
type WebSocketChannel = object;
Defined in: conversations/lib/types/websocketChannel.ts:6
Type representing a WebSocket channel.
contentType: string;
The content type for WebSocket.
type: ChannelType;
The type of channel (WebSocket).
uri: string;
The WebSocket URI.