curl -X POST https://api.tangentflow.com/v1/render \
-H "Authorization: Bearer tf_your_key" \
-H "Content-Type: application/json" \
-d '{
"blocks": [
{ "type": "heading", "text": "Invoice #1047", "level": 1 },
{ "type": "table", "headers": "Item, Qty, Price",
"rows": "Widget Pro, 1, $299.00" }
]
}' \
-o invoice.pdf
import requests
response = requests.post(
"https://api.tangentflow.com/v1/render",
headers={"Authorization": "Bearer tf_your_key"},
json={
"blocks": [
{"type": "heading", "text": "Invoice #1047", "level": 1},
{"type": "table", "headers": "Item, Qty, Price",
"rows": "Widget Pro, 1, $299.00"}
]
}
)
with open("invoice.pdf", "wb") as f:
f.write(response.content)
const response = await fetch("https://api.tangentflow.com/v1/render", {
method: "POST",
headers: {
"Authorization": "Bearer tf_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
blocks: [
{ type: "heading", text: "Invoice #1047", level: 1 },
{ type: "table", headers: "Item, Qty, Price",
rows: "Widget Pro, 1, $299.00" },
],
}),
})
const pdf = Buffer.from(await response.arrayBuffer())
fs.writeFileSync("invoice.pdf", pdf)
body := strings.NewReader(`{
"blocks": [
{"type":"heading","text":"Invoice #1047","level":1},
{"type":"table","headers":"Item, Qty, Price",
"rows":"Widget Pro, 1, $299.00"}
]
}`)
req, _ := http.NewRequest("POST",
"https://api.tangentflow.com/v1/render", body)
req.Header.Set("Authorization", "Bearer tf_your_key")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
pdf, _ := io.ReadAll(resp.Body)
os.WriteFile("invoice.pdf", pdf, 0644)