CreateBlogSupport
Log inSign up
Home
Webex Calling
  • Guides
  • Webex Calling Beta
  • Webex Cloud Calling
  • Broadworks Calling
  • UCM Calling
  • Beta Program
  • Webex Status API
  • XML API Deprecation

Webex Calling

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.

anchorInitialize the voicemailClient

anchor

The VoicemailClient is implemented as the Voicemail class in the SDK and there are two ways of instantiating it.

To instantiate just the VoicemailClient, use the createVoicemailClient method:

const voicemailClient = createVoicemailClient(webex, logger);

If the VoicemailClient is instantiated through the calling instantiation:

const voicemailClient = calling.voicemailClient;

The voicemail client instance must be initialized to enable access to the voicemail backend services using the init() methood of the voicemailClient object:

const initResponse = await voicemailClient.init();

anchorVoicemail Response Object

anchor

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;
};
Fetch a Voicemail List

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

NameDescriptionValuesRequired
sort Sorting order of voicemail list, ASC or DESC.

String

ASCDESC
yes
offset Number of records to skip.

Number

yes
offsetLimit Index of the voicemail to fetch from the voicemail list. Stringyes
refresh Refresh the list of voicemails from the backend. Booleanyes

ParametersSee table above
ReturnsPromise<VoicemailResponseEvent>

anchorFetch a Voicemail Summary

anchor

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--
ReturnsPromise<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,
};

anchorFetch a Voicemail Transcription

anchor

The getVMTranscript() method API fetches a transcript for a voicemail. It takes a messageID as an argument:

const voicemailTranscriptResponse = await voicemailClient.getVMTranscript(messageID);

ParametersmessageID<string>
ReturnsPromise<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,
};

The transcript object populates 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.

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-bc5915757070

The entire string is used as the ID.

Mark a Voicemail As Read

The voicemailMarkAsRead() method API marks a voicemail as read. It takes a messageID as an argument:

const voicemailMarkAsReadResponse = await voicemailClient.voicemailMarkAsRead(messageID);

ParametersmessageID<string>
ReturnsPromise<VoicemailResponseEvent>

Here's an example response from the voicemailMarkAsRead() method:

{
 statusCode: 200,
    data: {},
    message: SUCCESS,
};

anchorMark a Voicemail As Unread

anchor

The voicemailMarkAsUnread() method API marks a voicemail as unread. It takes a messageID as an argument:

const voicemailMarkAsUnreadResponse =
  await voicemailClient.voicemailMarkAsUnread(messageID);

ParametersmessageID<string>
ReturnsPromise<VoicemailResponseEvent>

Here's an example response from the voicemailMarkAsUnread() method:

{
 statusCode: 200,
    data: {},
    message: SUCCESS,
};

anchorDelete a Voicemail

anchor

The deleteVoicemail() deletes a voicemail. It takes a messageID as an argument:

const voicemailDeleteResponse = await voicemailClient.deleteVoicemail(messageID);

ParametersmessageID<string>
ReturnsPromise<VoicemailResponseEvent>

Here's an example response from the deleteVoicemail() method upon successfully deleting a voicemail:

{
    statusCode: 200,
    data: {},
    message: SUCCESS,
};
In This Article
  • Initialize the voicemailClient
  • Voicemail Response Object
  • Fetch a Voicemail Summary
  • Fetch a Voicemail Transcription
  • Mark a Voicemail As Unread
  • Delete a Voicemail

Connect

Support

Developer Community

Developer Events

Contact Sales

Handy Links

Webex Ambassadors

Webex App Hub

Resources

Open Source Bot Starter Kits

Download Webex

DevNet Learning Labs

Terms of Service

Privacy Policy

Cookie Policy

Trademarks

© 2025 Cisco and/or its affiliates. All rights reserved.