Query Voicemail Files
Query voicemail files of a specific extension.
Endpoint
POST /api/v0.0.1/voicemail/query?token={token}
Request Parameters
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. |
voicemaildate | String | When was the voicemail file received. |
voicemaillength | String | The duration of the voicemail. |
Examples
Request Example
Query voicemail for extension 102.
POST /api/v0.0.1/voicemail/query?token=813b621cfe8eecf445a2ce1f4a079ffe HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
{
“extid”: “102”
}
Query voicemail for all extensions.
POST /api/v0.0.1/voicemail/query?token=813b621cfe8eecf445a2ce1f4a079ffe HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.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”: “102”,
“voicemail”: [
{
“voicemailfile”: “msg0000.wav”,
“messagefrom”: “6000”,
“voicemaildate”: “2020-04-07 10:56:40”,
“voicemaillength”: “4”
},
{
“voicemailfile”: “msg0001.wav”,
“messagefrom”: “7001”,
“voicemaildate”: “2020-04-07 10:57:31”,
“voicemaillength”: “3”
},
{
“voicemailfile”: “msg0002.wav”,
“messagefrom”: “7001”,
“voicemaildate”: “2020-04-07 11:00:08”,
“voicemaillength”: “2”
}
]
}
]
}