-
Notifications
You must be signed in to change notification settings - Fork 181
Vonage Conversations
Vonage Conversations • Docs
Documentation / Vonage Conversations
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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
Creates a new instance of the Client.
• credentials: AuthInterface
| AuthParams
The authentication credentials or an authentication instance.
• options?: ConfigParams
Optional configuration settings for the client.
server-client/dist/lib/client.d.ts:35
protected auth: AuthInterface;
The authentication instance responsible for generating authentication headers and query parameters.
server-client/dist/lib/client.d.ts:24
authType: AuthenticationType = AuthenticationType.JWT;
The type of authentication used for the client's requests.
conversations/lib/conversations.ts:167
protected config: ConfigParams;
Configuration settings for the client, including default hosts for various services and other request settings.
server-client/dist/lib/client.d.ts:28
static transformers: object;
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
• keys: string
[]
• obj: ObjectToTransform
snakeCaseObjectKeys: PartialTransformFunction;
server-client/dist/lib/client.d.ts:11
addAuthenticationToRequest(request): Promise<VetchOptions>
Adds the appropriate authentication headers or parameters to the request based on the authentication type.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addAuthenticationToRequest
server-client/dist/lib/client.d.ts:43
protected addBasicAuthToRequest(request): Promise<VetchOptions>
Adds basic authentication headers to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
server-client/dist/lib/client.d.ts:71
protected addJWTToRequest(request): Promise<VetchOptions>
Adds a JWT to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
server-client/dist/lib/client.d.ts:64
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>
Adds API key and secret to the request.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequest
server-client/dist/lib/client.d.ts:57
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>
Adds API key and secret to the request body.
• request: VetchOptions
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequestBody
server-client/dist/lib/client.d.ts:50
createConversation(conversation): Promise<Conversation>
Creates a new conversation with the provided details.
• conversation: Conversation
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);
conversations/lib/conversations.ts:266
createEvent(conversationId, event): Promise<Event>
Creates a new event with the provided details.
• conversationId: string
The conversation id to create the event in.
• event: Event
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);
conversations/lib/conversations.ts:799
createMember(conversationId, member): Promise<Member>
Creates a new member with the provided details.
• conversationId: string
The conversation id to create the member in.
• member: Member
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);
conversations/lib/conversations.ts:570
deleteConversation(conversationId): Promise<void>
Deletes an conversation by its unique identifier.
• conversationId: 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);
conversations/lib/conversations.ts:347
deleteEvent(conversationId, eventId): Promise<void>
Deletes an event by its unique identifier.
• conversationId: string
The conversation id to delete the event from.
• eventId: 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);
conversations/lib/conversations.ts:832
getConfig(): ConfigParams
server-client/dist/lib/client.d.ts:36
getConversation(conversationId): Promise<Conversation>
Retrieves an conversation by its unique identifier.
• conversationId: 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);
conversations/lib/conversations.ts:293
getConversationPage(filter): Promise<ConversationPage>
Retrieves a page of conversations based on filter parameters.
• filter: ListConversationsParameters
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);
});
conversations/lib/conversations.ts:223
getEvent(conversationId, eventId): Promise<Event>
Retrieves an event by its unique identifier.
• conversationId: string
The conversation id to retrieve the event from.
• eventId: 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);
conversations/lib/conversations.ts:768
getEventPage(conversationId, filter): Promise<EventPage>
Retrieves a page of events based on filter parameters.
• conversationId: string
The conversation id to retrieve events from.
• filter: ListEventParameters
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);
});
conversations/lib/conversations.ts:730
getMe(conversationId): Promise<Member>
This retrieves the member associated with the sub claim on the JWT
• conversationId: 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);
conversations/lib/conversations.ts:626
getMember(conversationId, memberId): Promise<Member>
Retrieves an member by its unique identifier.
• conversationId: string
The conversation id to retrieve the member from.
• memberId: 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);
conversations/lib/conversations.ts:599
getMemberPage(conversationId, filter): Promise<MemberPage>
Retrieves a page of members in a conversation based on filter parameters.
• conversationId: string
The conversation id to retrieve members from.
• filter: 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);
});
conversations/lib/conversations.ts:529
getUserSessionsPage(userId, filter): Promise<SessionPage>
Retrieves a page of sessions based on filter parameters.
• userId: string
The user id to retrieve sessions from.
• filter: ListSessionParameters
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);
});
conversations/lib/conversations.ts:450
listAllConversations(params?): AsyncGenerator<Conversation, void & Conversation, undefined>
Retrieves all conversations, iterating over paginated results.
• params?: 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);
}
conversations/lib/conversations.ts:185
listAllEvents(conversationId, params?): AsyncGenerator<Event, void & Event, undefined>
Retrieves all events, iterating over paginated results.
• conversationId: string
The conversation id to retrieve events from.
• params?: 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);
}
conversations/lib/conversations.ts:690
listAllMembers(conversationId, params?): AsyncGenerator<Member, void & Member, undefined>
Retrieves all members, iterating over paginated results.
• conversationId: string
The conversation id to retrieve members from.
• params?: 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);
}
conversations/lib/conversations.ts:486
listAllUserConversations(userId, params?): AsyncGenerator<Conversation, void & Conversation, undefined>
Retrieves all conversations, for a user
• userId: string
The user id to retrieve conversations from.
• params?: 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);
}
conversations/lib/conversations.ts:370
listAllUserSessions(userId, params?): AsyncGenerator<Session, void & Session, undefined>
Retrieves all session, for a user
• userId: string
The user id to retrieve sessions from.
• params?: ListSessionParameters
= {}
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);
}
conversations/lib/conversations.ts:407
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>
Parses the response based on its content type.
• T
The expected type of the parsed response data.
• request: VetchOptions
The request options.
• response: Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
server-client/dist/lib/client.d.ts:168
protected prepareBody(request): undefined | string
Prepares the body for the request based on the content type.
• request: VetchOptions
The request options.
undefined
| string
- The prepared request body as a string or undefined.
server-client/dist/lib/client.d.ts:158
protected prepareRequest(request): Promise<VetchOptions>
Prepares the request with necessary headers, authentication, and query parameters.
• request: VetchOptions
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
server-client/dist/lib/client.d.ts:151
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>
Sends a DELETE request to the specified URL.
• T
• url: string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
server-client/dist/lib/client.d.ts:78
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a POST request with form data to the specified URL.
• T
• url: string
The URL endpoint for the POST request.
• payload?: Record
<string
, string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
server-client/dist/lib/client.d.ts:86
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>
Sends a GET request to the specified URL with optional query parameters.
• T
• 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.
Promise
<VetchResponse
<T
>>
- The response from the GET request.
server-client/dist/lib/client.d.ts:94
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a PATCH request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the PATCH request.
• payload?
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
server-client/dist/lib/client.d.ts:104
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a POST request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the POST request.
• payload?
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
server-client/dist/lib/client.d.ts:114
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>
Sends a PUT request to the specified URL with an optional payload.
• T
• url: string
The URL endpoint for the PUT request.
• payload?
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
server-client/dist/lib/client.d.ts:124
sendRequest<T>(request): Promise<VetchResponse<T>>
Sends a request adding necessary headers, handling authentication, and parsing the response.
• T
• request: VetchOptions
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
server-client/dist/lib/client.d.ts:144
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
• T
• method: POST
| PUT
| PATCH
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
• url: string
The URL endpoint for the request.
• payload?
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
server-client/dist/lib/client.d.ts:135
updateConversation(conversation): Promise<Conversation>
Updates an existing conversation with the provided details.
• conversation: Conversation
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);
conversations/lib/conversations.ts:322
updateMember(
conversationId,
memberId,
params): Promise<Member>
Updates an existing member with the provided details.
Setting the state to left will result in the member leaving the conversation.
• conversationId: string
The conversation id to update the member in.
• memberId: string
The member details to be updated.
• params: UpdateMemberParameters
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);
conversations/lib/conversations.ts:660
type AnyChannel:
| PhoneNumberChannel
| SipChannel
| AppChannel
| WebSocketChannel
| VbcChannel;
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;
conversations/lib/types/anyMessageBody.ts:29
type AnyMessageBodyResponse: { [P in keyof AnyMessageBody as SnakeToCamelCase<P>]: AnyMessageBody[P] };
conversations/lib/types/responses/eventResponse.ts:14
type AppChannel: object;
Type representing an app channel.
type: ChannelType.APP;
The type of channel (app).
user: string;
The app user.
conversations/lib/types/appChannel.ts:6
type ASRResult: object;
confidence: number;
Confidence of the word
word: string;
Word recognized
conversations/lib/types/messageASRBody.ts:3
type AudioSettings: object;
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.
conversations/lib/types/audioSettings.ts:4
type AudioSettingsRequest: object;
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.
conversations/lib/types/requests/createMemberRequest.ts:4
type AudioSettingsResponse: object;
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.
conversations/lib/types/responses/memberResponse.ts:6
type Conversation: object;
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.
conversations/lib/types/conversation.ts:8
type ConversationCallback: object;
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.
conversations/lib/types/conversationCallback.ts:5
type ConversationCallbackRequest: object;
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.
params.application_id: string;
The application ID for the callback.
params.ncco_url: string;
The NCCO URL for the callback.
optional url: string;
The callback URL.
conversations/lib/types/requests/conversationCallbackRequest.ts:4
type ConversationPage: object;
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.
conversations/lib/types/conversationPage.ts:7
type ConversationPageResponse: object & APILinks;
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.
conversations/lib/types/responses/conversationPageResponse.ts:7
type ConversationResponse: object & Omit<Conversation, "sequenceNumber" | "displayName" | "imageUrl" | "properties"> & APILinks;
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.
conversations/lib/types/responses/conversationResponse.ts:7
type CreateConversationRequest: object;
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).
conversations/lib/types/requests/createConversationRequest.ts:11
type CreateEventRequest: object & Pick<Event, "type" | "from">;
body: AnyMessageBodyResponse;
conversations/lib/types/requests/createEventRequest.ts:4
type CreateMemberRequest: object;
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.
conversations/lib/types/requests/createMemberRequest.ts:29
type Event: object;
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
conversations/lib/types/event.ts:5
type EventPage: object;
events: Event[];
Embedded events.
optional links: Record<string, APILink>;
Links to other resources.
pageSize: number;
The number of items returned on this page.
conversations/lib/types/eventPage.ts:4
type EventPageResponse: object & APILinks;
_embedded: EventResponse[];
Embedded events.
page_size: number;
The number of items returned on this page.
conversations/lib/types/responses/eventPageResponse.ts:4
type EventResponse: object & Omit<Event, "fromUser" | "body" | "fromMember"> & APILinks;
_embedded: object;
_embedded.from_member: object;
_embedded.from_member.id: string;
_embedded.from_user: EventUserResponse;
body: AnyMessageBodyResponse;
conversations/lib/types/responses/eventResponse.ts:18
type EventUser: object;
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.
conversations/lib/types/eventUser.ts:1
type EventUserResponse: object & Omit<EventUser, "displayName">;
display_name: string;
conversations/lib/types/responses/eventResponse.ts:10
type InitiatorInvited: object;
invited: object;
Details about the initiator when the member invited.
invited.isSystem: boolean;
true if the user was invited by an admin JWT
conversations/lib/types/member.ts:31
type InitiatorInvitedResponse: object;
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
conversations/lib/types/responses/memberResponse.ts:56
type InitiatorJoined: object;
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.
conversations/lib/types/member.ts:9
type InitiatorJoinedResponse: object;
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.
conversations/lib/types/responses/memberResponse.ts:31
type LegState: object;
optional reason: ReasonCode;
Reason code of the message leg
status: LegStatus;
Status of the message leg
optional succssful: boolean;
If the leg is successful
conversations/lib/types/messageLegBody.ts:5
type ListConversationsParameters: object;
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.
conversations/lib/types/parameters/listConversationsParameters.ts:4
type ListEventParameters: object;
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.
conversations/lib/types/parameters/listEventParameters.ts:4
type ListMemberParameters: object;
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
conversations/lib/types/parameters/listMemberParameters.ts:1
type ListMemberResponse: object & APILinks;
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
conversations/lib/types/responses/listMemberResponse.ts:9
type ListSessionParameters: object;
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
conversations/lib/types/parameters/listSessionParameters.ts:1
type Member: object;
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.
conversations/lib/types/member.ts:46
type MemberPage: object;
optional links: Record<string, APILink>;
HAL links for the page.
members: Member[];
The list of members.
pageSize: number;
The list of members.
conversations/lib/types/memberPage.ts:4
type MemberPageResponse: object & APILinks;
_embedded: object;
HAL Page response
_embedded.members: ListMemberResponse[];
The members in the page.
page_size: number;
Number of members in the page.
conversations/lib/types/responses/memberPageResponse.ts:5
type MemberResponse: object & APILinks;
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.
conversations/lib/types/responses/memberResponse.ts:71
type MemberUserResponse: object & APILinks;
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
conversations/lib/types/responses/memberUserResponse.ts:6
type MessageASRBody: object;
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
conversations/lib/types/messageASRBody.ts:15
type MessageAudioBody: object;
audio: object;
Message audio
audio.url: string;
Audio URL
messageType: EventMessageType.AUDIO;
Message type
conversations/lib/types/messageAudioBody.ts:3
type MessageChannelBody: object;
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
conversations/lib/types/messageChannelBody.ts:4
type MessageConversationBody: object;
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.
conversations/lib/types/messageConversationBody.ts:3
type MessageCustomBody: object;
custom: Record<string, number | string | boolean>;
Custom data for message
messageType: EventMessageType.CUSTOM;
Message type
conversations/lib/types/messageCustomBody.ts:4
type MessageEventBody: object;
eventId: string;
The event id.
conversations/lib/types/messageEventBody.ts:1
type MessageFileBody: object;
file: object;
file.url: string;
File URL
messageType: EventMessageType.FILE;
Message type
conversations/lib/types/messageFileBody.ts:3
type MessageImageBody: object;
image: object;
Message image
image.url: string;
Image URL
messageType: EventMessageType.IMAGE;
Message type
conversations/lib/types/messageImageBody.ts:3
type MessageLegBody: object;
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
conversations/lib/types/messageLegBody.ts:23
type MessageLocationBody: object;
location: object;
location.address: string;
Address
location.latitude: string;
Latitude
location.longitude: string;
Longitude
location.name: string;
Name
messageType: EventMessageType.LOCATION;
Message Type
conversations/lib/types/messageLocationBody.ts:3
type MessageMemberBody: object & Omit<Member, "status" | "id" | "conversationId"> & Omit<UpdateMemberParameters, "state" | "from">;
optional audio: boolean;
Audio Message
memberId: string;
Member ID
conversations/lib/types/messageMemberBody.ts:4
type MessagePlayDTMFBody: object;
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.
conversations/lib/types/messagePlayDTMFBody.ts:3
type MessageRandomBody: object;
messageType: EventMessageType.RANDOM;
conversations/lib/types/messageRandomBody.ts:3
type MessageRecordBody: object;
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
conversations/lib/types/messageRecordBody.ts:1
type MessageRecordIdBody: object;
recordId: string;
Recording ID
conversations/lib/types/messageRecordIdBody.ts:1
type MessageRTCAnswerBody: object & MessageRTCIdBody;
answer: string;
isFromMb: boolean;
sessionDestination: string;
conversations/lib/types/messageRTCAnswerBody.ts:3
type MessageRTCIdBody: object;
rtcId: string;
RTC ID
conversations/lib/types/messageRTCIdBody.ts:1
type MessageSayBody: object;
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
conversations/lib/types/messageSayBody.ts:1
type MessageSayIdBody: object;
sayId: string;
The ID of the message.
conversations/lib/types/messageSayIdBody.ts:1
type MessageSIPBody: object;
Standard SIP and RTC message body
channel: AnyChannel;
Call channel
This is the same body for RTC and SIP
conversations/lib/types/messageSIPBody.ts:8
type MessageSIPDirectionBody: object & MessageSIPBody;
Standard SIP and RTC message body with direction
direction: CallDirection;
Direction of the call
This is the same body for RTC and SIP
conversations/lib/types/messageSIPDirectionBody.ts:9
type MessageSIPHangupBody: object & MessageSIPDirectionBody;
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
conversations/lib/types/messageSIPHangupBody.ts:8
type MessageSIPMachineBody: object & MessageSIPBody;
confidence: number;
Confidence of the machine detection
type: string;
Type of SIP call
conversations/lib/types/messageSIPMachineBody.ts:3
type MessageSIPStatusBody: object & MessageSIPBody;
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
conversations/lib/types/messageSIPStatusBody.ts:9
type MessageStatusBody: object;
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
conversations/lib/types/messageStatusBody.ts:3
type MessageTemplateBody: object;
messageType: EventMessageType.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
conversations/lib/types/messageTemplateBody.ts:3
type MessageTextBody: object;
messageType: EventMessageType.TEXT;
Message type
text: string;
Message text
conversations/lib/types/messageTextBody.ts:3
type MessageVCardBody: object;
image: object;
image.url: string;
Image URL
messageType: EventMessageType.VCARD;
Message type
vcard: object;
Message vcard
vcard.url: string;
Vcard url
conversations/lib/types/messageVCardBody.ts:3
type MessageVideoBody: object;
messageType: EventMessageType.VIDEO;
Message type
video: object;
Message video
video.url: string;
Video URL
conversations/lib/types/messageVideoBody.ts:3
type PhoneNumberChannel: object;
Type representing a phone number channel.
number: string;
The phone number.
type: ChannelType.PHONE;
The type of channel (phone).
conversations/lib/types/phoneNumberChannel.ts:6
type Session: object;
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
conversations/lib/types/session.ts:13
type SessionPage: object;
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.
conversations/lib/types/sessionPage.ts:4
type SessionPageResponse: object & APILinks;
_embedded: object;
HAL Page response
_embedded.sessions: SessionResponse[];
The sessions in the page.
page_size: number;
Number of members in the page.
conversations/lib/types/responses/sessionPageResponse.ts:4
type SessionResponse: object & Omit<Session, "user">;
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.
conversations/lib/types/responses/sessionResponse.ts:6
type SessionUser: object;
id: string;
The ID of the user.
name: string;
The name of the user.
conversations/lib/types/session.ts:1
type SipChannel: object;
Type representing a SIP channel.
password: string;
The SIP password.
type: ChannelType.SIP;
The type of channel (SIP).
uri: string;
The SIP URI.
username: string;
The SIP username.
conversations/lib/types/sipChannel.ts:6
type UpdateMemberParameters: object;
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: MemberState.LEFT | MemberState.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
conversations/lib/types/parameters/updateMemberParameters.ts:6
type VbcChannel: object;
Type representing a VBC (Voice Business Cloud) channel.
extension: string;
The VBC extension.
type: ChannelType.VBC;
The type of channel (VBC).
conversations/lib/types/vbcChannel.ts:6
type WebSocketChannel: object;
Type representing a WebSocket channel.
contentType: string;
The content type for WebSocket.
type: ChannelType;
The type of channel (WebSocket).
uri: string;
The WebSocket URI.