-
Notifications
You must be signed in to change notification settings - Fork 359
Voicemail
The VoicemailClient
is one of these modules. Refer to the Quickstart guide to understand how calling instance is created and different modules are instantiated. VoicemailClient
offers variety of functions which are covered below in this document in detail.
The voicemail client instance needs to be initialized in order to fetch the voicemail backend.
const voicemailClient = calling.voicemailClient;
const initResponse = await voicemailClient.init();
This is the response type returned by the voicemail client for the various functionalities invoked.
VoicemailResponseEvent
{
statusCode: number;
data: {
voicemailList?: MessageInfo[];
voicemailContent?: {
type: string | null;
content: string | null;
};
voicemailSummary?: SummaryInfo;
voicemailTranscript?: string | null;
error?: string;
};
message: string | null;
};
Retrieves the voicemails present in the voicemail box of the user.
const voicemailListResponse = await voicemailClient.getVoicemailList(OFFSET, OFFSETLIMIT, SORT.DESC, true);
Parameters |
options
|
||||||||||||||||||||||
Returns |
Promise<VoicemailResponseEvent> |
Fetches the count for various categories of voicemails in the user's mailbox. This API response consists of counts for new voicemails received, new urgent voicemails received, old voicemail and old urgent voicemails.
const voicemailSummaryResponse = await voicemailClient.getVoicemailSummary();
Parameters | -- |
Returns | Promise<VoicemailResponseEvent> |
An example of the response for voicemail Summary
{
statusCode: 200,
data: {
voicemailSummary: {
newMessages: 2,
newUrgentMessages: 1,
oldMessages: 3,
oldUrgentMessages: 2,
},
},
message: SUCCESS,
};
This API helps in fetching the transcript of a voicemail. The messageID of the voicemail is passed while calling this function.
Note: An example of the messageID stored in the voicemail client is located in the code box below. Please note that the entire string is used as an ID.
v2.0/user/69fde5ad-fb8b-4a1b-9998-b0999e95719b/VoiceMessagingMessages/dfe55899-1f55-474f-8f00-bc5915757070
The function is called using the statement below.
const voicemailTranscriptResponse = await voicemailClient.getVMTranscript(messageID);
Parameters | messageID<string> |
Returns | Promise<VoicemailResponseEvent> |
An example of the response received while fetching the transcript
{
statusCode: 200,
data: {
transcript: "Transcript text",
},
message: READY | FAILURE | NA | PENDING,
};
Note: The transcript object will populate the string only when the transcription is complete and READY. FAILURE indicates that the voicemail service was unable to transcribe the voicemail, while PENDING indicates that transcription is in progress. NA indicates that transcription is not enabled for the user's voicemails.
This API helps in marking the voicemail as Read for the given messageID..
const voicemailMarkAsReadResponse = await voicemailClient.voicemailMarkAsRead(messageID);
Parameters | messageID<string> |
Returns | Promise<VoicemailResponseEvent> |
An example of the response while marking a voicemail read.
{
statusCode: 200,
data: {},
message: SUCCESS,
};
This API helps in marking the voicemail as Unread for the given messageID.
const voicemailMarkAsUnreadResponse = await voicemailClient.voicemailMarkAsUnread(messageID);
Parameters | messageID<string> |
Returns | Promise<VoicemailResponseEvent> |
An example of the response received while marking the voicemail unread.
{
statusCode: 200,
data: {},
message: SUCCESS,
};
This API helps in deleting the voicemail for the given messageID.
const voicemailDeleteResponse = await voicemailClient.deleteVoicemail(messageID);
Parameters | messageID<string> |
Returns | Promise<VoicemailResponseEvent> |
An example of the response received while deleting a voicemail from the user's mailbox.
{
statusCode: 200,
data: {},
message: SUCCESS,
};
Caution
- Introducing the Webex Web Calling SDK
- Core Concepts
- Quickstart guide
- Authorization
- Basic Features
- Advanced Features
- Introduction
- Quickstart Guide
- Basic Features
- Advanced Features
- Multistream
- Migrating SDK version 1 or 2 to version 3