Template renders
Get one published output's render contract
Requires a studio-owned API account with the print_orders:read key scope. Omit revision_id to resolve the latest published revision. Returned slot key is the only runtime identity; ordinal, label, and semantic suggestion are revision-local discovery metadata.
GET
/
v1
/
templates
/
{template_id}
/
outputs
/
{output_id}
/
contract
Get one published output's render contract
curl --request GET \
--url https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract', 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.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract"
req, _ := http.NewRequest("GET", 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.get("https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"template": {
"id": "<string>",
"revision_id": "<string>",
"revision_number": 2,
"document_hash": "<string>",
"template_engine_version": "0.10.0"
},
"output": {
"id": "<string>",
"ordinal": 1,
"surfaces": [
{
"id": "<string>",
"variant_id": "<string>",
"fulfillment_role": "artwork",
"ordinal": 1,
"canonical_product_id": "<string>",
"canonical_product_revision": 2,
"width_in": 123,
"height_in": 123,
"dpi": 123,
"label": "<string>"
}
],
"label": "<string>"
},
"slots": [
{
"key": "<string>",
"kind": "text",
"ordinal": 1,
"required": true,
"suggested_label": "<string>",
"suggested_semantic_key": "<string>",
"expected_aspect_ratio": {
"width": 2,
"height": 2
},
"minimum_effective_ppi": 123,
"max_length": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}Authorizations
Batch Relay scoped API key, not OAuth. Scope names document required key capabilities.
Path Parameters
Minimum string length:
1Minimum string length:
1Query Parameters
Optional immutable published or superseded revision ID.
Minimum string length:
1⌘I
Get one published output's render contract
curl --request GET \
--url https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract', 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.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract"
req, _ := http.NewRequest("GET", 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.get("https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/templates/{template_id}/outputs/{output_id}/contract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"template": {
"id": "<string>",
"revision_id": "<string>",
"revision_number": 2,
"document_hash": "<string>",
"template_engine_version": "0.10.0"
},
"output": {
"id": "<string>",
"ordinal": 1,
"surfaces": [
{
"id": "<string>",
"variant_id": "<string>",
"fulfillment_role": "artwork",
"ordinal": 1,
"canonical_product_id": "<string>",
"canonical_product_revision": 2,
"width_in": 123,
"height_in": 123,
"dpi": 123,
"label": "<string>"
}
],
"label": "<string>"
},
"slots": [
{
"key": "<string>",
"kind": "text",
"ordinal": 1,
"required": true,
"suggested_label": "<string>",
"suggested_semantic_key": "<string>",
"expected_aspect_ratio": {
"width": 2,
"height": 2
},
"minimum_effective_ppi": 123,
"max_length": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}