Audio Files

VOTO makes all services available through voice in multiple languages. This requires users to upload audio file segments to use for messages, survey questions, menus, etc. For example, each survey question would require one audio file in each language.

The audio_files interface allows you to upload, update, query, or delete audio files that will later be used for any of these purposes.

Upload An Audio File

Method: POST

URL: https://go.votomobile.org/api/v1/audio_files?param=value

Parameters:

  • api_key
  • description: human-recognizable description for this audio (eg: original file name)
  • file_extension: original filename extension of the audio, so we can identify the format (eg: “mp3”, “wav”, “ul”, etc.)
  • language_id (optional): Optionally specify the language of this file. [default: not-specified]

Note

Since the entire POST body will be treated as the file, the parameters must be passed as part of the URL.

Note that this differs from all other VOTO API requests, where the url-encoded parameters are passed in the request body as a regular POST.

Request Body:

The file contents to be uploaded.

Returns:

ID of the new audio file

{"status":200,"message":"Audio File Upoaded","data":{id: 122}}

Replace/Update An Audio File

Method: PUT

URL: https://go.votomobile.org/api/v1/audio_files/[audio_file_id]?param=value

Parameters:

  • api_key
  • format: original filename extension of the audio, so we can identify the format (eg: “mp3”, “wav”, “ul”, etc.)
  • (optional) description: human-recognizable description for this audio (eg: original file name) [default: unchanged]
  • (optional) language_id: Optionally specify the language of this file. [default: unchanged]

Note

Since the entire PUT body will be treated as the file, the parameters must be passed as part of the URL.

Note that this differs from all other VOTO API requests, where the url-encoded parameters are passed in the request body as a regular POST.

Request Body:

The file contents to be uploaded.

Returns:

ID of the new audio file

{"status":200,"message":"Audio File Updated","data":{id: 122}}

List All Audio Files

Method: GET

URL: https://go.votomobile.org/api/v1/audio_files

Parameters:

  • api_key

Returns:

{
"status":200,
"message": "Audio Files",
"data": {
    "audio_files": [
       {
        id: 111,
        description: "Audio Filename A",
        language_id : 3
                    length_seconds: 47
                    created: 2013-04-09 12:57
                    modified: 2013-04-09 12:57
       },
       {
        id: 112,
        description: "Audio Filename B",
        language_id : null
                    length_seconds: 192
                    created: 2013-04-10 16:57
                    modified: 2013-04-10 17:50
       }
    ]
  }
}

List Details Of An Audio File

Method: GET

URL: https://go.votomobile.org/api/v1/audio_files/[audio_file_id]

Parameters:

  • api_key

Returns:

{
"status":200,
"message":"Audio File",
"data": {
    audio_file:
    {
    id: 111,
    description: "Audio Filename A",
    language_id : 3
            length_seconds: 47
            created: 2013-04-09 12:57
            modified: 2013-04-09 12:57
    }
  }
}

Delete Audio File

Method: DELETE

URL: https://go.votomobile.org/api/v1/audio_files/[audio_file_id]

Parameters: Specify audio file id to delete

  • api_key

Returns:

{"status":200,"data":null,"message":"Succesfully deleted audio file"}

Possible errors:

  • Code 1009: Cannot delete audio files that are currently used by messages, questions, or other uses.

Download An Audio File

Method: GET

URL: https://go.votomobile.org/api/v1/downloads/audio_files/audio_file_id

Parameters:

  • api_key
  • format: The format can either be original or ogg. Default is original.

Returns:

The audio file content in raw format or the entire audio file depending on the medium the request is made.