Manage Voice File

VOICE FILE

  1. Creating New Voice File

    [[API:Function]] – goAddVoiceFiles

    • This application is used to create new audio file . Newly created audio file belongs to user that authenticated a request.

     

    Mandatory parameters from “postfields variables:

    • goUser- Username. String

    • goPass- Password. String

    • goAction- Action performed by the [[API:Functions]]. String

     

     

    Returns:

    result – “success” means that voice file has been created. String

     

    result – “error” means that voice file has not been created, containing the error occurred. String

    • Error: Upload Failed.

     

    audiofile – created audiofile. String

     

     

    Sample Code:

     

    <?php

    $url = "https://YOUR_URL/goAPI/goVoiceFiles/goAPI.php"; #URL to GoAutoDial API. (required)

    $postfields["goUser"] = ""; #Username goes here. (required)

    $postfields["goPass"] = ""; #Password goes here. (required)

    $postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)

    $postfields["responsetype"] = "json"; #json. (required)

    $postfields["audiofile"] = ""; #voice file. (required)

     

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

    curl_setopt($ch, CURLOPT_POST, 1);

    curl_setopt($ch, CURLOPT_TIMEOUT, 100);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

    $data = curl_exec($ch);

    curl_close($ch);

    $output = json_decode($data);

     

    // print_r($data);

     

    if ($output->result=="success") {

    # Result was OK!

    echo "Uploaded a WAV file: ";

    } else {

    # An error occured

    echo $output->result;

    }

    ?>

     

  2. Displaying Voice File

    [[API:Function]] – goGetVoiceFilesList

    • This application is used to get list of voice file belongs to user.

     

    Mandatory parameters from “postfields variables:

    • goUser- Username. String

    • goPass- Password. String

    • goAction- Action performed by the [[API:Functions]]. String


    Returns:

    result – “success” means that query was successful. String

     

    result – “error” means that query was not successful. , containing the error occurred. String

     

    file_name – name of the audio file. String

    file _date – date of file uploaded. Date

    file_size– size of the audio file. Integer

     

    Sample Code:


    ?php

    $url = "https://YOUR_URL/goAPI/goVoiceFiles/goAPI.php"; #URL to GoAutoDial API. (required)

    $postfields["goUser"] = ""; #Username goes here. (required)

    $postfields["goPass"] = ""; #Password goes here. (required)

    $postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)

    $postfields["responsetype"] = "json"; #json. (required)

     

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

    curl_setopt($ch, CURLOPT_POST, 1);

    curl_setopt($ch, CURLOPT_TIMEOUT, 100);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

    $data = curl_exec($ch);

    curl_close($ch);

    $output = json_decode($data);

     

    // print_r($data);

    if ($output->result=="success") {

    # Result was OK!

    for($i=0;$i<count($output->file_name);++$i){

    echo $output->file_name[$i]."</br>";

    echo $output->file_date[$i]."</br>";

    echo $output->file_size[$i]."</br>";

    }

    } else {

    # An error occured

    echo $output->result;

    }

    ?>

[[API:Function]] – goAddVoiceFilesThis application is used to create new audio file . Newly created audio file  belongs to user that authenticated a request.Mandatory parameters from “postfields” variables:goUser- Username.  String goPass-  Password.  String goAction-  Action performed by the [[API:Functions]].  StringReturns: result – “success” means that voice file has been created.  String  result – “error” means that voice file has not been created, containing the error occurred. StringError: Upload Failed. audiofile – created audiofile. String  Sample Code: <?php        $url = "https://YOUR_URL/goAPI/goVoiceFiles/goAPI.php"; #URL to GoAutoDial API. (required)        $postfields["goUser"] = ""; #Username goes here. (required)        $postfields["goPass"] = ""; #Password goes here. (required)        $postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)        $postfields["responsetype"] = "json"; #json. (required)        $postfields["audiofile"] = ""; #voice file. (required)         $ch = curl_init();         curl_setopt($ch, CURLOPT_URL, $url);         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);         curl_setopt($ch, CURLOPT_POST, 1);         curl_setopt($ch, CURLOPT_TIMEOUT, 100);         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);         $data = curl_exec($ch);         curl_close($ch);         $output = json_decode($data);//      print_r($data);        if ($output->result=="success") {           # Result was OK!                echo "Uploaded a WAV file: ";                         } else {           # An error occured                echo $output->result;        }?>
  • 973 Users Found This Useful
Was this answer helpful?

Related Articles

Manage User

USER Creating New User [[API:Function]] – goAddUser This application is used to create...

Manage Call Recording

CALL RECORDING Displaying Call Recording [[API:Function]] – goGetCallRecordingList This...

Manage List

LIST Creating New List [[API:Function]] – goAddList This application is used to create...

Manage Carrier

CARRIER Creating New Carrier [[API:Function]] – goAddCarrier This application is used to...

Manage Music On Hold

MUSIC ON HOLD Creating New Music On Hold [[API:Function]] – goAddMOH This application is...