Media
Upload Image Bytes
Validate and store image bytes at the authenticated upload URL
PUT
/
api
/
v1
/
media
/
upload-bytes
Upload Image Bytes
curl --request PUT \
--url https://api.sequenzy.com/api/v1/media/upload-bytes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/media/upload-bytes"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/media/upload-bytes', 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.sequenzy.com/api/v1/media/upload-bytes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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.sequenzy.com/api/v1/media/upload-bytes"
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/media/upload-bytes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/media/upload-bytes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"key": "email-images/comp_123/.../product-shot.png",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png"
}
{
"success": false,
"error": "The uploaded image bytes do not match the declared content type."
}
{
"success": false,
"error": "This image upload URL has already been used."
}
Upload the exact image bytes to the
uploadUrl returned by Create Image
Upload URL. Send the same API key and company
selection headers used to create the URL. The query parameters are already
included in uploadUrl; do not modify them.
The server reads at most the declared size (up to 5MB), verifies the PNG, JPEG,
GIF, or WebP file signature, and only then creates the public object. Each URL
can create its object once, so request a new upload URL after a 409 response.
curl -X PUT "UPLOAD_URL_FROM_RESPONSE" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: image/png" \
--data-binary @product-shot.png
Responses
{
"success": true,
"key": "email-images/comp_123/.../product-shot.png",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png"
}
{
"success": false,
"error": "The uploaded image bytes do not match the declared content type."
}
{
"success": false,
"error": "This image upload URL has already been used."
}
⌘I
Upload Image Bytes
curl --request PUT \
--url https://api.sequenzy.com/api/v1/media/upload-bytes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/media/upload-bytes"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/media/upload-bytes', 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.sequenzy.com/api/v1/media/upload-bytes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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.sequenzy.com/api/v1/media/upload-bytes"
req, _ := http.NewRequest("PUT", 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.put("https://api.sequenzy.com/api/v1/media/upload-bytes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/media/upload-bytes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"key": "email-images/comp_123/.../product-shot.png",
"publicUrl": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png"
}
{
"success": false,
"error": "The uploaded image bytes do not match the declared content type."
}
{
"success": false,
"error": "This image upload URL has already been used."
}