Images
Retrieve All Asset Images #
|
Retrieves all images for an Asset.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset whose images to use, from Retrieve Assets (GET /v1/assets) or its create response.
|
|
| $include_record_revision | Boolean | No |
Whether to include the gallery revision.
|
Default: false. True returns one object containing images and record_revision, including an empty gallery. Omit it for the usual JSON image array. This GET does not offer a separate response format option.
|
Using the image list
The gallery contains up to five images. display_rank starts at 1 in the returned order. An empty gallery returns an empty array.
Use the returned image_filename values when retrieving, downloading, deleting or reordering images.
Checking gallery changes
Request $include_record_revision=true to receive one record_revision for the entire gallery beside its images array. Send that record_revision as expected_revision when deleting or reordering images.
record_revision covers the saved image references, complete order and gallery times. It does not cover file contents or core Asset details. It belongs to the selected Asset, including when its gallery is empty.
Image filenames and access
Treat the filenames returned by GET /v1/assets/images as opaque values. Use them with the selected Asset ID. Shared Assets' images are managed in the Asset's original workspace.
Editing an image on the website gives it a new image_filename. List the images again to get the current names.
curl -X GET "https://api.exhibitday.com/v1/assets/images?asset_id=12345" -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch("https://api.exhibitday.com/v1/assets/images?" + new URLSearchParams({ "asset_id": "12345" }), {
method: "GET",
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await response.json();
console.log(response.status, data);
import requests
response = requests.get(
"https://api.exhibitday.com/v1/assets/images",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"asset_id": 12345},
)
print(response.status_code, response.json())
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.GetAsync("https://api.exhibitday.com/v1/assets/images?asset_id=12345");
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.exhibitday.com/v1/assets/images?asset_id=12345"))
.header("Authorization", "Bearer YOUR_API_KEY")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/assets/images?asset_id=12345');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
echo curl_getinfo($curl, CURLINFO_HTTP_CODE) . PHP_EOL . $response;
curl_close($curl);
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/assets/images?asset_id=12345')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts "#{response.code} #{response.body}"
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
request, err := http.NewRequest("GET", "https://api.exhibitday.com/v1/assets/images?asset_id=12345", nil)
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
fmt.Printf("%d %s\n", response.StatusCode, body)
}
Example response
[
{
"asset_id": 12345,
"image_filename": "98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg",
"display_rank": 1,
"image_last_update_timestamp": "2026-01-15T17:00:00Z"
},
{
"asset_id": 12345,
"image_filename": "98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg",
"display_rank": 2,
"image_last_update_timestamp": "2026-01-15T17:00:00Z"
}
]
{
"status_code": 400,
"status": "Bad Request",
"message": "HTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Missing Asset ID. Send a valid Asset ID in asset_id.",
"error_code": "invalid_request",
"errors": [
"Missing Asset ID. Send a valid Asset ID in asset_id."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names.",
"error_code": "malformed_json",
"errors": [
"The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names."
],
"error_params": [
"request_body"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "invalid_api_key",
"errors": [
"The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset not found. Invalid Asset ID: 12345.",
"error_code": "not_found",
"errors": [
"Asset not found. Invalid Asset ID: 12345."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved image gallery cannot be changed safely. Review its images in ExhibitDay.",
"error_code": "record_changed",
"errors": [
"The saved image gallery cannot be changed safely. Review its images in ExhibitDay."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request.",
"error_code": "record_changed",
"errors": [
"The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
Add an Asset Image #
|
Adds an image to an Asset.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset whose images to use, from Retrieve Assets (GET /v1/assets) or its create response.
|
|
| file | File (multipart) | Yes |
One PNG, JPEG or GIF image.
Maximum size per file: 19.55 MiB (20,500,000 bytes). Allowed file types: .png, .jpg, .jpeg, .gif. Maximum files per request: 1. View value format and limitsFile uploads use multipart form data. Other structured values use a JSON object or array; form/query values use JSON text.
|
Send one
file part using multipart/form-data, at most 20,500,000 bytes. The extension must match the actual image format. |
| crop | JSON object/list | No |
An optional crop rectangle in the uploaded image's raw pixels.
View value format and limitsFile uploads use multipart form data. Other structured values use a JSON object or array; form/query values use JSON text.
|
Supply
x, y, width and height together. The rectangle must fit inside the image and have a 125:94 ratio. Omit it to use the largest centered rectangle of that ratio. |
| $result_format | String | No |
By default, the response is a single object. Send
array to get it inside a one-item array.
|
Allowed values:
array | object |
| Idempotency-Key | String | No |
An optional key for safely retrying the same image upload.
|
Send it as a header. Use 1 through 255 visible ASCII characters without spaces. Reuse the same key only for the same request; the API can return its saved response.
|
Uploading an image
- Retrieve the image list and check that the gallery has room for another image.
- Send one complete image as
multipart/form-data. Addcropas a JSON form value if you want a specific crop. - Use the returned image filename for later requests. POST does not issue a gallery revision.
Image preparation
The API prepares a JPEG using a 125:94 crop. Transparent areas use a white background, and small images may be enlarged. JPEG and static PNG are supported; for GIF, the first frame is kept. Animated PNG is not accepted.
The API uses raw image coordinates and does not apply EXIF rotation. Rotate the source before uploading when needed. Embedded profiles, thumbnails and unneeded metadata are ignored. The image must still decode successfully and match its checked format and dimensions.
Upload and processing limits
Each dimension must be at most 8,192 pixels. JPEG and PNG permit at most 24 million decoded pixels. GIF permits at most 64 frames and 24 million total canvas pixels across its frames. PNG decoded sample bytes must be at most 96 million; 16-bit PNGs can reach that limit sooner.
These processing limits are separate from the 20,500,000-byte upload limit. When image preparation is busy, the response is HTTP 429 with Retry-After. This is separate from the workspace's per-second request allowance. Uploads require an upgraded workspace plan.
Retrying an upload
Use Idempotency-Key when retrying the same upload. If the save outcome cannot be confirmed, inspect the current gallery before sending another upload. expected_revision is not supported on POST.
Image filenames and access
Treat the filenames returned by GET /v1/assets/images as opaque values. Use them with the selected Asset ID. Shared Assets' images are managed in the Asset's original workspace.
Editing an image on the website gives it a new image_filename. List the images again to get the current names.
# bash; inspect an error body instead of saving it as the requested file.
status=$(curl --silent --show-error -X POST "https://api.exhibitday.com/v1/assets/images" -H "Authorization: Bearer YOUR_API_KEY" --output response-body.tmp --write-out "%{http_code}" --form-string "asset_id=12345" --form "file=@asset-image.png;type=application/octet-stream")
if [ "$status" != 200 ]; then cat response-body.tmp; exit 1; fi
cat response-body.tmp
// Node.js 18+; use a local file only for a declared multipart operation.
import { readFile, writeFile } from 'node:fs/promises';
const form = new FormData();
form.append("asset_id", "12345");
form.append("file", new Blob([await readFile("asset-image.png")], { type: "application/octet-stream" }), "asset-image.png");
const response = await fetch("https://api.exhibitday.com/v1/assets/images", { method: "POST", headers: { Authorization: 'Bearer YOUR_API_KEY' }, body: form });
if (response.status !== 200) throw new Error(`${response.status}: ${await response.text()}`);
console.log(await response.json());
import requests
import json
from contextlib import ExitStack
with ExitStack() as stack:
files = [
("file", ("asset-image.png", stack.enter_context(open("asset-image.png", 'rb')), "application/octet-stream")),
]
response = requests.request("POST", "https://api.exhibitday.com/v1/assets/images", headers={'Authorization': 'Bearer YOUR_API_KEY'}, files=files, data={"asset_id": "12345"}, timeout=30)
if response.status_code != 200:
raise RuntimeError(f'{response.status_code}: {response.text}')
print(response.json())
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.exhibitday.com/v1/assets/images");
var form = new MultipartFormDataContent();
form.Add(new StringContent("12345"), "asset_id");
var file0 = new StreamContent(File.OpenRead("asset-image.png"));
file0.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
form.Add(file0, "file", "asset-image.png");
request.Content = form;
using var response = await client.SendAsync(request);
if ((int)response.StatusCode != 200) throw new Exception(await response.Content.ReadAsStringAsync());
Console.WriteLine(await response.Content.ReadAsStringAsync());
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
import java.nio.charset.StandardCharsets;
import java.io.ByteArrayOutputStream;
import java.util.UUID;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpRequest.Builder request = HttpRequest.newBuilder(URI.create("https://api.exhibitday.com/v1/assets/images")).header("Authorization", "Bearer YOUR_API_KEY");
String boundary = "ExhibitDay-" + UUID.randomUUID();
ByteArrayOutputStream form = new ByteArrayOutputStream();
form.write(("--" + boundary + "\r\nContent-Disposition: form-data; name=\"asset_id\"\r\n\r\n" + "12345" + "\r\n").getBytes(StandardCharsets.UTF_8));
form.write(("--" + boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"asset-image.png\"\r\nContent-Type: application/octet-stream\r\n\r\n").getBytes(StandardCharsets.UTF_8));
form.write(Files.readAllBytes(Path.of("asset-image.png")));
form.write("\r\n".getBytes(StandardCharsets.UTF_8));
form.write(("--" + boundary + "--\r\n").getBytes(StandardCharsets.UTF_8));
request.header("Content-Type", "multipart/form-data; boundary=" + boundary);
HttpResponse<byte[]> response = HttpClient.newHttpClient().send(request.method("POST", HttpRequest.BodyPublishers.ofByteArray(form.toByteArray())).build(), HttpResponse.BodyHandlers.ofByteArray());
if (response.statusCode() != 200) throw new RuntimeException(new String(response.body(), StandardCharsets.UTF_8));
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/assets/images');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => [
'asset_id' => '12345',
'file' => new CURLFile('asset-image.png', 'application/octet-stream', 'asset-image.png'),
],
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($status !== 200) throw new RuntimeException($response);
echo $response;
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/assets/images')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
files = []
begin
parts = [
['asset_id', '12345'],
['file', (files << File.open('asset-image.png', 'rb')).last, {filename: 'asset-image.png', content_type: 'application/octet-stream'}],
]
request.set_form(parts, 'multipart/form-data')
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
raise response.body unless response.code == '200'
puts response.body
ensure
files.each(&:close)
end
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"bytes"
"mime/multipart"
"net/textproto"
)
func main() {
var form bytes.Buffer
writer := multipart.NewWriter(&form)
if err := writer.WriteField("asset_id", "12345"); err != nil { log.Fatal(err) }
header0 := textproto.MIMEHeader{}
header0.Set("Content-Disposition", "form-data; name=\"file\"; filename=\"asset-image.png\"")
header0.Set("Content-Type", "application/octet-stream")
part0, err := writer.CreatePart(header0)
if err != nil { log.Fatal(err) }
file0, err := os.Open("asset-image.png")
if err != nil { log.Fatal(err) }
if _, err = io.Copy(part0, file0); err != nil { log.Fatal(err) }
file0.Close()
if err := writer.Close(); err != nil { log.Fatal(err) }
request, err := http.NewRequest("POST", "https://api.exhibitday.com/v1/assets/images", &form)
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
request.Header.Set("Content-Type", writer.FormDataContentType())
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
data, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
if response.StatusCode != 200 { log.Fatalf("%d %s", response.StatusCode, data) }
fmt.Printf("%s\n", data)
}
Example response
{
"asset_id": 12345,
"image_filename": "98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg",
"display_rank": 1,
"image_last_update_timestamp": "2026-01-15T17:00:00Z"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "HTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "This Idempotency-Key was already used with a different request. Use a new key for a new request.",
"error_code": "idempotency_key_reused",
"errors": [
"This Idempotency-Key was already used with a different request. Use a new key for a new request."
],
"error_params": [
"Idempotency-Key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Missing Asset ID. Send a valid Asset ID in asset_id.",
"error_code": "invalid_request",
"errors": [
"Missing Asset ID. Send a valid Asset ID in asset_id."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Image uploads require an upgraded workspace plan.",
"error_code": "not_allowed",
"errors": [
"Image uploads require an upgraded workspace plan."
],
"error_params": [
"file"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "This Asset already has five images. Remove an image before adding another.",
"error_code": "not_allowed",
"errors": [
"This Asset already has five images. Remove an image before adding another."
],
"error_params": [
"file"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The crop must fit within the raw image and have a 125:94 aspect ratio.",
"error_code": "invalid_request",
"errors": [
"The crop must fit within the raw image and have a 125:94 aspect ratio."
],
"error_params": [
"crop"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The file is not a supported bounded image.",
"error_code": "invalid_request",
"errors": [
"The file is not a supported bounded image."
],
"error_params": [
"file"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "invalid_api_key",
"errors": [
"The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset not found. Invalid Asset ID: 12345.",
"error_code": "not_found",
"errors": [
"Asset not found. Invalid Asset ID: 12345."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "A request with this Idempotency-Key is still being processed. Retry after a moment.",
"error_code": "idempotency_key_in_use",
"errors": [
"A request with this Idempotency-Key is still being processed. Retry after a moment."
],
"error_params": [
"Idempotency-Key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "A previous request with this Idempotency-Key did not finish and its outcome is unknown, so this retry was not run to avoid creating a duplicate. Check whether the earlier request succeeded; to try again, use a new Idempotency-Key.",
"error_code": "idempotency_key_indeterminate",
"errors": [
"A previous request with this Idempotency-Key did not finish and its outcome is unknown, so this retry was not run to avoid creating a duplicate. Check whether the earlier request succeeded; to try again, use a new Idempotency-Key."
],
"error_params": [
"Idempotency-Key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved response cannot be replayed safely.",
"error_code": "idempotency_key_indeterminate",
"errors": [
"The earlier request with this Idempotency-Key completed, but its saved response cannot be returned safely. This retry was not run and its key was not released. Look for the existing record with a GET; use a new Idempotency-Key only after checking whether another create is needed."
],
"error_params": [
"Idempotency-Key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved image gallery cannot be changed safely. Review its images in ExhibitDay.",
"error_code": "record_changed",
"errors": [
"The saved image gallery cannot be changed safely. Review its images in ExhibitDay."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request.",
"error_code": "record_changed",
"errors": [
"The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Another image is being prepared. Wait briefly and retry.",
"error_code": "rate_limited",
"errors": [
"Another image is being prepared. Wait briefly and retry."
],
"error_params": [
"file"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"The save outcome could not be confirmed. Read the current gallery before retrying; this request was not automatically repeated."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
Delete an Asset Image #
|
Deletes an existing Asset image.
Note: Inputs that do not apply to this operation, including the ignore-empty option, are ignored and reported in the X-API-Warnings response header.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset whose images to use, from Retrieve Assets (GET /v1/assets) or its create response.
|
|
| image_filename | String | Yes |
The image_filename from this Asset's image list.
|
Use the value exactly as returned. Image filenames stay the same when the order changes.
|
| expected_revision | String | No |
The record_revision returned by GET /v1/assets/images with $include_record_revision=true. Include it to avoid overwriting changes to its image gallery. Omit it to skip this check.
|
Removing an image
The image must still be in this Asset's gallery. An already-absent image returns HTTP 404. The remaining images keep their order.
The image disappears from the gallery when the save succeeds. Physical file removal follows later after reference checks. Other Asset content is unchanged.
Avoiding conflicting changes
Retrieve GET /v1/assets/images with $include_record_revision=true, then send its record_revision as expected_revision. This optional check covers the whole gallery.
If the gallery changed after that read, nothing changes and the response is HTTP 409. Retrieve the gallery again before deciding whether to retry. A successful request with this condition returns the resulting gallery revision.
Image filenames and access
Treat the filenames returned by GET /v1/assets/images as opaque values. Use them with the selected Asset ID. Shared Assets' images are managed in the Asset's original workspace.
Editing an image on the website gives it a new image_filename. List the images again to get the current names.
curl -X DELETE "https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg" -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch("https://api.exhibitday.com/v1/assets/images?" + new URLSearchParams({ "asset_id": "12345", "image_filename": "98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg" }), {
method: "DELETE",
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await response.json();
console.log(response.status, data);
import requests
response = requests.delete(
"https://api.exhibitday.com/v1/assets/images",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"asset_id": 12345, "image_filename": "98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg"},
)
print(response.status_code, response.json())
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.DeleteAsync("https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg");
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg"))
.header("Authorization", "Bearer YOUR_API_KEY")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
echo curl_getinfo($curl, CURLINFO_HTTP_CODE) . PHP_EOL . $response;
curl_close($curl);
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg')
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts "#{response.code} #{response.body}"
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
request, err := http.NewRequest("DELETE", "https://api.exhibitday.com/v1/assets/images?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg", nil)
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
fmt.Printf("%d %s\n", response.StatusCode, body)
}
Example response
{
"status_code": 200,
"status": "OK",
"message": "Asset image removed.",
"errors": []
}
{
"status_code": 400,
"status": "Bad Request",
"message": "HTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Missing Asset ID. Send a valid Asset ID in asset_id.",
"error_code": "invalid_request",
"errors": [
"Missing Asset ID. Send a valid Asset ID in asset_id."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names.",
"error_code": "malformed_json",
"errors": [
"The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names."
],
"error_params": [
"request_body"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "invalid_api_key",
"errors": [
"The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset not found. Invalid Asset ID: 12345.",
"error_code": "not_found",
"errors": [
"Asset not found. Invalid Asset ID: 12345."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset image not found. Use an image_filename returned by GET /v1/assets/images for this Asset.",
"error_code": "not_found",
"errors": [
"Asset image not found. Use an image_filename returned by GET /v1/assets/images for this Asset."
],
"error_params": [
"image_filename"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved image gallery cannot be changed safely. Review its images in ExhibitDay.",
"error_code": "record_changed",
"errors": [
"The saved image gallery cannot be changed safely. Review its images in ExhibitDay."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request.",
"error_code": "record_changed",
"errors": [
"The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"The save outcome could not be confirmed. Read the current gallery before retrying; this request was not automatically repeated."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
Reorder Asset Images #
|
Changes the order of an Asset's images.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset whose images to use, from Retrieve Assets (GET /v1/assets) or its create response.
|
|
| image_filenames | JSON object/list | Yes |
Every current image filename, once each, in the desired order.
View value format and limitsFile uploads use multipart form data. Other structured values use a JSON object or array; form/query values use JSON text.
|
Send a JSON array with at most five image filenames. An empty array is valid only for an empty gallery. Null or blank cannot clear images.
|
| expected_revision | String | No |
The record_revision returned by GET /v1/assets/images with $include_record_revision=true. Include it to avoid overwriting changes to its image gallery. Omit it to skip this check.
|
Reordering images
- Retrieve the current image list.
- Put every
image_filenamereturned byGET /v1/assets/imagesinimage_filenames, in the order you want. - Submit the complete array. Use DELETE to remove an image.
When the order is unchanged
Sending the current order makes no change to images, timestamps, revision or history. Image filenames and file contents stay the same when the order changes.
Avoiding conflicting changes
Retrieve GET /v1/assets/images with $include_record_revision=true, then send its record_revision as expected_revision. This optional check covers the whole gallery.
If the gallery changed after that read, nothing changes and the response is HTTP 409. Retrieve the gallery again before deciding whether to retry. A successful request with this condition returns the resulting gallery revision.
Image filenames and access
Treat the filenames returned by GET /v1/assets/images as opaque values. Use them with the selected Asset ID. Shared Assets' images are managed in the Asset's original workspace.
Editing an image on the website gives it a new filename. List the images again to get the current names.
curl -X PATCH "https://api.exhibitday.com/v1/assets/images/order" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"asset_id\":12345,\"image_filenames\":[\"98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg\",\"98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg\"]}"
const response = await fetch("https://api.exhibitday.com/v1/assets/images/order", {
method: "PATCH",
headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ "asset_id": 12345, "image_filenames": ["98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg","98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg"] })
});
const data = await response.json();
console.log(response.status, data);
import requests
import json
response = requests.patch(
"https://api.exhibitday.com/v1/assets/images/order",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"asset_id": 12345, "image_filenames": json.loads("[\"98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg\",\"98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg\"]")},
)
print(response.status_code, response.json())
using System;
using System.Text.Json;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.PatchAsync("https://api.exhibitday.com/v1/assets/images/order",
JsonContent.Create(new { asset_id = 12345, image_filenames = JsonDocument.Parse("[\"98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg\",\"98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg\"]").RootElement.Clone() }));
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.exhibitday.com/v1/assets/images/order"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\"asset_id\":12345,\"image_filenames\":[\"98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg\",\"98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg\"]}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/assets/images/order');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"asset_id":12345,"image_filenames":["98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg","98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg"]}',
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
echo curl_getinfo($curl, CURLINFO_HTTP_CODE) . PHP_EOL . $response;
curl_close($curl);
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/assets/images/order')
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = '{"asset_id":12345,"image_filenames":["98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg","98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg"]}'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts "#{response.code} #{response.body}"
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("PATCH", "https://api.exhibitday.com/v1/assets/images/order", strings.NewReader("{\"asset_id\":12345,\"image_filenames\":[\"98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg\",\"98765-12345-59f0a281-df13-4bc9-acf1-3c12c25b1d25.jpg\"]}"))
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
request.Header.Set("Content-Type", "application/json")
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
body, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
fmt.Printf("%d %s\n", response.StatusCode, body)
}
Example response
{
"status_code": 200,
"status": "OK",
"message": "Asset images reordered.",
"errors": []
}
{
"status_code": 400,
"status": "Bad Request",
"message": "HTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Missing Asset ID. Send a valid Asset ID in asset_id.",
"error_code": "invalid_request",
"errors": [
"Missing Asset ID. Send a valid Asset ID in asset_id."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names.",
"error_code": "malformed_json",
"errors": [
"The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names."
],
"error_params": [
"request_body"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Send every current image filename exactly once in the image_filenames array. Get the current filenames from GET /v1/assets/images for this Asset.",
"error_code": "invalid_request",
"errors": [
"Send every current image filename exactly once in the image_filenames array. Get the current filenames from GET /v1/assets/images for this Asset."
],
"error_params": [
"image_filenames"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "invalid_api_key",
"errors": [
"The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset not found. Invalid Asset ID: 12345.",
"error_code": "not_found",
"errors": [
"Asset not found. Invalid Asset ID: 12345."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved image gallery cannot be changed safely. Review its images in ExhibitDay.",
"error_code": "record_changed",
"errors": [
"The saved image gallery cannot be changed safely. Review its images in ExhibitDay."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request.",
"error_code": "record_changed",
"errors": [
"The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"The save outcome could not be confirmed. Read the current gallery before retrying; this request was not automatically repeated."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
Download an Asset Image #
|
Downloads an Asset image.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset whose images to use, from Retrieve Assets (GET /v1/assets) or its create response.
|
|
| image_filename | String | Yes |
The image_filename from this Asset's image list.
|
Use the value exactly as returned. Image filenames stay the same when the order changes.
|
Saving the download
Use the Asset ID and its current image_filename. The response contains the stored image file as an attachment. Older images keep their stored format.
A missing stored file returns HTTP 404. This download does not substitute the default Asset icon or support conditional or partial downloads.
Image filenames and access
Treat the filenames returned by GET /v1/assets/images as opaque values. Use them with the selected Asset ID. Shared Assets' images are managed in the Asset's original workspace.
Editing an image on the website gives it a new image_filename. List the images again to get the current names.
Files still being copied
If this file is still being copied, the download returns HTTP 409 with file_copy_pending. Try the download again in a few minutes.
# bash; inspect an error body instead of saving it as the requested file.
status=$(curl --silent --show-error -X GET "https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg" -H "Authorization: Bearer YOUR_API_KEY" --output response-body.tmp --write-out "%{http_code}")
if [ "$status" != 200 ]; then cat response-body.tmp; exit 1; fi
mv response-body.tmp 'asset-image.jpg'
// Node.js 18+; use a local file only for a declared multipart operation.
import { readFile, writeFile } from 'node:fs/promises';
const response = await fetch("https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg", { method: "GET", headers: { Authorization: 'Bearer YOUR_API_KEY' } });
if (response.status !== 200) throw new Error(`${response.status}: ${await response.text()}`);
await writeFile("asset-image.jpg", new Uint8Array(await response.arrayBuffer()));
import requests
import json
response = requests.request("GET", "https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg", headers={'Authorization': 'Bearer YOUR_API_KEY'}, timeout=30)
if response.status_code != 200:
raise RuntimeError(f'{response.status_code}: {response.text}')
with open("asset-image.jpg", 'wb') as destination:
destination.write(response.content)
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
using var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg");
using var response = await client.SendAsync(request);
if ((int)response.StatusCode != 200) throw new Exception(await response.Content.ReadAsStringAsync());
await File.WriteAllBytesAsync("asset-image.jpg", await response.Content.ReadAsByteArrayAsync());
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
import java.nio.charset.StandardCharsets;
import java.io.ByteArrayOutputStream;
import java.util.UUID;
public class ExhibitDayExample {
public static void main(String[] args) throws Exception {
HttpRequest.Builder request = HttpRequest.newBuilder(URI.create("https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg")).header("Authorization", "Bearer YOUR_API_KEY");
HttpResponse<byte[]> response = HttpClient.newHttpClient().send(request.method("GET", HttpRequest.BodyPublishers.noBody()).build(), HttpResponse.BodyHandlers.ofByteArray());
if (response.statusCode() != 200) throw new RuntimeException(new String(response.body(), StandardCharsets.UTF_8));
Files.write(Path.of("asset-image.jpg"), response.body());
}
}
<?php
$curl = curl_init('https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($status !== 200) throw new RuntimeException($response);
file_put_contents('asset-image.jpg', $response);
require 'net/http'
require 'uri'
uri = URI('https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
raise response.body unless response.code == '200'
File.binwrite('asset-image.jpg', response.body)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func main() {
request, err := http.NewRequest("GET", "https://api.exhibitday.com/v1/assets/images/download?asset_id=12345&image_filename=98765-12345-a1941c59-59cb-4b7d-b7a7-2f82f8bf84ab.jpg", nil)
if err != nil { log.Fatal(err) }
request.Header.Set("Authorization", "Bearer YOUR_API_KEY")
response, err := (&http.Client{}).Do(request)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
data, err := io.ReadAll(response.Body)
if err != nil { log.Fatal(err) }
if response.StatusCode != 200 { log.Fatalf("%d %s", response.StatusCode, data) }
if err := os.WriteFile("asset-image.jpg", data, 0600); err != nil { log.Fatal(err) }
fmt.Println("File saved")
}
Example response
Content type: image/jpeg, image/png, image/gif, application/octet-stream
{
"status_code": 400,
"status": "Bad Request",
"message": "HTTP method override is not supported.",
"error_code": "invalid_request",
"errors": [
"Send the documented HTTP method directly. X-HTTP-Method-Override cannot change a request's HTTP method."
],
"error_params": [
"X-HTTP-Method-Override"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "Missing Asset ID. Send a valid Asset ID in asset_id.",
"error_code": "invalid_request",
"errors": [
"Missing Asset ID. Send a valid Asset ID in asset_id."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 400,
"status": "Bad Request",
"message": "The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names.",
"error_code": "malformed_json",
"errors": [
"The request body is not valid JSON or repeats a member name. Send one JSON object with unique member names."
],
"error_params": [
"request_body"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "No API key was provided. Send your key in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "missing_api_key",
"errors": [
"Copy the key from Workspace Settings > API & Integrations > API Access in ExhibitDay."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid. Check that you copied the whole key from Workspace Settings > API & Integrations > API Access, then send it in the Authorization header as 'Bearer YOUR_API_KEY'. Alternatively, you can use the api_key parameter.",
"error_code": "invalid_api_key",
"errors": [
"Check that you sent the whole key. If it was regenerated, use the current key from Workspace Settings > API & Integrations > API Access."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Nothing was read or changed."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "invalid_api_key",
"errors": [
"The API key is not valid for this request. Send your current key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 401,
"status": "Unauthorized",
"message": "Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'.",
"error_code": "api_access_disabled",
"errors": [
"Access to the ExhibitDay API is not enabled for your workspace. Please contact support@exhibitday.com to enable API Access. Once access is enabled, send your key in the Authorization header as 'Bearer YOUR_API_KEY'."
],
"error_params": [
"api_key"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset not found. Invalid Asset ID: 12345.",
"error_code": "not_found",
"errors": [
"Asset not found. Invalid Asset ID: 12345."
],
"error_params": [
"asset_id"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "Asset image not found. Use an image_filename returned by GET /v1/assets/images for this Asset.",
"error_code": "not_found",
"errors": [
"Asset image not found. Use an image_filename returned by GET /v1/assets/images for this Asset."
],
"error_params": [
"image_filename"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 404,
"status": "Not Found",
"message": "File not found.",
"error_code": "not_found",
"errors": [
"File not found."
],
"error_params": [
"image_filename"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "This file is still being copied. Try again in a few minutes.",
"error_code": "file_copy_pending",
"errors": [
"This file is still being copied. Try again in a few minutes."
],
"error_params": [
"image_filename"
],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The saved image gallery cannot be changed safely. Review its images in ExhibitDay.",
"error_code": "record_changed",
"errors": [
"The saved image gallery cannot be changed safely. Review its images in ExhibitDay."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 409,
"status": "Conflict",
"message": "The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request.",
"error_code": "record_changed",
"errors": [
"The Asset image gallery changed or is being changed. Read its current images and decide whether to retry; nothing was changed by this request."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 429,
"status": "Too Many Requests",
"message": "Error 429 - Too Many Requests",
"error_code": "rate_limited",
"errors": [
"Error 429 - Too Many Requests"
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"An unexpected error occurred. Please try again later."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}
{
"status_code": 500,
"status": "Unexpected Internal Error",
"message": "An unexpected error occurred. Please try again later.",
"error_code": "internal_error",
"errors": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}