Skip to content

Vonage Conversations

github-actions edited this page Jan 21, 2025 · 89 revisions

Vonage Conversations


Documentation / Vonage Conversations

Vonage Conversations

Enumerations

ChannelType

Defined in: conversations/lib/enums/channelType.ts:4

Enum representing the type of communication channel.

Enumeration Members

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

ConversationState

Defined in: conversations/lib/enums/conversationState.ts:4

Conversation state

Enumeration Members

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

EventMessageType

Defined in: conversations/lib/enums/eventMessageType.ts:1

Enumeration Members

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

EventType

Defined in: conversations/lib/enums/eventsTypes.ts:4

Enum representing various types of events and their descriptions.

Enumeration Members

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

LegStatus

Defined in: conversations/lib/enums/legStatus.ts:4

The status of a leg

Enumeration Members

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

MemberState

Defined in: conversations/lib/enums/memberState.ts:4

Enum representing the state of a member.

Enumeration Members

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

ReasonCode

Defined in: conversations/lib/enums/reasonMessages.ts:4

Enum representing various reasons

Enumeration Members

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

Classes

Conversations

Defined in: conversations/lib/conversations.ts:173

A client for talking to the Vonage Conversation API.

Examples

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

Extends

Constructors

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

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

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

Conversations

Inherited from

Client.constructor

Properties

auth
protected auth: AuthInterface;

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

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

Inherited from

Client.auth

authType
authType: AuthenticationType = AuthenticationType.JWT;

Defined in: conversations/lib/conversations.ts:174

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

Overrides

Client.authType

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

Inherited from

Client.config

transformers
static transformers: object;

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

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

Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

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

createConversation()
createConversation(conversation): Promise<Conversation>

Defined in: conversations/lib/conversations.ts:273

Creates a new conversation with the provided details.

Parameters
conversation

Conversation

The conversation details to be created.

Returns

Promise<Conversation>

  • A promise resolving to the created conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#createConversation

Example

Create a new conversation

const conversation = await conversationClient.createConversation({
  name: 'My Conversation',
});

console.log(conversation.id);
createEvent()
createEvent(conversationId, event): Promise<Event>

Defined in: conversations/lib/conversations.ts:806

Creates a new event with the provided details.

Parameters
conversationId

string

The conversation id to create the event in.

event

Event

The event details to be created.

Returns

Promise<Event>

  • A promise resolving to the created event.
See

API Specification https://developer.vonage.com/en/api/event#createEvent

Example

Create a new event

const event = await eventClient.createEvent({
  name: 'My Event',
});

console.log(event.id);
createMember()
createMember(conversationId, member): Promise<Member>

Defined in: conversations/lib/conversations.ts:577

Creates a new member with the provided details.

Parameters
conversationId

string

The conversation id to create the member in.

member

Member

The member details to be created.

Returns

Promise<Member>

  • A promise resolving to the created member.
See

API Specification https://developer.vonage.com/en/api/conversation#createMember

Example

Create a new member

const member = await memberClient.createMember(
  CONVERSATION_ID,
  {
    name: 'My Member',
  },
);

console.log(member.id);
deleteConversation()
deleteConversation(conversationId): Promise<void>

Defined in: conversations/lib/conversations.ts:354

Deletes an conversation by its unique identifier.

Parameters
conversationId

string

The unique identifier of the conversation to delete.

Returns

Promise<void>

  • A promise indicating the successful deletion of the conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#deleteConversation

Example

Delete an conversation

await conversationClient.deleteConversation(conversation_ID);
deleteEvent()
deleteEvent(conversationId, eventId): Promise<void>

Defined in: conversations/lib/conversations.ts:839

Deletes an event by its unique identifier.

Parameters
conversationId

string

The conversation id to delete the event from.

eventId

string

The unique identifier of the conversation to delete.

Returns

Promise<void>

  • A promise indicating the successful deletion of the event.
See

API Specification https://developer.vonage.com/en/api/event#deleteEvent

Example

Delete an event

await eventClient.deleteEvent(conversation_ID);
getConfig()
getConfig(): ConfigParams

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

Returns

ConfigParams

Inherited from

Client.getConfig

getConversation()
getConversation(conversationId): Promise<Conversation>

Defined in: conversations/lib/conversations.ts:300

Retrieves an conversation by its unique identifier.

Parameters
conversationId

string

The unique identifier of the conversation to retrieve.

Returns

Promise<Conversation>

  • A promise resolving to the retrieved conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#getConversation

Example

Retrieve an conversation

const conversation = await conversationClient.getConversation(conversation_ID);
console.log(conversation.name);
getConversationPage()
getConversationPage(filter): Promise<ConversationPage>

Defined in: conversations/lib/conversations.ts:230

Retrieves a page of conversations based on filter parameters.

Parameters
filter

ListConversationsParameters

The filter parameters for pagination.

Returns

Promise<ConversationPage>

  • A promise resolving to a page of conversations.
See

API Specification https://developer.vonage.com/en/api/conversation#listConversation

Example

Get a single page of conversations

const conversations = await conversationClient.getConversationPage({
  page: 1,
  size: 10
});

conversations.conversations.forEach(conversation => {
  console.log(conversation.name);
});
getEvent()
getEvent(conversationId, eventId): Promise<Event>

Defined in: conversations/lib/conversations.ts:775

Retrieves an event by its unique identifier.

Parameters
conversationId

string

The conversation id to retrieve the event from.

eventId

string

The unique identifier of the event to retrieve.

Returns

Promise<Event>

  • A promise resolving to the retrieved event.
See

API Specification https://developer.vonage.com/en/api/conversation#getEvent

Example

Retrieve an event

const event = await eventClient.getEvent(CONVERSATION_ID, event_ID);
console.log(event.name);
getEventPage()
getEventPage(conversationId, filter): Promise<EventPage>

Defined in: conversations/lib/conversations.ts:737

Retrieves a page of events based on filter parameters.

Parameters
conversationId

string

The conversation id to retrieve events from.

filter

ListEventParameters

The filter parameters for pagination.

Returns

Promise<EventPage>

  • A promise resolving to a page of events.
See

API Specification https://developer.vonage.com/en/api/event#listEvent

Example

Get a single page of events

const events = await eventClient.getEventPage({
  page: 1,
  size: 10
});

events.events.forEach(event => {
  console.log(event.name);
});
getMe()
getMe(conversationId): Promise<Member>

Defined in: conversations/lib/conversations.ts:633

This retrieves the member associated with the sub claim on the JWT

Parameters
conversationId

string

The conversation id to retrieve the member from.

Returns

Promise<Member>

  • A promise resolving to the retrieved member.
See

API Specification https://developer.vonage.com/en/api/conversation#getMe

Example

Retrieve an member

const member = await memberClient.getMe(CONVERSATION_ID);
console.log(member.name);
getMember()
getMember(conversationId, memberId): Promise<Member>

Defined in: conversations/lib/conversations.ts:606

Retrieves an member by its unique identifier.

Parameters
conversationId

string

The conversation id to retrieve the member from.

memberId

string

The unique identifier of the member to retrieve.

Returns

Promise<Member>

  • A promise resolving to the retrieved member.
See

API Specification https://developer.vonage.com/en/api/conversation#getMember

Example

Retrieve an member

const member = await memberClient.getMember(CONVERSATION_ID, MEMBER_ID);
console.log(member.name);
getMemberPage()
getMemberPage(conversationId, filter): Promise<MemberPage>

Defined in: conversations/lib/conversations.ts:536

Retrieves a page of members in a conversation based on filter parameters.

Parameters
conversationId

string

The conversation id to retrieve members from.

filter

ListMemberParameters = {}

The filter parameters for pagination.

Returns

Promise<MemberPage>

  • A promise resolving to a page of members.
See

API Specification https://developer.vonage.com/en/api/conversation#listMember

Example

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()
getUserSessionsPage(userId, filter): Promise<SessionPage>

Defined in: conversations/lib/conversations.ts:457

Retrieves a page of sessions based on filter parameters.

Parameters
userId

string

The user id to retrieve sessions from.

filter

ListSessionParameters

The filter parameters for pagination.

Returns

Promise<SessionPage>

  • A promise resolving to a page of sessions.
See

API Specification https://developer.vonage.com/en/api/session#listSession

Example

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()
listAllConversations(params?): AsyncGenerator<Conversation, void & Conversation, undefined>

Defined in: conversations/lib/conversations.ts:192

Retrieves all conversations, iterating over paginated results.

Parameters
params?

ListConversationsParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Conversation, undefined>

  • An asynchronous generator.
Yields
  • Yields conversation items.
Example

List conversations with pagination using an iterator

for await (const conversation of conversationClient.listAllConversations()) {
  console.log(conversation.name);
}
listAllEvents()
listAllEvents(conversationId, params?): AsyncGenerator<Event, void & Event, undefined>

Defined in: conversations/lib/conversations.ts:697

Retrieves all events, iterating over paginated results.

Parameters
conversationId

string

The conversation id to retrieve events from.

params?

ListEventParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Event, undefined>

  • An asynchronous generator.
Yields
  • Yields event items.
Example

List events with pagination using an iterator

for await (const event of eventClient.listAllEvents()) {
  console.log(event.name);
}
listAllMembers()
listAllMembers(conversationId, params?): AsyncGenerator<Member, void & Member, undefined>

Defined in: conversations/lib/conversations.ts:493

Retrieves all members, iterating over paginated results.

Parameters
conversationId

string

The conversation id to retrieve members from.

params?

ListMemberParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Member, undefined>

  • An asynchronous generator.
Yields
  • Yields member items.
Example

List members with pagination using an iterator

for await (const member of memberClient.listAllMembers(CONVERSATION_ID)) {
  console.log(member.name);
}
listAllUserConversations()
listAllUserConversations(userId, params?): AsyncGenerator<Conversation, void & Conversation, undefined>

Defined in: conversations/lib/conversations.ts:377

Retrieves all conversations, for a user

Parameters
userId

string

The user id to retrieve conversations from.

params?

ListConversationsParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Conversation, undefined>

  • An asynchronous generator.
Yields
  • Yields conversation items.
Example

List conversations with pagination using an iterator

for await (const conversation of conversationClient.listAllUserConversations(USER_ID)) {
  console.log(conversation.name);
}
listAllUserSessions()
listAllUserSessions(userId, params?): AsyncGenerator<Session, void & Session, undefined>

Defined in: conversations/lib/conversations.ts:414

Retrieves all session, for a user

Parameters
userId

string

The user id to retrieve sessions from.

params?

ListSessionParameters = {}

Optional filter parameters.

Returns

AsyncGenerator<Session, undefined>

  • An asynchronous generator.
Yields
  • Yields session items.
Example

List sessions with pagination using an iterator

for await (const session of conversationClient.listAllUserSessions(USER_ID)) {
  console.log(session.id);
}
parseResponse()
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.

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

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

Parameters
request

VetchOptions

The request options.

Returns

undefined | string

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

Client.prepareBody

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

Parameters
request

VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

updateConversation()
updateConversation(conversation): Promise<Conversation>

Defined in: conversations/lib/conversations.ts:329

Updates an existing conversation with the provided details.

Parameters
conversation

Conversation

The conversation details to be updated.

Returns

Promise<Conversation>

  • A promise resolving to the updated conversation.
See

API Specification https://developer.vonage.com/en/api/conversation#updateConversation

Example

Update an conversation

const conversation = await conversationClient.updateConversation({
  id: conversation_ID,
  name: 'My Conversation',
});
console.log(conversation.name);
updateMember()
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.

Parameters
conversationId

string

The conversation id to update the member in.

memberId

string

The member details to be updated.

params

UpdateMemberParameters

The update parameters.

Returns

Promise<Member>

  • A promise resolving to the updated member.
See

API Specification https://developer.vonage.com/en/api/conversation#updateMember

Example
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 Aliases

AnyChannel

type AnyChannel = 
  | PhoneNumberChannel
  | SipChannel
  | AppChannel
  | WebSocketChannel
  | VbcChannel;

Defined in: conversations/lib/types/anyChannel.ts:7


AnyMessageBody

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


AnyMessageBodyResponse

type AnyMessageBodyResponse = { [P in keyof AnyMessageBody as SnakeToCamelCase<P>]: AnyMessageBody[P] };

Defined in: conversations/lib/types/responses/eventResponse.ts:14


AppChannel

type AppChannel = object;

Defined in: conversations/lib/types/appChannel.ts:6

Type representing an app channel.

Type declaration

type
type: APP;

The type of channel (app).

user
user: string;

The app user.


ASRResult

type ASRResult = object;

Defined in: conversations/lib/types/messageASRBody.ts:3

Type declaration

confidence
confidence: number;

Confidence of the word

word
word: string;

Word recognized


AudioSettings

type AudioSettings = object;

Defined in: conversations/lib/types/audioSettings.ts:4

Type representing audio settings.

Type declaration

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.


AudioSettingsRequest

type AudioSettingsRequest = object;

Defined in: conversations/lib/types/requests/createMemberRequest.ts:4

Type declaration

audio
audio: boolean;

Indicates whether audio is active.

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.


AudioSettingsResponse

type AudioSettingsResponse = object;

Defined in: conversations/lib/types/responses/memberResponse.ts:6

Type declaration

audio
audio: boolean;

Indicates whether audio is active.

earmuffed
earmuffed: boolean;

Indicates whether audio is earmuffed.

enabled
enabled: boolean;

Indicates whether audio is enabled.

muted
muted: boolean;

Indicates whether audio is muted.


Conversation

type Conversation = object;

Defined in: conversations/lib/types/conversation.ts:8

Represents a conversation

Type declaration

callback?
optional callback: ConversationCallback;

Callback information (optional).

Remarks

This is not set when fetching a converstion from the API.

displayName?
optional displayName: string;

The public-facing name of the conversation.

id?
readonly optional id: string;

The unique identifier for this conversation.

imageUrl?
optional imageUrl: string;

An image URL associated with the conversation.

name?
optional name: string;

Your internal conversation name. Must be unique.

numbers?
optional numbers: AnyChannel[];

Communication channels (optional).

Remarks

This is not set when fetching a converstion from the API.

properties?
optional properties: object;

The conversation's properties

properties.customData
properties.customData: Record<string, unknown>;

Custom key-value pairs to be included with the conversation.

properties.customSortKey
properties.customSortKey: string;

The conversation's custom sort key.

properties.ttl?
optional properties.ttl: number;

The conversation's time to leave.

After how many seconds the conversation is deleted.

properties.type
properties.type: string;

The conversation's type.

sequenceNumber?
readonly optional sequenceNumber: number;

The last Event ID in this conversation.

This ID can be used to retrieve a specific event.

state?
optional state: ConversationState;

The conversation's state.

status?
readonly optional status: ConversationState;

The conversation's status.

timestamp?
readonly optional timestamp: object;

Timestamps for when the conversation was created, updated, and destroyed.

timestamp.created?
readonly optional timestamp.created: string;

The time the conversation was created.

timestamp.destroyed?
readonly optional timestamp.destroyed: string;

The time the conversation was destroyed (if applicable).

timestamp.updated?
readonly optional timestamp.updated: string;

The time the conversation was last updated.


ConversationCallback

type ConversationCallback = object;

Defined in: conversations/lib/types/conversationCallback.ts:5

Type representing a callback object in a conversation request.

Type declaration

eventMask?
optional eventMask: string;

The event mask for the callback.

method?
optional method: "POST" | "GET";

The callback method.

params?
optional params: object;

Callback parameters.

params.applicationId?
optional params.applicationId: string;

The application ID for the callback.

params.nccoUrl?
optional params.nccoUrl: string;

The NCCO URL for the callback.

url?
optional url: string;

The callback URL.


ConversationCallbackRequest

type ConversationCallbackRequest = object;

Defined in: conversations/lib/types/requests/conversationCallbackRequest.ts:4

Type representing a callback object in a conversation request.

Type declaration

event_mask?
optional event_mask: string;

The event mask for the callback.

method
method: "POST" | "GET";

The callback method.

params?
optional params: object;

Callback parameters.

params.applicationId?
optional params.applicationId: string;

The application ID for the callback.

params.ncco_url?
optional params.ncco_url: string;

The NCCO URL for the callback.

url?
optional url: string;

The callback URL.


ConversationPage

type ConversationPage = object;

Defined in: conversations/lib/types/conversationPage.ts:7

A page of conversations.

Type declaration

conversations
conversations: Conversation[];

Conversations for the page.

links?
optional links: Record<string, APILink>;

HAL links for the page.

pageSize
pageSize: number;

How many items are in the page.


ConversationPageResponse

type ConversationPageResponse = object & APILinks;

Defined in: conversations/lib/types/responses/conversationPageResponse.ts:7

Represents the response for listing conversations retrieved from the API.

Type declaration

_embedded
_embedded: object;

Embedded data containing a list of conversations.

_embedded.conversations
_embedded.conversations: ConversationResponse[];
page_size
page_size: number;

The number of records returned in this response.


ConversationResponse

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.

Type declaration

display_name?
optional display_name: string;

The public-facing name of the conversation.

image_url?
optional image_url: string;

An image URL associated with the conversation.

properties?
optional properties: object;

The conversation's properties

properties.custom_data
properties.custom_data: Record<string, unknown>;

Custom key-value pairs to be included with the conversation.

properties.custom_sort_key
properties.custom_sort_key: string;

The conversation's custom sort key.

properties.ttl?
optional properties.ttl: number;

The conversation's time to leave.

After how many seconds the conversation is deleted.

properties.type
properties.type: string;

The conversation's type.

sequence_number
sequence_number: number;

The last Event ID in this conversation. This ID can be used to retrieve a specific event.


CreateConversationRequest

type CreateConversationRequest = object;

Defined in: conversations/lib/types/requests/createConversationRequest.ts:11

Type representing a request to create a conversation.

Type declaration

callback?
optional callback: ConversationCallbackRequest;

Callback information (optional).

display_name
display_name: string;

The public-facing name of the conversation.

image_url
image_url: string;

An image URL associated with the conversation.

name
name: string;

Your internal conversation name.

numbers?
optional numbers: (
  | PhoneNumberChannel
  | SipChannel
  | AppChannel
  | WebSocketChannel
  | VbcChannel)[];

Communication channels (optional).

properties?
optional properties: object;

Conversation properties (optional).

properties.custom_data?
optional properties.custom_data: Record<string, unknown>;

Custom data as key-value pairs (optional).

properties.custom_sort_key?
optional properties.custom_sort_key: string;

Custom sort key (optional).

properties.ttl?
optional properties.ttl: number;

Time to leave in seconds for an empty conversation (optional).

properties.type?
optional properties.type: string;

Custom conversation type (optional).


CreateEventRequest

type CreateEventRequest = object & Pick<Event, "type" | "from">;

Defined in: conversations/lib/types/requests/createEventRequest.ts:4

Type declaration

body
body: AnyMessageBodyResponse;

CreateMemberRequest

type CreateMemberRequest = object;

Defined in: conversations/lib/types/requests/createMemberRequest.ts:29

A Member as its sent to the API

Type declaration

channel
channel: AnyChannel;

The channel associated with the member.

from
from: string;

The user who invited the member.

knocking_id
knocking_id: string;

The knocking ID for the member.

media
media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether the member has audio.

media.audio_settings
media.audio_settings: AudioSettingsRequest;

Audio settings for the member.

member_id_inviting
member_id_inviting: string;

The member who invited the member.

state
state: MemberState;

The member's state

user
user: object;

The matching user for this member.

user.id
user.id: string;

The user's ID.

user.name
user.name: string;

The user's name.


Event

type Event = object;

Defined in: conversations/lib/types/event.ts:5

Type declaration

body
body: AnyMessageBody;

Data of the event.

from
from: string;

Member ID of the event.

fromMember?
optional fromMember: object;

Sender Memeber

fromMember.id
fromMember.id: string;

Member ID

fromUser?
optional fromUser: EventUser;

Sender User

id
id: number;

The ID of the message.

timestamp?
optional timestamp: string;

Timestamp of the event.

type
type: EventType;

Message type


EventPage

type EventPage = object;

Defined in: conversations/lib/types/eventPage.ts:4

Type declaration

events
events: Event[];

Embedded events.

links?
optional links: Record<string, APILink>;

Links to other resources.

pageSize
pageSize: number;

The number of items returned on this page.


EventPageResponse

type EventPageResponse = object & APILinks;

Defined in: conversations/lib/types/responses/eventPageResponse.ts:4

Type declaration

_embedded
_embedded: EventResponse[];

Embedded events.

page_size
page_size: number;

The number of items returned on this page.


EventResponse

type EventResponse = object & Omit<Event, "fromUser" | "body" | "fromMember"> & APILinks;

Defined in: conversations/lib/types/responses/eventResponse.ts:18

Type declaration

_embedded
_embedded: object;
_embedded.from_member
_embedded.from_member: object;
_embedded.from_member.id
_embedded.from_member.id: string;
_embedded.from_user
_embedded.from_user: EventUserResponse;
body
body: AnyMessageBodyResponse;

EventUser

type EventUser = object;

Defined in: conversations/lib/types/eventUser.ts:1

Type declaration

customData?
optional customData: Record<string, unknown>;

The user's custom data.

displayName
displayName: string;

The user's display name.

id
id: string;

The user's ID.

imageUrl?
optional imageUrl: string;

The user's avatar URL.

name
name: string;

The user's name.


EventUserResponse

type EventUserResponse = object & Omit<EventUser, "displayName">;

Defined in: conversations/lib/types/responses/eventResponse.ts:10

Type declaration

display_name
display_name: string;

InitiatorInvited

type InitiatorInvited = object;

Defined in: conversations/lib/types/member.ts:31

Type declaration

invited
invited: object;

Details about the initiator when the member invited.

invited.isSystem
invited.isSystem: boolean;

true if the user was invited by an admin JWT


InitiatorInvitedResponse

type InitiatorInvitedResponse = object;

Defined in: conversations/lib/types/responses/memberResponse.ts:56

Type representing the invited initiator as its returned from the API.

Type declaration

invited
invited: object;

Details about the initiator when the member invited.

invited.is_system
invited.is_system: boolean;

true if the user was invited by an admin JWT


InitiatorJoined

type InitiatorJoined = object;

Defined in: conversations/lib/types/member.ts:9

Type representing the joined initiator.

Type declaration

joined
joined: object;

Details about the initiator when the member joined.

joined.isSystem
joined.isSystem: boolean;

true if the user was invited by an admin JWT

joined.memberId
joined.memberId: string;

The member ID of the initiator.

joined.userId
joined.userId: string;

The user ID of the initiator.


InitiatorJoinedResponse

type InitiatorJoinedResponse = object;

Defined in: conversations/lib/types/responses/memberResponse.ts:31

Type representing the joined initiator as its returned from the API.

Type declaration

joined
joined: object;

Details about the initiator when the member joined.

joined.is_system
joined.is_system: boolean;

true if the user was invited by an admin JWT

joined.member_id
joined.member_id: string;

The member ID of the initiator.

joined.user_id
joined.user_id: string;

The user ID of the initiator.


LegState

type LegState = object;

Defined in: conversations/lib/types/messageLegBody.ts:5

Type declaration

reason?
optional reason: ReasonCode;

Reason code of the message leg

status
status: LegStatus;

Status of the message leg

succssful?
optional succssful: boolean;

If the leg is successful


ListConversationsParameters

type ListConversationsParameters = object;

Defined in: conversations/lib/types/parameters/listConversationsParameters.ts:4

Represents the query parameters for listing conversations.

Type declaration

byUser?
optional byUser: string;

Return the records that were created by this user.

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

Remarks

When using the generator from the client, this is handled for you.

dateEnd?
optional dateEnd: string;

Return the records that occurred before this point in time.

dateStart?
optional dateStart: string;

Return the records that occurred after this point in time.

includeCustomData?
optional includeCustomData: boolean;

Include custom data for the conversation

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.

pageSize?
optional pageSize: number;

Return this amount of records in the response.


ListEventParameters

type ListEventParameters = object;

Defined in: conversations/lib/types/parameters/listEventParameters.ts:4

List Event Parameters

Type declaration

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

endId?
optional endId: string;

The ID to end returning events at.

eventType?
optional eventType: string;

The type of event to search for. Does not currently support custom events.

excludeDeletedEvents?
optional excludeDeletedEvents: boolean;

Exclude deleted events.

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order. Must be one of: 'asc', 'desc'.

pageSize?
optional pageSize: number;

Return this amount of records in the response.

startId?
optional startId: string;

The ID to start returning events at.


ListMemberParameters

type ListMemberParameters = object;

Defined in: conversations/lib/types/parameters/listMemberParameters.ts:1

Type declaration

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

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order

pageSize?
optional pageSize: number;

Return this number of members


ListMemberResponse

type ListMemberResponse = object & APILinks;

Defined in: conversations/lib/types/responses/listMemberResponse.ts:9

A Mmbmer as its returned from the API in the listMembers

Type declaration

_embedded
_embedded: object;
_embedded.user
_embedded.user: MemberUserResponse;

The matching user for this member.

id
id: string;

The member's id

state
state: MemberState;

The member's state


ListSessionParameters

type ListSessionParameters = object;

Defined in: conversations/lib/types/parameters/listSessionParameters.ts:1

Type declaration

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

Remarks

When using the generator from the client, this is handled for you.

order?
optional order: "asc" | "desc";

Return the records in ascending or descending order.

pageSize?
optional pageSize: number;

Return the records per page


Member

type Member = object;

Defined in: conversations/lib/types/member.ts:46

Type representing a member in a conversation.

Type declaration

channel?
optional channel: AnyChannel;

The channel associated with the member.

conversationId?
optional conversationId: string;
id?
optional id: string;

The unique ID of the member.

initiator?
optional initiator: 
  | InitiatorJoined
  | InitiatorInvited;

The initiator of the member's joining.

invitedBy
invitedBy: string;

The user who invited the member.

knockingId
knockingId: string;

The knocking ID for the member.

media?
optional media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether audio is active.

media.audioSettings
media.audioSettings: AudioSettings;

Audio settings for the member.

state?
optional state: MemberState;

The state of the member (INVITED, JOINED, LEFT, UNKNOWN).

timestamp?
optional timestamp: object;

Timestamps for various states of the member.

timestamp.invited
timestamp.invited: string;

Timestamp when the member was invited.

timestamp.joined
timestamp.joined: string;

Timestamp when the member joined.

timestamp.left
timestamp.left: string;

Timestamp when the member left.

user
user: UserType;

The user associated with the member.

Remarks

Either the user id or name is required.


MemberPage

type MemberPage = object;

Defined in: conversations/lib/types/memberPage.ts:4

Type declaration

links?
optional links: Record<string, APILink>;

HAL links for the page.

members
members: Member[];

The list of members.

pageSize
pageSize: number;

The list of members.


MemberPageResponse

type MemberPageResponse = object & APILinks;

Defined in: conversations/lib/types/responses/memberPageResponse.ts:5

Type declaration

_embedded
_embedded: object;

HAL Page response

_embedded.members
_embedded.members: ListMemberResponse[];

The members in the page.

page_size
page_size: number;

Number of members in the page.


MemberResponse

type MemberResponse = object & APILinks;

Defined in: conversations/lib/types/responses/memberResponse.ts:71

A Mmbmer as its returned from the API

Type declaration

_embedded
_embedded: object;
_embedded.user
_embedded.user: MemberUserResponse;

The matching user for this member.

channel
channel: AnyChannel;

The channel associated with the member.

id
id: string;

The member's id

initiator
initiator: 
  | InitiatorJoinedResponse
  | InitiatorInvitedResponse;

The initiator of the member's joining.

invited_by
invited_by: string;

The user who invited the member.

knocking_id
knocking_id: string;

The knocking ID for the member.

media
media: object;

Media-related information for the member.

media.audio
media.audio: boolean;

Indicates whether audio is active.

media.audio_settings
media.audio_settings: AudioSettingsResponse;

Audio settings for the member.

state
state: MemberState;

The member's state

timestamp
timestamp: object;

Timestamps for various states of the member.

timestamp.invited
timestamp.invited: string;

Timestamp when the member was invited.

timestamp.joined
timestamp.joined: string;

Timestamp when the member joined.

timestamp.left
timestamp.left: string;

Timestamp when the member left.


MemberUserResponse

type MemberUserResponse = object & APILinks;

Defined in: conversations/lib/types/responses/memberUserResponse.ts:6

The user as its returned from the API

Type declaration

display_name
display_name: string;

A string to be displayed for the user. This does not have to be unique.

id
id: string;

The user's id

name
name: string;

The Unique name for the user


MessageASRBody

type MessageASRBody = object;

Defined in: conversations/lib/types/messageASRBody.ts:15

Type declaration

asr
asr: object;

ASR Result

asr.asrId
asr.asrId: string;

ASR Id

asr.callId
asr.callId: string;

ASR Call Id

asr.endTime?
optional asr.endTime: string;

ASR End Time

Remarks

Present only when recording is done

asr.error
asr.error: string;

ASR Error

asr.format?
optional asr.format: string;

ASR Audio Format

Remarks

Present only when recording is done

asr.mediaServiceUUID?
optional asr.mediaServiceUUID: string;

ASR Media Service UUID

Remarks

Present only when recording is done

asr.result?
optional asr.result: ASRResult[];

ASR Results

Remarks

Present only when recording is happening

asr.size?
optional asr.size: number;

ASR File size

Remarks

Present only when recording is done

asr.startTime?
optional asr.startTime: string;

ASR Start Time

Remarks

Present only when recording is done

asr.timeoutReason?
optional asr.timeoutReason: string;

ASR Timeout Reason

Remarks

Present only when recording is happening

channel
channel: MessageChannelBody;

Channel Information


MessageAudioBody

type MessageAudioBody = object;

Defined in: conversations/lib/types/messageAudioBody.ts:3

Type declaration

audio
audio: object;

Message audio

audio.url
audio.url: string;

Audio URL

messageType
messageType: AUDIO;

Message type


MessageChannelBody

type MessageChannelBody = object;

Defined in: conversations/lib/types/messageChannelBody.ts:4

Type declaration

channel
channel: object;

Channel Details

channel.from
channel.from: AnyChannel;

Channel is coming from user/type

channel.to
channel.to: AnyChannel;

Channel is going to user/type

headers
headers: Record<string, string>;

Message headers

id
id: string;

Message ID

type
type: ChannelType;

Message Type


MessageConversationBody

type MessageConversationBody = object;

Defined in: conversations/lib/types/messageConversationBody.ts:3

Type declaration

displayName?
optional displayName: string;

The conversation display name.

id
id: string;

The conversation id.

imageUrl?
optional imageUrl: string;

The image for the conversation.

name
name: string;

The conversation name.

state
state: ConversationState;

The conversation state.

timestamp?
readonly optional timestamp: object;

Timestamps for when the conversation was created, updated, and destroyed.

timestamp.created?
readonly optional timestamp.created: string;

The time the conversation was created.

timestamp.destroyed?
readonly optional timestamp.destroyed: string;

The time the conversation was destroyed (if applicable).

timestamp.updated?
readonly optional timestamp.updated: string;

The time the conversation was last updated.


MessageCustomBody

type MessageCustomBody = object;

Defined in: conversations/lib/types/messageCustomBody.ts:4

Type declaration

custom
custom: Record<string, number | string | boolean>;

Custom data for message

messageType
messageType: CUSTOM;

Message type


MessageEventBody

type MessageEventBody = object;

Defined in: conversations/lib/types/messageEventBody.ts:1

Type declaration

eventId
eventId: string;

The event id.


MessageFileBody

type MessageFileBody = object;

Defined in: conversations/lib/types/messageFileBody.ts:3

Type declaration

file
file: object;
file.url
file.url: string;

File URL

messageType
messageType: FILE;

Message type


MessageImageBody

type MessageImageBody = object;

Defined in: conversations/lib/types/messageImageBody.ts:3

Type declaration

image
image: object;

Message image

image.url
image.url: string;

Image URL

messageType
messageType: IMAGE;

Message type


MessageLegBody

type MessageLegBody = object;

Defined in: conversations/lib/types/messageLegBody.ts:23

Type declaration

direction
direction: CallDirection;

Call direction of the message leg

legId
legId: string;

Id of the message leg

state
state: LegState;

State of the message leg

status
status: CallStatus;

Call status of the message leg

statusHistory
statusHistory: object;

Last status of the leg

statusHistory.conversationId?
optional statusHistory.conversationId: string;

Conversation Id

statusHistory.knockerId?
optional statusHistory.knockerId: string;

Id of the knocker

statusHistory.memberId?
optional statusHistory.memberId: string;

Member Id

statusHistory.state
statusHistory.state: LegState;

Last state of the leg

statusHistory.status
statusHistory.status: CallStatus;

Call status of the leg

type
type: Channels;

Channel type of the message leg


MessageLocationBody

type MessageLocationBody = object;

Defined in: conversations/lib/types/messageLocationBody.ts:3

Type declaration

location
location: object;
location.address
location.address: string;

Address

location.latitude
location.latitude: string;

Latitude

location.longitude
location.longitude: string;

Longitude

location.name
location.name: string;

Name

messageType
messageType: LOCATION;

Message Type


MessageMemberBody

type MessageMemberBody = object & Omit<Member, "status" | "id" | "conversationId"> & Omit<UpdateMemberParameters, "state" | "from">;

Defined in: conversations/lib/types/messageMemberBody.ts:4

Type declaration

audio?
optional audio: boolean;

Audio Message

memberId
memberId: string;

Member ID


MessagePlayDTMFBody

type MessagePlayDTMFBody = object;

Defined in: conversations/lib/types/messagePlayDTMFBody.ts:3

Type declaration

channel
channel: object;

Channel information.

channel.from
channel.from: object;

Channel message was sent from.

channel.from.from
channel.from.from: object;

From Channel information.

channel.from.from.type
channel.from.from.type: Channels;

Channel type.

channel.from.to
channel.from.to: object;

To Channel information.

channel.from.to.type
channel.from.to.type: string;

Channel type.

channel.from.to.user
channel.from.to.user: string;

User ID.

channel.from.type
channel.from.type: Channels;

Channel type.

channel.headers
channel.headers: Record<string, string>;

Message headers

channel.id
channel.id: string;

Mmessage Id

channel.to
channel.to: object;

Channel message was sent to.

channel.to.from
channel.to.from: object;

From Channel information.

channel.to.from.type
channel.to.from.type: Channels;

Channel type.

channel.to.to
channel.to.to: object;

To Channel information.

channel.to.to.type
channel.to.to.type: string;

Channel type.

channel.to.to.user
channel.to.to.user: string;

User ID.

channel.to.type
channel.to.type: Channels;

Channel type.

channel.type
channel.type: "app" | "phone" | "sip" | "websocket" | "vcp";

Message type

digits
digits: string;

The digits to play.

dtmfSeq?
optional dtmfSeq: number;

The sequence number of the DTMF event.

duration
duration: number;

The duration of the DTMF event.

method
method: "in";

The method used to send the DTMF event.


MessageRandomBody

type MessageRandomBody = object;

Defined in: conversations/lib/types/messageRandomBody.ts:3

Type declaration

messageType
messageType: RANDOM;

MessageRecordBody

type MessageRecordBody = object;

Defined in: conversations/lib/types/messageRecordBody.ts:1

Type declaration

beepEnd
beepEnd: boolean;

Play beep at the end of the recording

beepStart
beepStart: boolean;

Play beep at the beginning of the recording

channels
channels: number;

Number of channels

detectSpeach
detectSpeach: boolean;

Detect speech

format
format: string;

Audio format

multiTrack
multiTrack: boolean;

Recording has multiple tracks

recordId
recordId: string;

Recording ID

split
split: boolean;

Split the audio

streamed
streamed: boolean;

Audio is streamed

transcription
transcription: object;

Transcription settings

transcription.language
transcription.language: string;

Transcription language

transcription.sentimentAnalysis
transcription.sentimentAnalysis: boolean;

Include sentiment analysis

validity
validity: number;

Recording URL


MessageRecordIdBody

type MessageRecordIdBody = object;

Defined in: conversations/lib/types/messageRecordIdBody.ts:1

Type declaration

recordId
recordId: string;

Recording ID


MessageRTCAnswerBody

type MessageRTCAnswerBody = object & MessageRTCIdBody;

Defined in: conversations/lib/types/messageRTCAnswerBody.ts:3

Type declaration

answer
answer: string;
isFromMb
isFromMb: boolean;
sessionDestination
sessionDestination: string;

MessageRTCIdBody

type MessageRTCIdBody = object;

Defined in: conversations/lib/types/messageRTCIdBody.ts:1

Type declaration

rtcId
rtcId: string;

RTC ID


MessageSayBody

type MessageSayBody = object;

Defined in: conversations/lib/types/messageSayBody.ts:1

Type declaration

language
language: string;

The language of the voice

level
level: number;

Volume level

loop
loop: number;

Number of times to repeat the audio

premium
premium: boolean;

Whether to use the premium voice

queue
queue: boolean;

Queue the audio

ssml
ssml: boolean;

Whether to use SSML

style
style: number;

The style of the voice

text
text: string;

The text to say

voiceName
voiceName: string;

The name of the voice to use


MessageSayIdBody

type MessageSayIdBody = object;

Defined in: conversations/lib/types/messageSayIdBody.ts:1

Type declaration

sayId
sayId: string;

The ID of the message.


MessageSIPBody

type MessageSIPBody = object;

Defined in: conversations/lib/types/messageSIPBody.ts:8

Standard SIP and RTC message body

Type declaration

channel
channel: AnyChannel;

Call channel

Remarks

This is the same body for RTC and SIP


MessageSIPDirectionBody

type MessageSIPDirectionBody = object & MessageSIPBody;

Defined in: conversations/lib/types/messageSIPDirectionBody.ts:9

Standard SIP and RTC message body with direction

Type declaration

direction
direction: CallDirection;

Direction of the call

Remarks

This is the same body for RTC and SIP


MessageSIPHangupBody

type MessageSIPHangupBody = object & MessageSIPDirectionBody;

Defined in: conversations/lib/types/messageSIPHangupBody.ts:8

Standard SIP and RTC

Type declaration

bandwidth
bandwidth: object;

Bandwidth of the call

bandwidth.byteIn
bandwidth.byteIn: number;

Total number of bytes received

bandwidth.byteOut
bandwidth.byteOut: number;

Total number of bytes sent

quality
quality: object;

Quality of the call

quality.flawTotal
quality.flawTotal: number;

Total number of packets that had flaws

quality.jitterBurstRate
quality.jitterBurstRate: number;

Average amount of jitter burst

quality.jitterLossRate
quality.jitterLossRate: number;

Average amount of jitter loss

quality.jitterMaxVar
quality.jitterMaxVar: number;

Most amount ofjitter

quality.jitterMinVar
quality.jitterMinVar: number;

Least amount of jitter

quality.mosScore
quality.mosScore: number;

The MOS score of the call

quality.packetCnt
quality.packetCnt: number;

Total number of packets

quality.packetLossPerc
quality.packetLossPerc: number;

Total number of packets lost

quality.qualityPercentage
quality.qualityPercentage: number;

The percentage of the call that was not silence

reason
reason: object;

The reason of the call hangup

reason.code
reason.code: string;

The SIP reason Code of the call

reason.sipCode
reason.sipCode: string;

The SIP code of the call

reason.text
reason.text: string;

The reason of the call

Remarks

This is the same body for RTC and SIP


MessageSIPMachineBody

type MessageSIPMachineBody = object & MessageSIPBody;

Defined in: conversations/lib/types/messageSIPMachineBody.ts:3

Type declaration

confidence
confidence: number;

Confidence of the machine detection

type
type: string;

Type of SIP call


MessageSIPStatusBody

type MessageSIPStatusBody = object & MessageSIPBody;

Defined in: conversations/lib/types/messageSIPStatusBody.ts:9

SIP and RTC message body with status

Type declaration

direction
direction: CallDirection;

Direction of the call

duration
duration: string;

Call duration

endTime
endTime: string;

Time of the end of the call

from
from: string;

Phone number of the caller

networkCode
networkCode: string;

Network code of the caller

price
price: string;

Price for the call

rate
rate: string;

Rate per minute

requestTime
requestTime: string;

Time of the request

startTime
startTime: string;

Time of the start of the call

state
state: object;

State of the call

state.status
state.status: CallStatus;

Status of the call

status
status: CallStatus;

Status of the call

to
to: string;

Phone number

Remarks

This is the same body for RTC and SIP


MessageStatusBody

type MessageStatusBody = object;

Defined in: conversations/lib/types/messageStatusBody.ts:3

Type declaration

audio?
optional audio: object;
audio.url
audio.url: string;

Audio URL

channelType?
optional channelType: "sms" | "mms" | "whatsapp" | "viber" | "messenger";

Channel type

custom?
optional custom: Record<string, unknown>;
error?
optional error: Record<string, unknown>;

Message error

file?
optional file: object;
file.url
file.url: string;

File URL

from?
optional from: string;

Member ID of the sender.

image?
optional image: object;
image.url
image.url: string;

Image URL

location?
optional location: object;
location.address
location.address: string;

Location address

location.latitude
location.latitude: number;

Latitude

location.longitude
location.longitude: number;

Longitude

location.name
location.name: string;

Location name

messageType?
optional messageType: EventMessageType;

Type of event

messageUUID?
optional messageUUID: string;

The ID of the message.

originalEventId?
optional originalEventId: string;

The ID of the message.

template?
optional template: object;
template.name
template.name: string;
template.parameters
template.parameters: string[];

Template variables

text?
optional text: string;

Message text

to?
optional to: string;

Member ID of the recipient.

vcard?
optional vcard: object;
vcard.url
vcard.url: string;

VCard URL

video?
optional video: object;
video.url
video.url: string;

Video URL

whatsapp?
optional whatsapp: object;
whatsapp.locale
whatsapp.locale: string;

Whats App locale

whatsapp.policy
whatsapp.policy: string;

Whats App policy


MessageTemplateBody

type MessageTemplateBody = object;

Defined in: conversations/lib/types/messageTemplateBody.ts:3

Type declaration

messageType
messageType: TEMPLATE;

Message type

template
template: object;

Message template

template.name
template.name: string;

Template name

template.parameters
template.parameters: unknown[];

Template parameters

template.whatsapp
template.whatsapp: object;

Whatsapp settings

template.whatsapp.locale
template.whatsapp.locale: string;

Template locale

template.whatsapp.policy
template.whatsapp.policy: string;

Template policy


MessageTextBody

type MessageTextBody = object;

Defined in: conversations/lib/types/messageTextBody.ts:3

Type declaration

messageType
messageType: TEXT;

Message type

text
text: string;

Message text


MessageVCardBody

type MessageVCardBody = object;

Defined in: conversations/lib/types/messageVCardBody.ts:3

Type declaration

image
image: object;
image.url
image.url: string;

Image URL

messageType
messageType: VCARD;

Message type

vcard
vcard: object;

Message vcard

vcard.url
vcard.url: string;

Vcard url


MessageVideoBody

type MessageVideoBody = object;

Defined in: conversations/lib/types/messageVideoBody.ts:3

Type declaration

messageType
messageType: VIDEO;

Message type

video
video: object;

Message video

video.url
video.url: string;

Video URL


PhoneNumberChannel

type PhoneNumberChannel = object;

Defined in: conversations/lib/types/phoneNumberChannel.ts:6

Type representing a phone number channel.

Type declaration

number
number: string;

The phone number.

type
type: PHONE;

The type of channel (phone).


Session

type Session = object;

Defined in: conversations/lib/types/session.ts:13

Type declaration

apiKey
apiKey: string;

The API Key for the session.

id
id: string;

The ID of the session.

properties
properties: object;

Session properties

properties.ttl
properties.ttl: number;

Time to live in seconds.

user
user: SessionUser;

User for the session


SessionPage

type SessionPage = object;

Defined in: conversations/lib/types/sessionPage.ts:4

Type declaration

links?
optional links: Record<string, APILink>;

HAL links for the page.

pageSize
pageSize: number;

The number of items in the page.

sessions
sessions: Session[];

Sessions in the page.


SessionPageResponse

type SessionPageResponse = object & APILinks;

Defined in: conversations/lib/types/responses/sessionPageResponse.ts:4

Type declaration

_embedded
_embedded: object;

HAL Page response

_embedded.sessions
_embedded.sessions: SessionResponse[];

The sessions in the page.

page_size
page_size: number;

Number of members in the page.


SessionResponse

type SessionResponse = object & Omit<Session, "user">;

Defined in: conversations/lib/types/responses/sessionResponse.ts:6

A session as its returned from the API

Type declaration

_embedded
_embedded: object;
_embedded.api_key
_embedded.api_key: string;

API Key for the session.

_embedded.user
_embedded.user: SessionUser;

The matching user for this member.


SessionUser

type SessionUser = object;

Defined in: conversations/lib/types/session.ts:1

Type declaration

id
id: string;

The ID of the user.

name
name: string;

The name of the user.


SipChannel

type SipChannel = object;

Defined in: conversations/lib/types/sipChannel.ts:6

Type representing a SIP channel.

Type declaration

password
password: string;

The SIP password.

type
type: SIP;

The type of channel (SIP).

uri
uri: string;

The SIP URI.

username
username: string;

The SIP username.


UpdateMemberParameters

type UpdateMemberParameters = object;

Defined in: conversations/lib/types/parameters/updateMemberParameters.ts:6

Parameters for updating a member.

Type declaration

from
from: string;

Member ID of who is making the update.

reason?
optional reason: object;

The reason for the update.

reason.code
reason.code: string;

The reason code.

reason.text
reason.text: string;

The reason text.

state
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


VbcChannel

type VbcChannel = object;

Defined in: conversations/lib/types/vbcChannel.ts:6

Type representing a VBC (Voice Business Cloud) channel.

Type declaration

extension
extension: string;

The VBC extension.

type
type: VBC;

The type of channel (VBC).


WebSocketChannel

type WebSocketChannel = object;

Defined in: conversations/lib/types/websocketChannel.ts:6

Type representing a WebSocket channel.

Type declaration

contentType
contentType: string;

The content type for WebSocket.

type
type: ChannelType;

The type of channel (WebSocket).

uri
uri: string;

The WebSocket URI.

Clone this wiki locally