Add an Extension Voicemail Greeting

Create an extension voicemail greeting via text-to-speech (TTS). The audio is generated asynchronously, and the result is returned through a WebSocket callback.

Request URL

POST {base_url}/{api_path}/extension_vm_greeting/create?access_token={access_token}

Request parameters

Parameter Required Type Description
file Yes String The filename of the voicemail greeting.
Note:
  • The filename can not include the file extension, space, or special characters ' " ! : @ # $ % ^ * . & ( ) { } [ ] ; / , `.
  • The maximum length is 250 characters.
type Yes String The voicemail greeting type.

Valid value:

  • tts
number Yes String The number of the extension to which the voicemail greeting belongs.
text Yes String The text used to generate voicemail greeting.
Note:
  • The maximum length is 1000 characters.
  • The text language must be same as the language set in language.
language Yes String The language code used for TTS (e.g., "en-US" or "zh-CN").
Note: The language must be supported by the vendor set in asr_manufacturer.
asr_manufacturer Yes String The TTS vendor.
Valid value:
  • aws
  • azure
  • xunfei
voice_id No String The ID of the voice profile.
speed No Integer The speech rate.
Note: A number from 1 to 100 is allowed.
volume No Integer The volume.
Note: A number from 1 to 100 is allowed.
pitch No Integer The pitch.
Note: A number from 1 to 100 is allowed.

Response parameters

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.
id Integer The ID of the created greeting.
status String The TTS generation status.
  • pending: The audio is being generated asynchronously.
  • complete: The audio has been generated.
request_id String The client request ID of the asynchronous TTS task, used to match the WebSocket callback notification.

Example

Request example

POST /openapi/v1.0/extension_vm_greeting/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
  "file": "doc_demo_ext",
  "type": "tts",
  "number": "1003",
  "text": "Please leave a message after the tone.",
  "language": "en-US",
  "asr_manufacturer": "aws",
  "voice_id": "en-US_female_ne_danielle",
  "speed": 50,
  "volume": 50
}

Response example

HTTP/1.1 200 OK
{
  "errcode": 0,
  "errmsg": "SUCCESS",
  "id": 0,
  "status": "pending",
  "request_id": ""
}