curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form front='@example-file' \
--form back='@example-file' \
--form right='@example-file' \
--form left='@example-file' \
--form chassis='@example-file'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos"
files = {
"front": ("example-file", open("example-file", "rb")),
"back": ("example-file", open("example-file", "rb")),
"right": ("example-file", open("example-file", "rb")),
"left": ("example-file", open("example-file", "rb")),
"chassis": ("example-file", open("example-file", "rb"))
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('front', '<string>');
form.append('back', '<string>');
form.append('right', '<string>');
form.append('left', '<string>');
form.append('chassis', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 1,
"quote_request_id": 42,
"attachments": {
"front": "https://cdn.yasmina.ai/vehicle-photos/abc123.jpg",
"back": "https://cdn.yasmina.ai/vehicle-photos/def456.jpg",
"right": "https://cdn.yasmina.ai/vehicle-photos/ghi789.jpg",
"left": "https://cdn.yasmina.ai/vehicle-photos/jkl012.jpg",
"chassis": "https://cdn.yasmina.ai/vehicle-photos/mno345.jpg"
}
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "42201",
"message": "The chassis field is required.",
"details": {
"chassis": [
"The chassis field is required."
]
}
}Store vehicle photos for an embed session
Embedded flow only. If your site or app already holds the five vehicle photos comprehensive cover needs, hand them over here after opening the session and before the customer opens the embed. The customer is then not asked to upload photos inside the frame: Yasmina registers this set with the insurance provider itself, against whichever quotation the customer picks.
Same files and limits as Upload vehicle photos, without a quote_price_id. The photos are checked and stored only; nothing is sent to the provider by this call. All five are required together, and calling it again replaces the stored set.
Do not use this from a server-to-server integration: there, upload the photos against the selected quote with Upload vehicle photos.
curl --request POST \
--url https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form front='@example-file' \
--form back='@example-file' \
--form right='@example-file' \
--form left='@example-file' \
--form chassis='@example-file'import requests
url = "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos"
files = {
"front": ("example-file", open("example-file", "rb")),
"back": ("example-file", open("example-file", "rb")),
"right": ("example-file", open("example-file", "rb")),
"left": ("example-file", open("example-file", "rb")),
"chassis": ("example-file", open("example-file", "rb"))
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('front', '<string>');
form.append('back', '<string>');
form.append('right', '<string>');
form.append('left', '<string>');
form.append('chassis', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.yasmina.ai/api/v1/car-comp/embed-sessions/{id}/photos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"right\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"left\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"chassis\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": 1,
"quote_request_id": 42,
"attachments": {
"front": "https://cdn.yasmina.ai/vehicle-photos/abc123.jpg",
"back": "https://cdn.yasmina.ai/vehicle-photos/def456.jpg",
"right": "https://cdn.yasmina.ai/vehicle-photos/ghi789.jpg",
"left": "https://cdn.yasmina.ai/vehicle-photos/jkl012.jpg",
"chassis": "https://cdn.yasmina.ai/vehicle-photos/mno345.jpg"
}
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "42201",
"message": "The chassis field is required.",
"details": {
"chassis": [
"The chassis field is required."
]
}
}Authorizations
JWT Authorization header using the Bearer scheme
Path Parameters
The session id returned when it was created.
Body
Photo of the front of the vehicle. JPG or PNG, up to 3 MB.
Photo of the rear of the vehicle. JPG or PNG, up to 3 MB.
Photo of the right-hand side of the vehicle. JPG or PNG, up to 3 MB.
Photo of the left-hand side of the vehicle. JPG or PNG, up to 3 MB.
Photo of the chassis (VIN) number. JPG or PNG, up to 3 MB.
Response
Photos stored on the session’s quote request
The session id.
1
The quote request the photos were stored on.
42
The stored photo URLs, keyed by position.
{
"front": "https://cdn.yasmina.ai/vehicle-photos/abc123.jpg",
"back": "https://cdn.yasmina.ai/vehicle-photos/def456.jpg",
"right": "https://cdn.yasmina.ai/vehicle-photos/ghi789.jpg",
"left": "https://cdn.yasmina.ai/vehicle-photos/jkl012.jpg",
"chassis": "https://cdn.yasmina.ai/vehicle-photos/mno345.jpg"
}