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.
|
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.
|
voicemaildate |
String | When was the voicemail file received. |
voicemaillength |
String | The duration of the voicemail. |
Examples
Request ExampleQuery voicemail for extension 1000.
POST /api/v1.1.0/voicemail/query?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1 Content-Type:application/json; charset=utf-8 Host: api.yeastarcloud.com { "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: api.yeastarcloud.com
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" } ] }