Files
Mark an upload complete
Call after PUTting the bytes to the upload URL. Verifies the object landed at the declared size and type, checks the content really is the media it claims to be, and moves the file to ready so it can be delivered. Idempotent: completing an already-ready file just returns it. Applies to source=upload files; a captured file finalizes on its own from the phone’s report.
POST
/
files
/
{file_id}
/
complete
Mark an upload complete
curl --request POST \
--url https://api.axilio.ai/api/v1/files/{file_id}/complete \
--header 'X-Axilio-Api-Key: <api-key>'import requests
url = "https://api.axilio.ai/api/v1/files/{file_id}/complete"
headers = {"X-Axilio-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Axilio-Api-Key': '<api-key>'}};
fetch('https://api.axilio.ai/api/v1/files/{file_id}/complete', 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.axilio.ai/api/v1/files/{file_id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Axilio-Api-Key: <api-key>"
],
]);
$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.axilio.ai/api/v1/files/{file_id}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.axilio.ai/api/v1/files/{file_id}/complete")
.header("X-Axilio-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files/{file_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"file": {
"created_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"on_phone_count": 123,
"preview_state": "processing",
"size_bytes": 123,
"source": "upload",
"status": "uploading",
"attachment_url": "<string>",
"bytes_transferred": 123,
"capture_error": "<string>",
"capture_state": "detected",
"checksum": "<string>",
"download_url": "<string>",
"duration_seconds": 123,
"height": 123,
"reel_url": "<string>",
"session_id": "<string>",
"surface": "phone",
"thumbnail_url": "<string>",
"width": 123
}
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}⌘I
Mark an upload complete
curl --request POST \
--url https://api.axilio.ai/api/v1/files/{file_id}/complete \
--header 'X-Axilio-Api-Key: <api-key>'import requests
url = "https://api.axilio.ai/api/v1/files/{file_id}/complete"
headers = {"X-Axilio-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Axilio-Api-Key': '<api-key>'}};
fetch('https://api.axilio.ai/api/v1/files/{file_id}/complete', 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.axilio.ai/api/v1/files/{file_id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Axilio-Api-Key: <api-key>"
],
]);
$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.axilio.ai/api/v1/files/{file_id}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.axilio.ai/api/v1/files/{file_id}/complete")
.header("X-Axilio-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files/{file_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"file": {
"created_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"on_phone_count": 123,
"preview_state": "processing",
"size_bytes": 123,
"source": "upload",
"status": "uploading",
"attachment_url": "<string>",
"bytes_transferred": 123,
"capture_error": "<string>",
"capture_state": "detected",
"checksum": "<string>",
"download_url": "<string>",
"duration_seconds": 123,
"height": 123,
"reel_url": "<string>",
"session_id": "<string>",
"surface": "phone",
"thumbnail_url": "<string>",
"width": 123
}
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}