Upload a Sound Element
Uploads an audio element from a file resource that is uploaded through the upload credential flow.
Note:
The tested requests returned 422 because the referenced file resources have no file extension. A valid request references a resource whose file name carries an allowed extension, and returns 200.
Request URL
POST {base_url}/uc-cconfig/api/v1/sounds/elements/upload
Request parameters
- Headers
-
Parameter Required Type Description Authorization Yes String The access token used for authentication. Format: Bearer
{access_token}.x-tenant-code Yes String The tenant name. Note: You can obtain tenant name using the Query Tenants interface.
- Body parameters
-
Parameter Required Type Description soundType No String The type of the audio element, which determines the storage path validation rule.
Valid value:
SOUND_TYPE_CUSTOM_PROMPT: A custom prompt.SOUND_TYPE_MOH_ITEM: A music-on-hold playlist audio item.SOUND_TYPE_VOICEMAIL_GREETING: A voicemail greeting.
name No String The name of the audio element, which supports Unicode letters, digits, connector symbols, underscores, and dots. containerId No String The container ID. This parameter is required when soundType is SOUND_TYPE_MOH_ITEM(the MOH playlist ID), and is not used when soundType isSOUND_TYPE_CUSTOM_PROMPTorSOUND_TYPE_VOICEMAIL_GREETING.resourceId No String The ID of the file resource, which is returned by the upload credential flow. panelSource No String The panel module to filter by. This parameter is used only by the voicemail panel, and the value is user_mailbox. An empty string indicates that it is not associated with a panel module.panelResourceId No String The resource ID of the panel module.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| code | String | The HTTP status code of the request.
|
| message | String | The status message of the request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| result | Object<Uploaded_Element> | The uploaded audio element. |
- Uploaded_Element
-
Parameter Type Description id String The ID of the audio element. soundType String The type of the audio element:
SOUND_TYPE_CUSTOM_PROMPTSOUND_TYPE_MOH_ITEMSOUND_TYPE_VOICEMAIL_GREETING
name String The name of the audio element. sourceType String The source of the audio element:
SOURCE_TYPE_UPLOADSOURCE_TYPE_USER_RECORD
fileSize String The size of the audio file, in bytes. durationMs Integer The duration of the audio file, in milliseconds. resourceId String The ID of the audio file resource in the resource service. containerId String The container ID of the audio element. panelSource String The panel module that the audio element is associated with. panelResourceId String The resource ID of the panel module. createdAt String The time when the audio element was created, in Unix timestamp format (milliseconds). updatedAt String The time when the audio element was last updated, in Unix timestamp format (milliseconds).