Initializes the voicemail service and returns a voicemail response event.
Retrieves a list of voicemails with optional pagination and sorting options.
Received data can be accessed through data.voicemailList
const voicemailResponse = await voicemailInstance.getVoicemailList(0, 10, SORT.ASC);
The voicemailResponse
object will have voicemailList
object as properties in data attribute.
{
statusCode: 200,
data: {
voicemailList: [messages]
}
}
The offset for pagination. Number of records to skip.
The limit on the number of voicemails to retrieve from the offset.
Sort voicemail list (eg. ASC | DESC).
Optional
refresh: booleanSet to true
to force a refresh of voicemail data from backend (optional).
Retrieves the content of a voicemail message based on its messageId.
Received data can be accessed through data.voicemailContent
const messageId = 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTc3OTQ2NjItNDA5OS00NDQ3LWI';
const voicemailResponse = await voicemailInstance.getVoicemailContent(messageId);
The voicemailResponse
object will have voicemailContent
object as properties in data attribute.
{
statusCode: 200,
data: {
voicemailContent: {
type: 'message',
content: 'something'
}
}
}
The identifier of the voicemail message.
Retrieves a quantitative summary of voicemails for a user.
Received data can be accessed through data.voicemailSummary
const voicemailResponse = await voicemailInstance.getVoicemailSummary();
The voicemailResponse
object will have voicemailSummary
object as properties in data attribute.
{
statusCode: 200,
data: {
voicemailSummary: {
newMessages: 1,
oldMessage: 7,
newUrgentMessages: 0,
oldUrgentMessages: 0
}
}
}
Marks a voicemail message as read based on its message identifier.
Note: Response will have a statusCode
and message
. But data
attribute is not returned in the response unless it is
an error response in that case data
will have error
attribute.
The identifier of the voicemail message to mark as read.
const messageId = 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTc3OTQ2NjItNDA5OS00NDQ3LWI';
const voicemailResponse = await voicemailInstance.voicemailMarkAsRead(messageId);
The voicemailResponse
object will be populated as below:
{
statusCode: 200,
message: "SUCCESS"
}
The voicemailResponse
object will be populated as below in case of error response:
{
statusCode: 404,
message: "FAILURE"
data: {
error: "Failure reason"
}
}
Marks a voicemail message as unread based on its message identifier.
Note: Response will have a statusCode
and message
. But data
attribute is not returned in the response unless it is
an error response in that case data
will have error
attribute.
const messageId = 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTc3OTQ2NjItNDA5OS00NDQ3LWI';
const voicemailResponse = await voicemailInstance.voicemailMarkAsUnread(messageId);
The voicemailResponse
object will be populated as below:
{
statusCode: 200,
message: "SUCCESS"
}
The identifier of the voicemail message to mark as unread.
Deletes a voicemail message based on its message identifier.
Note: Response will have a statusCode
and message
. But data
attribute is not returned in the response unless it is
an error response in that case data
will have error
attribute.
const messageId = 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTc3OTQ2NjItNDA5OS00NDQ3LWI';
const voicemailResponse = await voicemailInstance.deleteVoicemail(messageId);
The voicemailResponse
object will be populated as below:
{
statusCode: 200,
message: "SUCCESS"
}
The identifier of the voicemail message to delete.
Retrieves the transcript of a voicemail message based on its message identifier.
Received data can be accessed through data.voicemailTranscript
const messageId = 'Y2lzY29zcGFyazovL3VzL01FU1NBR0UvNTc3OTQ2NjItNDA5OS00NDQ3LWI';
const voicemailResponse = await voicemailInstance.getVMTranscript(messageId);
The voicemailResponse
object will have voicemailTranscript
object as properties in data attribute.
{
statusCode: 200,
data: {
voicemailTranscript: 'Here is your transcript.'
}
}
The identifier of the voicemail message.
Resolves contact information based on calling party information.
const callingPartyInfo = { userId: "Y2lzY29zcGFyazovL3VzL1BFT1BMRS8wZmVh" };
const contactInfo = await voicemailInstance.resolveContact(callingPartyInfo);
The calling party information for contact resolution.
Interface for the Voicemail Module. This interface provides a set of APIs for retrieving and updating voicemail, including operations such as retrieving voicemail lists, messages count summary, marking as read/unread, and accessing voicemail transcripts.
These APIs return promises that resolve to a
VoicemailResponseEvent
object, which includes a status code, data, and message. The data field within this response object may contain various objects, with different types depending on the specific API used.Example
A successful response will be structured as follows:
A failure response will be structured as follows: