Supported audio files formats are .mp3, .wav, .opus. Use compressed formats (.mp3, .opus) where possible to save upload bandwidth and maximize speed. Uploaded audio should be between 1s and 30m in duration.
curl -X POST\
-H "Content-Type: audio/wav,audio/mp3,audio/opus"\
"https://prod-media-upload.modulate.ai/UploadFile"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
Object body = ; // Object | Request body should contain the audio file data
UUID accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
UUID apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
String sessionName = sessionName_example; // String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
String userName = userName_example; // String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
try {
apiInstance.uploadFile(body, accountUuid, apiKey, sessionName, userName);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#uploadFile");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
Object body = ; // Object | Request body should contain the audio file data
UUID accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
UUID apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
String sessionName = sessionName_example; // String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
String userName = userName_example; // String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
try {
apiInstance.uploadFile(body, accountUuid, apiKey, sessionName, userName);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#uploadFile");
e.printStackTrace();
}
}
}
Object *body = ; // Request body should contain the audio file data
UUID *accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
UUID *apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
String *sessionName = sessionName_example; // The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
String *userName = userName_example; // The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Upload an audio file to toxmod.
[apiInstance uploadFileWith:body
accountUuid:accountUuid
apiKey:apiKey
sessionName:sessionName
userName:userName
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var MediaFileUploadApi = require('media_file_upload_api');
var api = new MediaFileUploadApi.DefaultApi()
var body = ; // {{Object}} Request body should contain the audio file data
var accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
var apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
var sessionName = sessionName_example; // {{String}} The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
var userName = userName_example; // {{String}} The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.uploadFile(bodyaccountUuidapiKeysessionNameuserName, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class uploadFileExample
{
public void main()
{
var apiInstance = new DefaultApi();
var body = new Object(); // Object | Request body should contain the audio file data
var accountUuid = new UUID(); // UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
var apiKey = new UUID(); // UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
var sessionName = sessionName_example; // String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
var userName = userName_example; // String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
try
{
// Upload an audio file to toxmod.
apiInstance.uploadFile(body, accountUuid, apiKey, sessionName, userName);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.uploadFile: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiDefaultApi();
$body = ; // Object | Request body should contain the audio file data
$accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
$apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
$sessionName = sessionName_example; // String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
$userName = userName_example; // String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
try {
$api_instance->uploadFile($body, $accountUuid, $apiKey, $sessionName, $userName);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->uploadFile: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $body = WWW::SwaggerClient::Object::Object->new(); # Object | Request body should contain the audio file data
my $accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
my $apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
my $sessionName = sessionName_example; # String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
my $userName = userName_example; # String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
eval {
$api_instance->uploadFile(body => $body, accountUuid => $accountUuid, apiKey => $apiKey, sessionName => $sessionName, userName => $userName);
};
if ($@) {
warn "Exception when calling DefaultApi->uploadFile: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
body = # Object | Request body should contain the audio file data
accountUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
apiKey = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
sessionName = sessionName_example # String | The name of the session in which the clip was recorded. Toxmod considers clips with the same session name to be part of the same conversation. If uploading isolated clips, we recommend using the clip name as a the session name.
userName = userName_example # String | The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
try:
# Upload an audio file to toxmod.
api_instance.upload_file(body, accountUuid, apiKey, sessionName, userName)
except ApiException as e:
print("Exception when calling DefaultApi->uploadFile: %s\n" % e)