Methods
Objects
Media library management
Method | Description |
---|---|
media/library.create | Create a new Media in the Library |
media/library.delete | Delete a Media in the Library |
media/library.get | Get a specific Media.Library |
media/library.get_list | List Medias available in the Library by categories. |
media/library.get_phone_id | Get a DTMF sequence "phone_id" in order to record a Media.Library on t... |
media/library.overview | Get an overview of your library |
media/library.search | Search through your Media library. |
Set a Media.Library content with your own file. | |
media/library.set_content_from_file | Set a Media.Library content with your own file. |
media/library.set_content_from_recording | Set a Media.Library content from a recording previously created using ... |
media/library.set_name | Change a Media.Library name. |
media/library.set_tags | Set Tags on a Media.Library. You can set as many tags as you want. |
media/library.create
Create a new Media in the Library
method: media/library.create
params: [string name]
Parameter | Type | Description | NULL |
---|---|---|---|
name | string |
Media name Format: media_library_name (Unicode letters, parenthesis, dot, plus, star, numbers, dash, space, hash) |
NO |
Type | Description | Format/Object |
---|---|---|
int | Media ID |
media/library.delete
Delete a Media in the Library
method: media/library.delete
params: [int media_id]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | Media ID | NO |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |
media/library.get
Get a specific Media.Library
method: media/library.get
params: [int id]
Parameter | Type | Description | NULL |
---|---|---|---|
id | int | Media ID | NO |
Type | Description | Format/Object |
---|---|---|
object | Media | Object: Media.Library |
media/library.get_list
List Medias available in the Library by categories.
method: media/library.get_list
params: [array categories]
Parameter | Type | Description | NULL |
---|---|---|---|
categories | array |
Filter by categories. You can also use your own categories. Values: "FAILURE", "IVR", "MISC", "RINGTONE", "VOICEMAIL", "WELCOME", "WHISPER" |
YES |
Type | Description | Format/Object |
---|---|---|
object | Dictionary (key/value) of Medias. Key is int Media ID, Value is a Media.Library object | Object: Media.Library |
media/library.get_phone_id
Get a DTMF sequence "phone_id" in order to record a Media.Library on the phone.
method: media/library.get_phone_id
params: [int media_id, string country_code]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | The Media ID your want to record by phone. | NO |
country_code | string |
The country code you are in (we will give you a local phone number to call). Format: country_code (ISO 3166-1 alpha-2 country code. Example: "US") |
NO |
Type | Description | Format/Object |
---|---|---|
object | Phone ID (DTMF sequence + phone number). | Object: Media.PhoneID |
media/library.overview
Get an overview of your library
method: media/library.overview
params: []
No parameters.
Type | Description | Format/Object |
---|---|---|
object | Overview | Object: Media.Library.Overview |
media/library.search
Search through your Media library.
method: media/library.search
params: [object filters, object options]
Parameter | Type | Description | NULL |
---|---|---|---|
filters | object |
Search filters Object: Media.SearchFilters |
NO |
options | object |
Search options Object: Search.Options |
NO |
Type | Description | Format/Object |
---|---|---|
object | Search results | Object: Search.Results |
media/library.set_content
Set a Media.Library content with your own file.
This method is DEPRECATED and may be removed in the future.
Relying on this method is highly discouraged.
method: media/library.set_content
params: [int media_id, string text, string audio_data]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | The Media ID to change. | NO |
text | string | Text prompt (What is your Media saying?). | NO |
audio_data | string | base64 encoded audio data file. Although WAV 16 bit 48Khz mono is recommended, we recognize almost every audio file formats (wav, mp3, m4a, etc.). Send NULL if you just want to change the text content, not the audio content. | YES |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |
media/library.set_content_from_file
Set a Media.Library content with your own file.
method: media/library.set_content_from_file
params: [int media_id, string file]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | The Media ID to change. | NO |
file | string | imported temporary file name | NO |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |
media/library.set_content_from_recording
Set a Media.Library content from a recording previously created using the REAL-TIME command "record".
method: media/library.set_content_from_recording
params: [int media_id, string media_file]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | The Media ID to change. | NO |
media_file | string | Recording file (see the REAL-TIME "record" command). | NO |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |
media/library.set_name
Change a Media.Library name.
method: media/library.set_name
params: [int media_id, string name]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | The Media ID to change. | NO |
name | string |
The new name. Format: media_library_name (Unicode letters, parenthesis, dot, plus, star, numbers, dash, space, hash) |
NO |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |
media/library.set_tags
Set Tags on a Media.Library. You can set as many tags as you want.
method: media/library.set_tags
params: [int media_id, array tags]
Parameter | Type | Description | NULL |
---|---|---|---|
media_id | int | Media ID | NO |
tags | array | The tags to apply. Dictionary of key/value. Key is the tag type. Value must be an array of tag values. It will completely replace previously set tags. "CATEGORY" and "LANGUAGE" are special tag types where only specific values are allowed. | NO |
Type | Description | Format/Object |
---|---|---|
bool | Always TRUE, throws an Exception otherwise. |