Render a sandwich document
Renders a sandwich-style PDF where a header (logo, professional identity, subject/context data) appears only on the first page and a footer (signature, name) appears only on the last page. Header and footer assets are provided as inline data:image/...;base64,... strings. The Markdown body is rendered normally, with remote images subject to strict security policies (private IP rejection and mixed-content disabled).
curl --request POST \
--url https://api.blinkpdf.io/v1/templates/sandwich-document/render \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"markdown": "<string>",
"metadata": {
"title": "<string>",
"author": "<string>",
"subject": "<string>",
"keywords": [
"<string>"
],
"creator": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z"
},
"header": {
"professional": {
"name": "<string>",
"logo": "<string>",
"prefix": "<string>",
"lastName": "<string>",
"credentials": [
{
"title": "<string>",
"institution": "<string>",
"identifier": "<string>"
}
],
"registrations": [
{
"label": "<string>",
"value": "<string>"
}
]
},
"subject": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": true
}
],
"sectionTitle": "<string>"
},
"context": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": true
}
],
"sectionTitle": "<string>"
}
},
"footer": {
"professionalName": "<string>",
"signature": "<string>",
"professionalCredentials": "<string>",
"organization": {
"phone": "<string>",
"address": "<string>",
"email": "<string>"
}
},
"fontStack": [],
"page": {
"size": "<string>",
"margin": 1440,
"background": {
"color": "<string>",
"opacity": 0.5
}
}
}
'import requests
url = "https://api.blinkpdf.io/v1/templates/sandwich-document/render"
payload = {
"markdown": "<string>",
"metadata": {
"title": "<string>",
"author": "<string>",
"subject": "<string>",
"keywords": ["<string>"],
"creator": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z"
},
"header": {
"professional": {
"name": "<string>",
"logo": "<string>",
"prefix": "<string>",
"lastName": "<string>",
"credentials": [
{
"title": "<string>",
"institution": "<string>",
"identifier": "<string>"
}
],
"registrations": [
{
"label": "<string>",
"value": "<string>"
}
]
},
"subject": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": True
}
],
"sectionTitle": "<string>"
},
"context": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": True
}
],
"sectionTitle": "<string>"
}
},
"footer": {
"professionalName": "<string>",
"signature": "<string>",
"professionalCredentials": "<string>",
"organization": {
"phone": "<string>",
"address": "<string>",
"email": "<string>"
}
},
"fontStack": [],
"page": {
"size": "<string>",
"margin": 1440,
"background": {
"color": "<string>",
"opacity": 0.5
}
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
markdown: '<string>',
metadata: {
title: '<string>',
author: '<string>',
subject: '<string>',
keywords: ['<string>'],
creator: '<string>',
creationDate: '2023-11-07T05:31:56Z',
modificationDate: '2023-11-07T05:31:56Z'
},
header: {
professional: {
name: '<string>',
logo: '<string>',
prefix: '<string>',
lastName: '<string>',
credentials: [{title: '<string>', institution: '<string>', identifier: '<string>'}],
registrations: [{label: '<string>', value: '<string>'}]
},
subject: {
items: [{label: '<string>', value: '<string>', visible: true}],
sectionTitle: '<string>'
},
context: {
items: [{label: '<string>', value: '<string>', visible: true}],
sectionTitle: '<string>'
}
},
footer: {
professionalName: '<string>',
signature: '<string>',
professionalCredentials: '<string>',
organization: {phone: '<string>', address: '<string>', email: '<string>'}
},
fontStack: [],
page: {size: '<string>', margin: 1440, background: {color: '<string>', opacity: 0.5}}
})
};
fetch('https://api.blinkpdf.io/v1/templates/sandwich-document/render', 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.blinkpdf.io/v1/templates/sandwich-document/render",
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([
'markdown' => '<string>',
'metadata' => [
'title' => '<string>',
'author' => '<string>',
'subject' => '<string>',
'keywords' => [
'<string>'
],
'creator' => '<string>',
'creationDate' => '2023-11-07T05:31:56Z',
'modificationDate' => '2023-11-07T05:31:56Z'
],
'header' => [
'professional' => [
'name' => '<string>',
'logo' => '<string>',
'prefix' => '<string>',
'lastName' => '<string>',
'credentials' => [
[
'title' => '<string>',
'institution' => '<string>',
'identifier' => '<string>'
]
],
'registrations' => [
[
'label' => '<string>',
'value' => '<string>'
]
]
],
'subject' => [
'items' => [
[
'label' => '<string>',
'value' => '<string>',
'visible' => true
]
],
'sectionTitle' => '<string>'
],
'context' => [
'items' => [
[
'label' => '<string>',
'value' => '<string>',
'visible' => true
]
],
'sectionTitle' => '<string>'
]
],
'footer' => [
'professionalName' => '<string>',
'signature' => '<string>',
'professionalCredentials' => '<string>',
'organization' => [
'phone' => '<string>',
'address' => '<string>',
'email' => '<string>'
]
],
'fontStack' => [
],
'page' => [
'size' => '<string>',
'margin' => 1440,
'background' => [
'color' => '<string>',
'opacity' => 0.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blinkpdf.io/v1/templates/sandwich-document/render"
payload := strings.NewReader("{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.blinkpdf.io/v1/templates/sandwich-document/render")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blinkpdf.io/v1/templates/sandwich-document/render")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"Authorizations
API key issued from your Blink PDF account, prefixed bp_. Send it in the x-api-key header on every request. The documentation and health endpoints are exempt.
Body
Sandwich document: a first-page header (logo, professional identity, subject and document context), a Markdown body, and a last-page footer (optional signature, divider, professional name). Image assets (logo, signature) are inlined as data: URLs. Page-1 body clearance uses a flow offset for the header band; bottom margins reserve the repeating page-footer band and, when the last-page signature would not fit under the body, the signature band as well.
Sandwich document: a first-page header (logo, professional identity, subject and document context), a Markdown body, and a last-page footer (optional signature, divider, professional name). Image assets (logo, signature) are inlined as data: URLs. Page-1 body clearance uses a flow offset for the header band; bottom margins reserve the repeating page-footer band and, when the last-page signature would not fit under the body, the signature band as well.
Markdown source rendered as the body between header and footer
262144PDF document metadata embedded in the rendered file. Visible to any reader of the PDF — never include confidential or sensitive personal data, secrets, or other sensitive information.
Show child attributes
Show child attributes
First-page header band content
Show child attributes
Show child attributes
Last-page footer band content
Show child attributes
Show child attributes
Ordered list of hosted font families for the cascade. Exactly one weighted body/heading family is required (for example inter, lora, or source-serif-4). Emoji families (noto-emoji-mono, twemoji-mozilla) are appended automatically when omitted so emoji glyphs always render; optional jetbrains-mono supplies the code role. Every hosted family is available on every plan. This route does not accept Google Fonts URLs.
1 - 4 elementsinter, lora, source-serif-4, noto-emoji-mono, twemoji-mozilla, jetbrains-mono Page geometry and appearance for the output PDF, including optional full-sheet background. The sandwich-document template supplies defaults of size "Letter" and 2 cm margin when these fields (or the whole page object) are omitted; explicit values override the defaults for their respective fields.
Show child attributes
Show child attributes
Response
PDF bytes. Metered like POST /v1/render (usage, spend-cap, tier rate/concurrency). Diagnostics via X-Render-Status / X-Render-Diagnostics. X-Template-Version is 1.0.0. Successful responses include wall-clock X-Render-Ms. Template routes do not use the process-local 60s PDF LRU, so X-BlinkPDF-Cache is not set.
The response is of type file.
curl --request POST \
--url https://api.blinkpdf.io/v1/templates/sandwich-document/render \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"markdown": "<string>",
"metadata": {
"title": "<string>",
"author": "<string>",
"subject": "<string>",
"keywords": [
"<string>"
],
"creator": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z"
},
"header": {
"professional": {
"name": "<string>",
"logo": "<string>",
"prefix": "<string>",
"lastName": "<string>",
"credentials": [
{
"title": "<string>",
"institution": "<string>",
"identifier": "<string>"
}
],
"registrations": [
{
"label": "<string>",
"value": "<string>"
}
]
},
"subject": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": true
}
],
"sectionTitle": "<string>"
},
"context": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": true
}
],
"sectionTitle": "<string>"
}
},
"footer": {
"professionalName": "<string>",
"signature": "<string>",
"professionalCredentials": "<string>",
"organization": {
"phone": "<string>",
"address": "<string>",
"email": "<string>"
}
},
"fontStack": [],
"page": {
"size": "<string>",
"margin": 1440,
"background": {
"color": "<string>",
"opacity": 0.5
}
}
}
'import requests
url = "https://api.blinkpdf.io/v1/templates/sandwich-document/render"
payload = {
"markdown": "<string>",
"metadata": {
"title": "<string>",
"author": "<string>",
"subject": "<string>",
"keywords": ["<string>"],
"creator": "<string>",
"creationDate": "2023-11-07T05:31:56Z",
"modificationDate": "2023-11-07T05:31:56Z"
},
"header": {
"professional": {
"name": "<string>",
"logo": "<string>",
"prefix": "<string>",
"lastName": "<string>",
"credentials": [
{
"title": "<string>",
"institution": "<string>",
"identifier": "<string>"
}
],
"registrations": [
{
"label": "<string>",
"value": "<string>"
}
]
},
"subject": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": True
}
],
"sectionTitle": "<string>"
},
"context": {
"items": [
{
"label": "<string>",
"value": "<string>",
"visible": True
}
],
"sectionTitle": "<string>"
}
},
"footer": {
"professionalName": "<string>",
"signature": "<string>",
"professionalCredentials": "<string>",
"organization": {
"phone": "<string>",
"address": "<string>",
"email": "<string>"
}
},
"fontStack": [],
"page": {
"size": "<string>",
"margin": 1440,
"background": {
"color": "<string>",
"opacity": 0.5
}
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
markdown: '<string>',
metadata: {
title: '<string>',
author: '<string>',
subject: '<string>',
keywords: ['<string>'],
creator: '<string>',
creationDate: '2023-11-07T05:31:56Z',
modificationDate: '2023-11-07T05:31:56Z'
},
header: {
professional: {
name: '<string>',
logo: '<string>',
prefix: '<string>',
lastName: '<string>',
credentials: [{title: '<string>', institution: '<string>', identifier: '<string>'}],
registrations: [{label: '<string>', value: '<string>'}]
},
subject: {
items: [{label: '<string>', value: '<string>', visible: true}],
sectionTitle: '<string>'
},
context: {
items: [{label: '<string>', value: '<string>', visible: true}],
sectionTitle: '<string>'
}
},
footer: {
professionalName: '<string>',
signature: '<string>',
professionalCredentials: '<string>',
organization: {phone: '<string>', address: '<string>', email: '<string>'}
},
fontStack: [],
page: {size: '<string>', margin: 1440, background: {color: '<string>', opacity: 0.5}}
})
};
fetch('https://api.blinkpdf.io/v1/templates/sandwich-document/render', 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.blinkpdf.io/v1/templates/sandwich-document/render",
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([
'markdown' => '<string>',
'metadata' => [
'title' => '<string>',
'author' => '<string>',
'subject' => '<string>',
'keywords' => [
'<string>'
],
'creator' => '<string>',
'creationDate' => '2023-11-07T05:31:56Z',
'modificationDate' => '2023-11-07T05:31:56Z'
],
'header' => [
'professional' => [
'name' => '<string>',
'logo' => '<string>',
'prefix' => '<string>',
'lastName' => '<string>',
'credentials' => [
[
'title' => '<string>',
'institution' => '<string>',
'identifier' => '<string>'
]
],
'registrations' => [
[
'label' => '<string>',
'value' => '<string>'
]
]
],
'subject' => [
'items' => [
[
'label' => '<string>',
'value' => '<string>',
'visible' => true
]
],
'sectionTitle' => '<string>'
],
'context' => [
'items' => [
[
'label' => '<string>',
'value' => '<string>',
'visible' => true
]
],
'sectionTitle' => '<string>'
]
],
'footer' => [
'professionalName' => '<string>',
'signature' => '<string>',
'professionalCredentials' => '<string>',
'organization' => [
'phone' => '<string>',
'address' => '<string>',
'email' => '<string>'
]
],
'fontStack' => [
],
'page' => [
'size' => '<string>',
'margin' => 1440,
'background' => [
'color' => '<string>',
'opacity' => 0.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blinkpdf.io/v1/templates/sandwich-document/render"
payload := strings.NewReader("{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.blinkpdf.io/v1/templates/sandwich-document/render")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blinkpdf.io/v1/templates/sandwich-document/render")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"markdown\": \"<string>\",\n \"metadata\": {\n \"title\": \"<string>\",\n \"author\": \"<string>\",\n \"subject\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"creator\": \"<string>\",\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"modificationDate\": \"2023-11-07T05:31:56Z\"\n },\n \"header\": {\n \"professional\": {\n \"name\": \"<string>\",\n \"logo\": \"<string>\",\n \"prefix\": \"<string>\",\n \"lastName\": \"<string>\",\n \"credentials\": [\n {\n \"title\": \"<string>\",\n \"institution\": \"<string>\",\n \"identifier\": \"<string>\"\n }\n ],\n \"registrations\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"subject\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n },\n \"context\": {\n \"items\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"visible\": true\n }\n ],\n \"sectionTitle\": \"<string>\"\n }\n },\n \"footer\": {\n \"professionalName\": \"<string>\",\n \"signature\": \"<string>\",\n \"professionalCredentials\": \"<string>\",\n \"organization\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"email\": \"<string>\"\n }\n },\n \"fontStack\": [],\n \"page\": {\n \"size\": \"<string>\",\n \"margin\": 1440,\n \"background\": {\n \"color\": \"<string>\",\n \"opacity\": 0.5\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"