Query Voicemail Messages of Multiple Extensions or Group Voicemails

Query the voicemail messages of multiple extensions or group voicemails.

Request URL

GET {base_url}/{api_path}/vm/query?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
page No Integer Define which page is displayed.
page_size No Integer Define how many records per page.
number Yes String The numbers of the desired extensions or group voicemails.
Note:
  • Use a comma (,) to separate multiple numbers. For example, 1000,1001,6100.
  • For group voicemail, you can only query voicemail messages of the group voicemail whose mode is set to Shared by Members.

Response parameters

Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
voicemail_list Array<Vm_List> The list of the queried extensions or group voicemails, and their voicemail messages.
Vm_List
Parameter Type Description
number String The number of the queried extension or group voicemail.
total_number Integer The total number of the voicemail messages.
data Array<Vm_DetailInfo> The detailed information of the voicemail messages.
Vm_DetailInfo
Table 3.
Parameter Type Description
msg_id String The unique ID of voicemail message.
file_name String The sequential file name of the voicemail message in the extension or group voicemail.
is_read Integer Whether the voicemail message has been read.
  • 0: Unread
  • 1: Read
duration Integer The duration of the voicemail message (Unit: Second).
size Integer File size (Unit: Byte).
group_voicemail_read_status Array<Gvm_Read> The read status of the voicemail message for each group member of the group voicemail.
Note: This parameter only returns the read status for group voicemail. For extension, this parameter returns null.
name String The name of the caller who left the voicemail message.
time String The time when the voicemail message was left.
number String The number of the caller.

Gvm_Read

Table 4.
Parameter Type Description
name String The name of the group member.
number String The extension number of the group member.
is_read Integer The read status of the voicemail message for the group member.
  • 0: Unread
  • 1: Read

Examples

Request example

Query the voicemail messages of extension 1000, 1001, and a group voicemail (Number: 6100).

GET /openapi/v1.0/vm/query?access_token=yehHGBEY7qWKZbwZibmTPO0z7GbKyNL9&number=1000,1001,6100 HTTP/1.1 

Host: yeastardocs.example.yeastarcloud.com
User-Agent: OpenAPI

Response example

HTTP/1.1 200 OK

{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "voicemail_list": [
        {
            "number": "1000",
            "total_number": 2,
            "data": [
                {
                    "msg_id": "1713840514-00000622",
                    "file_name": "msg0000.wav",
                    "is_read": 1,
                    "duration": 18,
                    "size": 309164,
                    "group_voicemail_read_status": null,
                    "name": "Customer Example",
                    "time": "2024/04/23 10:48:34",
                    "number": "5503301"
                },
                {
                    "msg_id": "1713848892-00000627",
                    "file_name": "msg0001.wav",
                    "is_read": 1,
                    "duration": 11,
                    "size": 177644,
                    "group_voicemail_read_status": null,
                    "name": "Customer Example",
                    "time": "2024/04/23 13:08:01",
                    "number": "5503301"
                }
            ]
        },
        {
            "number": "1001",
            "total_number": 2,
            "data": [
                {
                    "msg_id": "1713033773-0000061a",
                    "file_name": "msg0000.wav",
                    "is_read": 0,
                    "duration": 599,
                    "size": 9598444,
                    "group_voicemail_read_status": null,
                    "name": "Customer Example2",
                    "time": "2024/04/14 02:42:53",
                    "number": "5503302"
                },
                {
                    "msg_id": "1713848892-00000626",
                    "file_name": "msg0001.wav",
                    "is_read": 0,
                    "duration": 11,
                    "size": 177644,
                    "group_voicemail_read_status": null,
                    "name": "Customer Example",
                    "time": "2024/04/23 13:08:01",
                    "number": "5503301"
                }
            ]
        },
        {
            "number": "6100",
            "total_number": 2,
            "data": [
                {
                    "msg_id": "1713853925-0000062a",
                    "file_name": "msg0000.wav",
                    "is_read": 0,
                    "duration": 28,
                    "size": 460204,
                    "group_voicemail_read_status": [
                        {
                            "name": "1000",
                            "number": "1000",
                            "is_read": 0
                        },
                        {
                            "name": "1001",
                            "number": "1001",
                            "is_read": 0
                        },
                        {
                            "name": "1003",
                            "number": "1003",
                            "is_read": 0
                        },
                        {
                            "name": "1002",
                            "number": "1002",
                            "is_read": 0
                        }
                    ],
                    "name": "Customer Example",
                    "time": "2024/04/23 14:32:05",
                    "number": "5503301"
                },
                {
                    "msg_id": "1713853578-00000629",
                    "file_name": "msg0000.wav",
                    "is_read": 1,
                    "duration": 9,
                    "size": 145644,
                    "group_voicemail_read_status": [
                        {
                            "name": "1002",
                            "number": "1002",
                            "is_read": 0
                        },
                        {
                            "name": "1000",
                            "number": "1000",
                            "is_read": 1
                        },
                        {
                            "name": "1001",
                            "number": "1001",
                            "is_read": 0
                        },
                        {
                            "name": "1003",
                            "number": "1003",
                            "is_read": 0
                        }
                    ],
                    "name": "Customer Example2",
                    "time": "2024/04/23 14:26:18",
                    "number": "5503302"
                }
            ]
        }
    ]
}