Request Video Conversion
Requesting an AI enhanced video conversion is a simple post request, allowing ease of use in your current workflow.
Endpoint
https://api.example.com/video/Request Format
Section titled “Request Format”HTTP Method:
POSTContent-Type:
application/jsonRequest Body:
| Parameter | Type | Required | Description |
|---|---|---|---|
| appointment_uuid | String | Yes | The unique identifier for the appointment. |
| video_url | String | Yes | Raw video URL in .mp4 format |
| translate_to | String | No | Language to output video in. |
| voice | String | No | Voice selection |
| type | String | No | Allows you to remove background noise, or enhance with AI |
Making an Authorized API Request
Section titled “Making an Authorized API Request”curl -X POST https://api.example.com/video/ \-H "Content-Type: application/json" \-H "X-API-Key: {API Key}" \-d '{ "appointment_uuid": "{Appointment ID}", "video_url": "https://yoursite.com/video.mp4", "translate_to": "spanish", "voice": "Billy Bob", "type": ""}'The type field is optional: leave it blank for full AI enhancement, or set it to noise to only remove background noise.
Error Responses
Section titled “Error Responses”If your API key is missing or invalid, the server will respond with an error
Missing API Key
Section titled “Missing API Key”{ "status": "error", "response": "Invalid API Key"}Invalid API Key
Section titled “Invalid API Key”{ "status": "error", "response": "Unauthorized"}Code Examples
Section titled “Code Examples”import requestsimport json
# API endpointurl = 'https://api.example.com/video/'
# Input datavideo_url = 'https://example.com/video.mp4'translate_to = 'spanish' # Change to 'none' if no translation is requiredvoice = 'Billy Bob'appointment_uuid = ''
# Set API keyapi_key = ''
# Prepare the data to senddata = { 'appointment_uuid': appointment_uuid, 'video_url': video_url, 'translate_to': translate_to, 'voice': voice}
# Set headersheaders = { 'Content-Type': 'application/json', 'X-API-Key': api_key, 'Accept': 'application/json'}
try: # Make the POST request response = requests.post(url, data=json.dumps(data), headers=headers)
# Check for HTTP errors response.raise_for_status()
# Parse the JSON response response_data = response.json() print("Response:", json.dumps(response_data, indent=4))
except requests.exceptions.RequestException as e: # Handle any errors that occur during the request print("Error:", e)<?php// API endpoint$url = 'https://api.example.com/video/';
// Input data$video_url = 'https://example.com/video.mp4';$translate_to = 'spanish'; // Change to 'none' if no translation is required$voice = 'Billy Bob';$appointment_uuid = '';
// API key$api_key = '';
// Prepare data for the POST request$data = [ 'appointment_uuid' => $appointment_uuid, 'video_url' => $video_url, 'translate_to' => $translate_to, 'voice' => $voice,];
// Initialize cURL$ch = curl_init($url);
// Set cURL optionscurl_setopt($ch, CURLOPT_POST, true); // Use POST methodcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); // Send JSON datacurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a stringcurl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', // Specify JSON content type 'X-API-Key: ' . $api_key, // API key in the header 'Accept: application/json' // Accept JSON response]);
// Execute the request$response = curl_exec($ch);
// Handle any errorsif (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); curl_close($ch); exit;}
// Close cURL sessioncurl_close($ch);
// Parse and display the response$decoded_response = json_decode($response, true);if (json_last_error() === JSON_ERROR_NONE) { echo "Response:\n"; print_r($decoded_response);} else { echo "Error: Invalid JSON response.\n";}const axios = require('axios');
// API endpointconst url = 'https://api.example.com/video/';
// Input dataconst data = { appointment_uuid: '', video_url: 'https://example.com/video.mp4', translate_to: 'spanish', // Change to 'none' if no translation is required voice: 'Billy Bob'};
// API keyconst apiKey = '';
// Make the API requestaxios.post(url, data, { headers: { 'Content-Type': 'application/json', 'X-API-Key': apiKey, 'Accept': 'application/json' }}).then(response => { console.log('Response:', response.data);}).catch(error => { if (error.response) { console.error('Error:', error.response.data); } else if (error.request) { console.error('No response received:', error.request); } else { console.error('Error:', error.message); }});curl -X POST https://api.example.com/video/ \-H "Content-Type: application/json" \-H "X-API-Key: {API_KEY}" \-H "Accept: application/json" \-d '{ "appointment_uuid": "", "video_url": "https://example.com/video.mp4", "translate_to": "spanish", "voice": "Billy Bob"}'Response Data
Section titled “Response Data”When you send a valid request to the Motovizion AI API, the response contains structured JSON data. Below is a detailed explanation of the fields included in the response.
{ "status": "success", "cleaned_transcription": "Walking around a 2020 Jeep Grand Cherokee Laredo, the tires look good, the air filter did need to be replaced, plugs and wires looked good. Overall it was satisfactory service.", "final_video_path": "https://api.example.com/video/complete/video.mp4", "video_no_audio_path": "https://api.example.com/video/raw/video.mp4"}Response Details
Section titled “Response Details”Top-Level Fields:
| Field Name | Type | Desciption |
|---|---|---|
| status | String | Indicates the success ("success") or failure ("error") of the request. |
Video Details
Section titled “Video Details”| Field Name | Type | Description |
|---|---|---|
| cleaned_transcription | String | The full transcription of enhanced video. |
| final_video_path | String | The final video path for use in application. |
| video_no_audio_path | String | Video path with no audio, used to make transcription edits. |
Error Codes
Section titled “Error Codes”| HTTP Status Code | Description |
|---|---|
| 400 | Missing required fields (e.g., appointment_uuid). |
| 401 | Invalid or missing API key. |
| 500 | Server error |