Get a presigned upload URL
curl --request POST \
--url https://api.example.com/api/public/mediaimport requests
url = "https://api.example.com/api/public/media"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/public/media', 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.example.com/api/public/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/public/media"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/public/media")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/public/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"mediaId": "<string>",
"contentType": "<string>",
"contentLength": 123,
"uploadedAt": {},
"url": "<string>",
"urlExpiry": "<string>"
}Media
Get a presigned upload URL
Endpoint to Get a presigned upload URL for a media record on toolzz analytics
POST
/
api
/
public
/
media
Get a presigned upload URL
curl --request POST \
--url https://api.example.com/api/public/mediaimport requests
url = "https://api.example.com/api/public/media"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/public/media', 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.example.com/api/public/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/public/media"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/public/media")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/public/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"mediaId": "<string>",
"contentType": "<string>",
"contentLength": 123,
"uploadedAt": {},
"url": "<string>",
"urlExpiry": "<string>"
}Show Request
Show Request
string
required
The trace ID associated with the media record.
string
The observation ID associated with the media record. Null if directly associated with a trace.
enum
required
The MIME type of the media record (e.g., image/png, application/json).
integer
required
The size of the media record in bytes.
string
required
The SHA-256 hash of the media record.
string
required
The trace/observation field associated with the media record (e.g., input, output, metadata).
Response Description
Below you will see the description of the Get presigned upload URL responsestring
required
Unique identifier for the media.
string
required
MIME type of the media (e.g., “image/png”, “application/pdf”).
integer
required
Size of the media in bytes.
date-time
required
Timestamp indicating when the media was uploaded.
string
required
URL to access the media.
string
required
Expiry information for the media URL.
Code Response
Exemples of Response CodeRequest Successful Response
Request Failure

