Methods

Objects

media/library

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.
media/library.set_content 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.

Methods

media/library.create

Description

Create a new Media in the Library

Signature

method: media/library.create

params: [string name]

Parameters

Parameter Type Description NULL
name string Media name
Format: media_library_name (Unicode letters, parenthesis, dot, plus, star, numbers, dash, space, hash)
NO

Result

Type Description Format/Object
int Media ID

See Also

media/library.delete

Description

Delete a Media in the Library

Signature

method: media/library.delete

params: [int media_id]

Parameters

Parameter Type Description NULL
media_id int Media ID NO

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.

See Also

media/library.get

Description

Get a specific Media.Library

Signature

method: media/library.get

params: [int id]

Parameters

Parameter Type Description NULL
id int Media ID NO

Result

Type Description Format/Object
object Media Object: Media.Library

media/library.get_list

Description

List Medias available in the Library by categories.

Signature

method: media/library.get_list

params: [array categories]

Parameters

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

Result

Type Description Format/Object
object Dictionary (key/value) of Medias. Key is int Media ID, Value is a Media.Library object Object: Media.Library

See Also

  • Object: Media.Library

media/library.get_phone_id

Description

Get a DTMF sequence "phone_id" in order to record a Media.Library on the phone.

Signature

method: media/library.get_phone_id

params: [int media_id, string country_code]

Parameters

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

Result

Type Description Format/Object
object Phone ID (DTMF sequence + phone number). Object: Media.PhoneID

media/library.overview

Description

Get an overview of your library

Signature

method: media/library.overview

params: []

Parameters

No parameters.

Result

Type Description Format/Object
object Overview Object: Media.Library.Overview

media/library.search

Description

Search through your Media library.

Signature

method: media/library.search

params: [object filters, object options]

Parameters

Parameter Type Description NULL
filters object Search filters
Object: Media.SearchFilters
NO
options object Search options
Object: Search.Options
NO

Result

Type Description Format/Object
object Search results Object: Search.Results

media/library.set_content

Description

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.

Signature

method: media/library.set_content

params: [int media_id, string text, string audio_data]

Parameters

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

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.

media/library.set_content_from_file

Description

Set a Media.Library content with your own file.

Signature

method: media/library.set_content_from_file

params: [int media_id, string file]

Parameters

Parameter Type Description NULL
media_id int The Media ID to change. NO
file string imported temporary file name NO

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.

media/library.set_content_from_recording

Description

Set a Media.Library content from a recording previously created using the REAL-TIME command "record".

Signature

method: media/library.set_content_from_recording

params: [int media_id, string media_file]

Parameters

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

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.

media/library.set_name

Description

Change a Media.Library name.

Signature

method: media/library.set_name

params: [int media_id, string name]

Parameters

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

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.

media/library.set_tags

Description

Set Tags on a Media.Library. You can set as many tags as you want.

Signature

method: media/library.set_tags

params: [int media_id, array tags]

Parameters

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

Result

Type Description Format/Object
bool Always TRUE, throws an Exception otherwise.