Get document variables
curl --request GET \
--url https://api.autype.com/api/v1/dev/documents/{documentId}/variables \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.autype.com/api/v1/dev/documents/{documentId}/variables"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.autype.com/api/v1/dev/documents/{documentId}/variables', 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.autype.com/api/v1/dev/documents/{documentId}/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.autype.com/api/v1/dev/documents/{documentId}/variables"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.autype.com/api/v1/dev/documents/{documentId}/variables")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autype.com/api/v1/dev/documents/{documentId}/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"documentId": "<string>",
"title": "<string>",
"variables": {
"companyName": {
"type": "string"
},
"logo": {
"type": "image",
"width": 150
},
"items": {
"type": "list"
}
},
"variableNames": [
"companyName",
"logo",
"items"
]
}Bulk Rendering
Get document variables
Get the variable definitions for a document. Use this to understand what variables are required for bulk rendering.
GET
/
api
/
v1
/
dev
/
documents
/
{documentId}
/
variables
Get document variables
curl --request GET \
--url https://api.autype.com/api/v1/dev/documents/{documentId}/variables \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.autype.com/api/v1/dev/documents/{documentId}/variables"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.autype.com/api/v1/dev/documents/{documentId}/variables', 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.autype.com/api/v1/dev/documents/{documentId}/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.autype.com/api/v1/dev/documents/{documentId}/variables"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.autype.com/api/v1/dev/documents/{documentId}/variables")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autype.com/api/v1/dev/documents/{documentId}/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"documentId": "<string>",
"title": "<string>",
"variables": {
"companyName": {
"type": "string"
},
"logo": {
"type": "image",
"width": 150
},
"items": {
"type": "list"
}
},
"variableNames": [
"companyName",
"logo",
"items"
]
}Authorizations
API Key (starts with ak_...)
Path Parameters
Response
Document variable definitions
Document ID
Document title
Variable definitions from the document
Example:
{
"companyName": { "type": "string" },
"logo": { "type": "image", "width": 150 },
"items": { "type": "list" }
}
List of variable names
Example:
["companyName", "logo", "items"]
⌘I
