Download a Voicemail Message

Download a specific vociemail message.

Steps to download a voicemail message

Request URL

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

Request parameters

Table 1.
Parameter Required Type Description
msg_id Yes String The unique ID of voicemail message.
Note: You can query the message ID using Query Voicemail Messages of an Extension or a Group Voicemail.

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.
file String The unique file name of the voicemail message.
download_resource_url String The download URL of the voicemail message.
Note: The download URL is only valid for 30 minutes.

Examples

Request example

Obtain the download URL of a voicemail message (ID: 1713033769-00000619).

GET /openapi/v1.0/vm/download?access_token=OhhwaZiSoRIJdeC34wQYH7hUjHcuKpf5&msg_id=1713033769-00000619 HTTP/1.1 

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

Response example

HTTP/1.1 200 OK

{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "file": "PBX-Voicemail-x.15.0.x-download-20240423160019-3nHw52nGalosEJ62.wav",
    "download_resource_url": "/api/download/PBX-Voicemail-x.15.0.x-download-20240423160019-3nHw52nGalosEJ62.wav"
}

Download the voicemail message

After you get the download URL of the voicemail message, you need to combine it with the {base_url} to compose a download request, and then send the request to download the voicemail message.

Download link format

GET {base_url}/{download_resource_url}?access_token={access_token}

Download link example

GET https://yeastardocs.example.yeastarcloud.com/api/download/PBX-Voicemail-x.15.0.x-download-20240423160019-3nHw52nGalosEJ62.wav?access_token=MB1OklPar5hnDfhi4srZa8FrZ4znFSzr HTTP/1.1