Customer Summaries
The Motovizion AI API allows you to retrieve customer chat transcripts, appointment details, and related data for use in your applications.
Endpoint
Section titled “Endpoint”https://api.example.com/customer/chat/Request Format
Section titled “Request Format”HTTP Method:
POSTContent-Type:
application/jsonRequest Body:
Section titled “Request Body:”The request body should be a JSON object with the following fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
| appointment_uuid | String | Yes | The unique identifier for the appointment. |
Making an Authorized API Request
Section titled “Making an Authorized API Request”curl -X POST https://api.example.com/customer/chat/ \-H "Content-Type: application/json" \-H "X-API-Key: {API Key}" \-d '{ "appointment_uuid": "{Appointment ID}"}'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/customer/chat/'
# Data to send in the POST requestdata = { 'appointment_uuid': ''}
# Set the API keyapi_key = ''
# Set the headersheaders = { 'Content-Type': 'application/json', # Specify JSON content type 'X-API-Key': api_key, # Pass the API key in the header 'Accept': 'application/json'}
# Send the POST requesttry: response = requests.post(url, headers=headers, data=json.dumps(data))
# Check for HTTP errors response.raise_for_status()
# Decode and display the API response decoded_response = response.json() print(json.dumps(decoded_response, indent=4))except requests.exceptions.RequestException as e: print(f"HTTP Request failed: {e}")<?php
// API endpoint$url = 'https://api.example.com/customer/chat/';
// Data to send in the POST request$data = [ 'appointment_uuid' => ''];
// Set the API key$api_key = '';
// Initialize cURL session$ch = curl_init($url);
// Set cURL optionscurl_setopt($ch, CURLOPT_POST, true); // Use POST methodcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); // Send data as JSONcurl_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, // Pass the API key in the header 'Accept: application/json']);
// Execute cURL request$response = curl_exec($ch);
// Check for cURL errorsif (curl_errno($ch)) { echo 'cURL Error: ' . curl_error($ch);} else { // Decode and display the API response $decoded_response = json_decode($response, true);
echo '<pre>'; print_r($decoded_response); echo '</pre>';}
// Close the cURL sessioncurl_close($ch);?>// If using axiosconst axios = require('axios');
// API endpointconst url = 'https://api.example.com/customer/chat/';
// Data to send in the POST requestconst data = { appointment_uuid: ''};
// Set the API keyconst apiKey = '';
// Set the headersconst headers = { 'Content-Type': 'application/json', // Specify JSON content type 'X-API-Key': apiKey, // Pass the API key in the header 'Accept': 'application/json'};
// Send the POST requestaxios.post(url, data, { headers }) .then(response => { // Log the response data console.log('Response from API:', response.data); }) .catch(error => { if (error.response) { // API returned an error response console.error('API Error:', error.response.data); } else if (error.request) { // No response from the server console.error('No response from API:', error.request); } else { // Other errors console.error('Error:', error.message); } });curl -X POST https://api.example.com/customer/chat/ \-H "Content-Type: application/json" \-H "X-API-Key: YOUR_API_KEY" \-d '{ "appointment_uuid": ""}'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", "response": true, "appointment_date": "2025-12-31 14:30", "appointment_uuid": "dFxdvajxqap4aFbpBkacHv4RJdp0Irg34QXjzBczecw", "chat_code": "123456", "customer_name": "John Doe", "questions_asked":8, "vehicle_id": "1HGCM82633A1DF456", "summary": "Customer states the vehicle makes a grinding noise from the front end when turning at low speeds. The issue is intermittent. Customer also requested a loaner vehicle and asked for a quote on a brake inspection.", "media": [ { "type": "image", "url": "https://prediag.mystore.com/src/uploads/IMG_1022.jpeg" }, { "type": "video", "url": "https://prediag.mystore.com/src/uploads/VID_1023.mp4" } ], "transcript": [ { "customer": "{AI Initiates Conversation}", "assistant": "Hi, John! I see you've scheduled a visit for a grinding sound. To prepare for your appointment, I have a few questions.", "chat_method": "voice" }, { "customer": "Sounds good. And just so I can plan ahead, will I be able to get a loaner car?", "assistant": "Of course. I have noted your request for a loaner vehicle. Now, regarding the grinding noise, can you tell me when it occurs?", "chat_method": "voice" } ], "line_items": [ { "description": "Customer requested a loaner vehicle.", "payable": false }, { "description": "Customer requested a quote for a brake inspection.", "payable": true } ], "escalation_flag": true, "tech_questions": true}Response Fields
Section titled “Response Fields”Top-Level Fields:
| Field Name | Type | Description |
|---|---|---|
| status | String | Indicates the success ("success") or failure ("error") of the request. |
| response | Boolean | true if the request has a summary, false if no summary available. |
Appointment Details
Section titled “Appointment Details”| Field Name | Type | Description |
|---|---|---|
| appointment_date | String | Date and time of the appointment in YYYY-MM-DD HH:MM format. |
| appointment_uuid | String | Unique identifier for the appointment. |
| customer_name | String | Customers full name |
| vin | String | Vehicle Identification Number |
| summary | String | Generated summary from conversation transcript |
| transcript | Array | Full transcript of conversation returned as array |
| media | Array | Returns video/images associated with appointment if they exist |
| line_items | Array | Returns all line items requested by customer |
| escalation_flag | Boolean | True if customer added any extra services, or dealer should be notified of change to appointment |
| questions_asked | INT | Count of questions the AI has asked |
| tech_questions | Boolean | If the appointment has tech initiated questions |
No Appointment Found Response (200)
Section titled “No Appointment Found Response (200)”{ 'status' => 'success', 'response' => false, 'message' => 'No appointment found for the given UUID'}Error Codes
Section titled “Error Codes”| HTTP Status Code | Description |
|---|---|
| 400 | Missing required fields (e.g., appointment_uuid). |
| 401 | Invalid or missing API key. |
| 404 | Appointment not found for the provided appointment_uuid. |