Media File upload API

Default

root

Greeting endpoint. Not useful for production, just a convenient way to make sure the API is online.


/

Usage and SDK Samples

curl -X GET\
"https://prod-media-upload.modulate.ai/"
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();
        try {
            apiInstance.root();
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#root");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        try {
            apiInstance.root();
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#root");
            e.printStackTrace();
        }
    }
}

DefaultApi *apiInstance = [[DefaultApi alloc] init];

[apiInstance rootWithCompletionHandler: 
              ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var MediaFileUploadApi = require('media_file_upload_api');

var api = new MediaFileUploadApi.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.root(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class rootExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();

            try
            {
                apiInstance.root();
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.root: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();

try {
    $api_instance->root();
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->root: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();

eval { 
    $api_instance->root();
};
if ($@) {
    warn "Exception when calling DefaultApi->root: $@\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()

try: 
    api_instance.root()
except ApiException as e:
    print("Exception when calling DefaultApi->root: %s\n" % e)

Parameters

Responses

Status: 200 - success


uploadFile

Upload an audio file to toxmod.

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.


/UploadFile

Usage and SDK Samples

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)

Parameters

Header parameters
Name Description
Account-Uuid*
UUID (uuid)
Your ToxMod account identifier. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
Required
Api-Key*
UUID (uuid)
Your ToxMod API Key. You can find it at `console.modulate.ai` in the Administration tab, under "Integration settings".
Required
Session-Name*
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.
Required
User-Name*
String
The name (or other unique identifier) of the user who uploaded the audio file. This must be unique per user.
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Indicates that the submitted audio file has been successfully sent to ToxMod for analysis.

Status: 400 - Indicates a problem with the request. Response body may contain additional information about the issue.

Status: 500 - Internal Server Error.