Query Voicemail Files

Query voicemail files of a specific extension.

Endpoint

POST /api/v1.1.0/voicemail/query?token={token}

Request Parameters

  • Sending no parameter means query all extensions' voicemails.

  • To query multiple extensions, separate extid with ,. For example, {"extid": "1000,1001,1002"}.
Name Importance Type Description
extid Yes Int Query which extension's voicemail.
  • Query an extension: Set extid to the extension number.

    Example: "extid":"1000"

  • Query multiple extensions: Set extid to the extension number. Separate multiple extensions with ,.

    Example: "extid": "1000,1001"

  • Query all extensions: Do not send extid parameter.

Response Parameters

Note: If the queried extension doesn't have voicemail files, the PBX will respond the request status only.
Name Type Description
voicemails Object Voicemails Object.
extid String Query which extension's voicemail.
voicemail Object Voicemail Object.
voicemailfile String The name of voicemail file.
messagefrom String The voicemail file was sent from which number.
voicemailstatus String The voicemail status.
  • read
  • unread
voicemaildate String When was the voicemail file received.
voicemaillength String The duration of the voicemail.

Examples

Request Example

Query voicemail for extension 1000.

POST /api/v1.1.0/voicemail/query?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150
{
    "extid": "1000"
}

Query voicemail for all extensions.

POST /api/v1.1.0/voicemail/query?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150
Response Example
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
    "status": "Success",
    "voicemails": [
        {
            "extid": "1000",
            "voicemail": [
                {
                    "voicemailfile": "msg0000.wav",
                    "messagefrom": "2000",
                    "voicemailstatus": "read",
                    "voicemaildate": "2018-05-04 18:00:00",
                    "voicemaillength": "42"
                }
    {
                    "voicemailfile": "msg0001.wav",
                    "messagefrom": "2000",
                    "voicemailstatus": "unread",
                    "voicemaildate": "2018-05-04 18:30:00",
                    "voicemaillength": "42"
                }
            ]
        }