-
Notifications
You must be signed in to change notification settings - Fork 387
Voicemail
Caution
This documentation may no longer be current. Click here to view the updated content on our Developer Portal.
- Initialize the voicemailClient
- Voicemail Response Object
- Fetch a Voicemail Summary
- Fetch a Voicemail Transcription
- Mark a Voicemail As Unread
- Delete a Voicemail
The VoicemailClient object is a supplementary Calling SDK module that adds comprehensive support for voicemail functionality. Before continuing, refer to the Quickstart Guide to understand how Call objects are created and how different modules are instantiated. The VoicemailClient object offers a variety of functions which are covered in this article in detail.
The voicemail client instance must be initialized to enable access to the voicemail backend services using the init() methood of the voicemailClient object:
const voicemailClient = calling.voicemailClient;
const initResponse = await voicemailClient.init();Here's an example response from the voicemailClient method:
{
statusCode: number;
data: {
voicemailList?: MessageInfo[];
voicemailContent?: {
type: string | null;
content: string | null;
};
voicemailSummary?: SummaryInfo;
voicemailTranscript?: string | null;
error?: string;
};
message: string | null;
};The getVoicemailList() method retrieves the voicemails present in the voicemail box of the user:
const voicemailListResponse = await voicemailClient.getVoicemailList(
OFFSET,
OFFSETLIMIT,
SORT.DESC,
true
);The following table describes the options available for the arguments passed to the getVoicemailList() method:
| Parameters |
Options
|
| Parameters | See table above |
| Returns | Promise<VoicemailResponseEvent> |
The getVoicemailSummary() method fetches the count for various categories of voicemails in a user's mailbox. The method's response consists of counts for new voicemails received, new urgent voicemails received, old voicemails, and old urgent voicemails:
const voicemailSummaryResponse = await voicemailClient.getVoicemailSummary();| Parameters | -- |
| Returns | Promise<VoicemailResponseEvent> |
Here's an example of the response for the getVoicemailSummary() method:
{
statusCode: 200,
data: {
voicemailSummary: {
newMessages: 2,
newUrgentMessages: 1,
oldMessages: 3,
oldUrgentMessages: 2,
},
},
message: SUCCESS,
};The getVMTranscript() method API fetches a transcript for a voicemail. It takes a messageID as an argument:
const voicemailTranscriptResponse = await voicemailClient.getVMTranscript(
messageID
);| Parameters | messageID<string> |
| Returns | Promise<VoicemailResponseEvent> |
Here's an example of the response received when a transcript is fetched successfully:
{
statusCode: 200,
data: {
transcript: "This is some transcript text from the voicemail ID.",
},
message: READY | FAILURE | NA | PENDING,
};Here's an example of a messageID returned by the voicemail client:
v2.0/user/69fde5ad-fb8b-4a1b-9998-b0999e95719b/VoiceMessagingMessages/dfe55899-1f55-474f-8f00-bc5915757070The voicemailMarkAsRead() method API marks a voicemail as read. It takes a messageID as an argument:
const voicemailMarkAsReadResponse = await voicemailClient.voicemailMarkAsRead(
messageID
);| Parameters | messageID<string> |
| Returns | Promise<VoicemailResponseEvent> |
Here's an example response from the voicemailMarkAsRead() method:
{
statusCode: 200,
data: {},
message: SUCCESS,
};The voicemailMarkAsUnread() method API marks a voicemail as unread. It takes a messageID as an argument:
const voicemailMarkAsUnreadResponse =
await voicemailClient.voicemailMarkAsUnread(messageID);| Parameters | messageID<string> |
| Returns | Promise<VoicemailResponseEvent> |
Here's an example response from the voicemailMarkAsUnread() method:
{
statusCode: 200,
data: {},
message: SUCCESS,
};The deleteVoicemail() deletes a voicemail. It takes a messageID as an argument:
const voicemailDeleteResponse = await voicemailClient.deleteVoicemail(
messageID
);| Parameters | messageID<string> |
| Returns | Promise<VoicemailResponseEvent> |
Here's an example response from the deleteVoicemail() method upon successfully deleting a voicemail:
{
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