Queue generation
curl --request POST \
--url https://dockiln.io/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<h1>Order confirmed</h1>",
"format": "pdf",
"page": {
"format": "Letter",
"footer": "Page {page} of {pages}"
}
}
'import requests
url = "https://dockiln.io/v1/documents"
payload = {
"html": "<h1>Order confirmed</h1>",
"format": "pdf",
"page": {
"format": "Letter",
"footer": "Page {page} of {pages}"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<h1>Order confirmed</h1>',
format: 'pdf',
page: {format: 'Letter', footer: 'Page {page} of {pages}'}
})
};
fetch('https://dockiln.io/v1/documents', 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://dockiln.io/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<h1>Order confirmed</h1>',
'format' => 'pdf',
'page' => [
'format' => 'Letter',
'footer' => 'Page {page} of {pages}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dockiln.io/v1/documents"
payload := strings.NewReader("{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dockiln.io/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dockiln.io/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"format": "pdf",
"created": 123,
"updated": 123,
"download": "<string>",
"error": "<string>",
"storage": "local",
"sandbox": true,
"expiresAt": 123
}{
"error": "<string>"
}Document generation
Queue generation
POST
/
v1
/
documents
Queue generation
curl --request POST \
--url https://dockiln.io/v1/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<h1>Order confirmed</h1>",
"format": "pdf",
"page": {
"format": "Letter",
"footer": "Page {page} of {pages}"
}
}
'import requests
url = "https://dockiln.io/v1/documents"
payload = {
"html": "<h1>Order confirmed</h1>",
"format": "pdf",
"page": {
"format": "Letter",
"footer": "Page {page} of {pages}"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
html: '<h1>Order confirmed</h1>',
format: 'pdf',
page: {format: 'Letter', footer: 'Page {page} of {pages}'}
})
};
fetch('https://dockiln.io/v1/documents', 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://dockiln.io/v1/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<h1>Order confirmed</h1>',
'format' => 'pdf',
'page' => [
'format' => 'Letter',
'footer' => 'Page {page} of {pages}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dockiln.io/v1/documents"
payload := strings.NewReader("{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dockiln.io/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dockiln.io/v1/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<h1>Order confirmed</h1>\",\n \"format\": \"pdf\",\n \"page\": {\n \"format\": \"Letter\",\n \"footer\": \"Page {page} of {pages}\"\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"format": "pdf",
"created": 123,
"updated": 123,
"download": "<string>",
"error": "<string>",
"storage": "local",
"sandbox": true,
"expiresAt": 123
}{
"error": "<string>"
}Authorizations
bearersession
Headers
Body
application/json
- Option 1
- Option 2
- Option 3
Response
Completed within the synchronous wait budget
The response is of type file.