switchvox.users.voicemailGreetings.add
From SwitchvoxExtendAPI
Contents |
Description
Upload a new voicemail greeting for a user and makes it the active voicemail greeting for its type. Must be called by posting the request and file to the /xml handler.
Arguments
- See the Constructing Requests page to learn how to use arguments in requests.
| Name | Required | Type | Default | Description |
| account_id | required | integer | The account the voicemail greeting belongs to. | |
| voicemail_greeting_type | required | string | The type of voicemail greeting you are adding. (name, busy, unavailable). | |
| voicemail_greeting_name | required | string | A name for the voicemail greeting. | |
| voicemail_greeting_file | required | file | A wav file of the new greeting. |
Example Requests & Responses
- Please see the API Request and Response Format section for more information on various request encodings.
Example One
Request
Upload a new unavailable greeting named In a Meeting Greeting for account_id 1102.
Simple Example: POST /xml HTTP/1.1 Content-Type: multipart/form-data; boundary=---------------------------7d44e178b0434 Host: pbx.fourloop.com Content-Length: 35261 -----------------------------7d44e178b0434 Content-Disposition: form-data; name="request" <request method="switchvox.users.voicemailGreetings.add"> <parameters> <account_id>1102</account_id> <voicemail_greeting_type>unavailable</voicemail_greeting_type> <voicemail_greeting_name>In a Meeting Greeting</voicemail_greeting_name> </parameters> </request> -----------------------------7d44e178b0434 Content-Disposition: form-data; name="voicemail_greeting_file"; filename="C:\greeting.wav" Content-Type: audio/wav {WAV FILE} -----------------------------7d44e178b0434—
Response
Successfully added greeting.
<response method="switchvox.users.voicemailGreetings.add"> <result> <success/> </result> </response>
Error Codes
- See the Error Code Formatting section to see the xml structure when an error is returned.
- See the Generic Error Codes section to see a list of general fault codes that may be returned.
| Code | Description |
| 10014 | Invalid account_id (%1). Account_ids may only contain digits. |
| 19823 | Invalid voicemail greeting name (%1). Must be numbers, letters, spaces or dashes - 32 characters or less. |
| 65073 | Voicemail greeting type is required. |
| 37136 | Invalid voicemail greeting type (%1). Valid types are name, message, unavailable, busy or busy_message. |
| 56428 | The greeting file you uploaded is not a valid wav file. |
| 27168 | Your account is not permitted to run this action. |
| 41714 | Missing root voicemail directory. |
| 74061 | Could not upload your file. Do you have enough diskspace? |