Availability
Retrieve Asset Reservation Availability #
|
Sample Object
|
Checks whether an Asset is available to reserve.
| Name | Type | Required? | Description | Details |
|---|---|---|---|---|
| asset_id | Number | Yes |
The ID of the Asset to check.
|
|
| asset_type_id | Number | Yes |
The type of Asset whose availability to check. Capital tracks one item; Collateral tracks quantities. Supply it even when you know the Asset ID.
|
Allowed values:
1 (Capital) | 2 (Collateral) |
| start_date | Date | When asset_type_id=1 |
The first day of the proposed Capital reservation.
|
YYYY-MM-DD, without a time. Supply with end_date; omit for Collateral.
|
| end_date | Date | When asset_type_id=1 |
The return date of the proposed Capital reservation.
|
YYYY-MM-DD, on or after start_date. Both endpoints are included. Omit for Collateral.
|
| as_of_date | Date | No |
The date on which to check Collateral quantity.
|
YYYY-MM-DD. Default: today in your workspace time zone. Omit for Capital.
|
| storage_location_id | Number | No |
A Storage Location to restrict the Collateral quantity check to.
|
Optional. It must belong to the Asset’s owner. Omit to include the applicable locations. Not accepted for Capital.
|
| excluded_reservation_id | Number | No |
The existing reservation being edited, to exclude from this check.
|
It must belong to this Asset and be readable by your workspace. A manual inventory adjustment is not accepted. For Collateral, both its checkout and scheduled return are excluded.
|
| $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 |
| $on_error_return_empty_result | Boolean | No |
Whether to return an empty result for validation or not-found errors.
|
Default: false. True returns {} or [] with HTTP 200. Authentication, rate limits and unexpected failures keep their normal errors.
|
| $include_error_list_in_response_message | Boolean | No |
Whether to add validation errors to the error message.
|
Default: false.
|
| If-None-Match | String | No |
An ETag from an earlier response to this GET.
|
Optional HTTP header. If the successful response still matches, the API returns HTTP 304 with no response body.
|
Good to know
Checks an Active Asset before you reserve it. For Capital, check a proposed checkout-to-return period against its reservation policy. For Collateral, check how much is available on a chosen date. This request does not reserve anything.
Choosing the availability check
- For Capital, supply asset_type_id=1 and both start_date and end_date. Do not send as_of_date or storage_location_id.
- For Collateral, supply asset_type_id=2. Optionally choose as_of_date and storage_location_id. Do not send start_date or end_date.
- When editing an existing reservation, send its excluded_reservation_id so its current allocation is not counted against the check.
Understanding the reservation policy
1— Strict: every day of an existing Capital reservation is blocked, including checkout and return.2— Moderate: another reservation can use the checkout and return days; only the days between them are blocked. A one- or two-day reservation therefore blocks no days.3— Liberal: overlapping reservations are allowed. Collateral always uses this policy.
Reading Capital availability
The response reports both overlapping reservations and those that conflict under the Asset’s policy. Liberal permits overlap; Strict and Moderate apply the different day rules above.
When you exclude an existing reservation and keep the same calendar dates, the existing save rule permits that unchanged period. The response identifies this with is_requested_period_unchanged.
Reading Collateral quantities
Available quantity includes manual increases and decreases and Event reservations. A scheduled return reverses its reservation quantity from that date onward. Existing negative inventory is reported as recorded.
Projected Future Balance includes increases and decreases that have not been returned, including future entries. A supplied storage_location_id restricts the totals to that location.
The Collateral response includes Storage Location choices. For Capital, storage_locations is null.
Access, privacy and the later save
The Asset must be Active and either in your workspace or currently shared with it. Reading an old reservation does not make an unshared Asset eligible for a new reservation.
For shared Assets, the location ID, name and short address are returned to help choose a location. Private owner contacts, unrelated Asset details, other Events’ reservations and costs are withheld.
Availability and access are checked again when the reservation is saved. This result provides no edit revision and does not guarantee a later save will succeed. This read does not record a return or change inventory.
curl -X GET "https://api.exhibitday.com/v1/assets/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04" -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch("https://api.exhibitday.com/v1/assets/availability?" + new URLSearchParams({ "asset_id": "12345", "asset_type_id": "1", "start_date": "2030-01-02", "end_date": "2030-01-04" }), {
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/availability",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"asset_id": 12345, "asset_type_id": 1, "start_date": "2030-01-02", "end_date": "2030-01-04"},
)
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/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04");
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/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04"))
.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/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04');
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/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04')
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/availability?asset_id=12345&asset_type_id=1&start_date=2030-01-02&end_date=2030-01-04", 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,
"asset_type_id": 1,
"is_advisory": true,
"is_asset_owned_by_this_workspace": true,
"start_date": "2030-01-02",
"end_date": "2030-01-04",
"as_of_date": null,
"asset_reservation_policy_id": 1,
"is_available_under_reservation_policy": true,
"overlapping_reservation_count": 0,
"policy_conflict_count": 0,
"is_requested_period_unchanged": false,
"quantity_available_in_storage": null,
"projected_future_balance": null,
"storage_locations": null
}
{
"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": 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": 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": [],
"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": [
"Check whether your change was saved before trying again."
],
"error_params": [],
"request_id": "0123456789abcdef0123456789abcdef"
}