Request an image conversion and get a link to upload the original to
curl --request POST \
--url https://api.occtoo.com/v1/image-conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "shoe.tif"
}
'import requests
url = "https://api.occtoo.com/v1/image-conversions"
payload = { "filename": "shoe.tif" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'shoe.tif'})
};
fetch('https://api.occtoo.com/v1/image-conversions', 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.occtoo.com/v1/image-conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => 'shoe.tif'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.occtoo.com/v1/image-conversions"
payload := strings.NewReader("{\n \"filename\": \"shoe.tif\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.occtoo.com/v1/image-conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"shoe.tif\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/image-conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"shoe.tif\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3f9d2c1e-8b4a-4e6f-9a7d-1c2b3d4e5f60",
"uploadUrl": "https://occtoomedia.blob.core.windows.net/conversion-scratch/6b1f0b3c-6f2e-4a52-9a1e-7c6f0c2f9a10/3f9d2c1e-8b4a-4e6f-9a7d-1c2b3d4e5f60/original/shoe.tif?sv=2024-11-04&se=...&sig=...",
"uploadExpiresAt": "2026-11-05T13:30:00+00:00",
"maxFileSize": 33554432
}Image conversions
Request an image conversion and get a link to upload the original to
Starts a conversion and returns a signed link to upload the original to. Nothing is stored yet.
PUT the original’s bytes to uploadUrl with the header x-ms-blob-type: BlockBlob before uploadExpiresAt. The bytes go straight to Azure Blob Storage and never pass through Occtoo. The original must be smaller than maxFileSize bytes.
filename is required, at most 200 characters, can’t contain /, \, .. or control characters, and can’t start or end with a space or .. The converted image keeps its name with the output format’s extension.
POST
/
v1
/
image-conversions
Request an image conversion and get a link to upload the original to
curl --request POST \
--url https://api.occtoo.com/v1/image-conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "shoe.tif"
}
'import requests
url = "https://api.occtoo.com/v1/image-conversions"
payload = { "filename": "shoe.tif" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'shoe.tif'})
};
fetch('https://api.occtoo.com/v1/image-conversions', 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.occtoo.com/v1/image-conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => 'shoe.tif'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.occtoo.com/v1/image-conversions"
payload := strings.NewReader("{\n \"filename\": \"shoe.tif\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.occtoo.com/v1/image-conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"shoe.tif\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/image-conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"shoe.tif\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3f9d2c1e-8b4a-4e6f-9a7d-1c2b3d4e5f60",
"uploadUrl": "https://occtoomedia.blob.core.windows.net/conversion-scratch/6b1f0b3c-6f2e-4a52-9a1e-7c6f0c2f9a10/3f9d2c1e-8b4a-4e6f-9a7d-1c2b3d4e5f60/original/shoe.tif?sv=2024-11-04&se=...&sig=...",
"uploadExpiresAt": "2026-11-05T13:30:00+00:00",
"maxFileSize": 33554432
}Authorizations
kindeOAuthbearerAuthapiKey
Body
application/json
Response
The conversion id and a link to upload the original to.
An on-demand image conversion that is waiting for its original.
Was this page helpful?