Upload an Extension Voicemail Greeting
Upload a voicemail greeting for specified extension.
Request URL
POST {base_url}/{api_path}/extension_vm_greeting/upload?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| owner | Yes | String | The number of the extension to which the uploaded voicemail greeting belongs. Note: You can query the
extension number using Search Specific Extensions. |
| file | Yes | File | The voicemail greeting file. Note: Only a
file in ".wav", ".mp3" or ".gsm" format is allowed, and the file
size must not exceed 8MB. |
| is_check | No | String | The operation mode. Note: This parameter is required and
available only when the parameters old_file and
new_file
are
not included in the request.Valid value:
|
| old_file | No | String | The filename of the voicemail greeting to be replaced, including
the file extension (e.g., "demo_greeting.wav"). Note: You can query the filename of the greeting
using Query Extension Voicemail Greeting List. |
| new_file | No | String | The new filename used to update the filename of the replaced
greeting, including the file extension (e.g.,
"demo_greeting.wav"). Note: The file
extension must be the same as the old file. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| owner | String | The number of the extension to which the uploaded voicemail greeting belongs. |
Examples
Request example
- Check whether the filename of the greeting (file: vm_away.wav) already exists in
the voicemail greeting list for specified extension (number: 3200).
POST /openapi/v1.0/extension_vm_greeting/upload?access_token=L3LDr0HRuT190YmccVIaXj6OxkLzUHfo HTTP/1.1 Host: yeastardocs.example.yeastarcloud.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="/D:/greeting/vm_away.wav" Content-Type: audio/wav (binary data) ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="owner" 3200 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="is_check" ask ------WebKitFormBoundary7MA4YWxkTrZu0gW--Figure 1. Request example 1 in Postman
- Upload the voicemail greeting (file: vm_away.wav) for the specified extension
(number: 3200).
POST /openapi/v1.0/extension_vm_greeting/upload?access_token=L3LDr0HRuT190YmccVIaXj6OxkLzUHfo HTTP/1.1 Host: yeastardocs.example.yeastarcloud.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="/D:/greeting/vm_away.wav" Content-Type: audio/wav (binary data) ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="owner" 3200 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="is_check" force ------WebKitFormBoundary7MA4YWxkTrZu0gW--Figure 2. Request example 2 in Postman
Response example
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "owner": "3200" }