Obtener sesión de subida
curl --request GET \
--url https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}', 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://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"upload_session": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "awaiting_upload",
"url": "<string>",
"session_id": "<string>",
"locale": "en",
"expires_at": "2023-11-07T05:31:56Z",
"style": {
"material_name": "<string>",
"color_name": "<string>",
"color_hex": "<string>",
"shape_name": "<string>",
"selected_material_id": "<string>",
"selected_color_id": "<string>",
"selected_shape_id": "<string>"
},
"visualization_id": "<string>",
"visualization": {
"id": "<string>",
"session_id": "<string>",
"source": "sales_visualizer",
"landing_id": "<string>",
"landing_name": "<string>",
"landing_slug": "<string>",
"selected_material_id": "<string>",
"selected_color_id": "<string>",
"selected_shape_id": "<string>",
"original_image_url": "<string>",
"processed_image_url": "<string>",
"processing_status": "pending",
"processing_started_at": "2023-11-07T05:31:56Z",
"processing_completed_at": "2023-11-07T05:31:56Z",
"processing_error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"failure_code": "INSUFFICIENT_CREDITS",
"uploaded_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "API key does not include the required scope: leads.write.",
"request_id": "req_123",
"details": {
"required_scope": "leads.write",
"missing_scopes": [
"leads.write"
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}Visualizador
Obtener sesión de subida
Devuelve el estado de una sesión de subida alojada. url está presente solo mientras la sesión espera su foto. Después de la subida, visualization incluye la fila de Sales Visualizer. Sus campos de imagen son rutas de API que necesitan la misma API key, nunca URLs de almacenamiento.
GET
/
api
/
v1
/
upload-sessions
/
{upload_session_id}
Obtener sesión de subida
curl --request GET \
--url https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}', 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://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roofkit.ai/api/v1/upload-sessions/{upload_session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"upload_session": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "awaiting_upload",
"url": "<string>",
"session_id": "<string>",
"locale": "en",
"expires_at": "2023-11-07T05:31:56Z",
"style": {
"material_name": "<string>",
"color_name": "<string>",
"color_hex": "<string>",
"shape_name": "<string>",
"selected_material_id": "<string>",
"selected_color_id": "<string>",
"selected_shape_id": "<string>"
},
"visualization_id": "<string>",
"visualization": {
"id": "<string>",
"session_id": "<string>",
"source": "sales_visualizer",
"landing_id": "<string>",
"landing_name": "<string>",
"landing_slug": "<string>",
"selected_material_id": "<string>",
"selected_color_id": "<string>",
"selected_shape_id": "<string>",
"original_image_url": "<string>",
"processed_image_url": "<string>",
"processing_status": "pending",
"processing_started_at": "2023-11-07T05:31:56Z",
"processing_completed_at": "2023-11-07T05:31:56Z",
"processing_error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"failure_code": "INSUFFICIENT_CREDITS",
"uploaded_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "API key does not include the required scope: leads.write.",
"request_id": "req_123",
"details": {
"required_scope": "leads.write",
"missing_scopes": [
"leads.write"
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}