Generate presentation deck (async)
Generate a complete presentation deck with multiple slides asynchronously.
Use this endpoint when:
- You need to generate multiple slides in one presentation
- You’re building complete decks programmatically
- Slides may use different templates
Workflow:
- POST to this endpoint with your slides array
- Receive
generation_idimmediately (HTTP 202) - Poll
GET /presentations/{generation_id}/statusevery 2-5 seconds - When status is
completedorpartial, download fromdownload_url
Slide ordering: Slides appear in the generated deck in the same order as your slides array.
Mixed templates: Each slide can use a different template_slide_id, allowing you to
combine slides from multiple templates into one deck.
Per-slide options: Override deck-level options for specific slides by providing
options within individual slide objects.
Status values:
pending- Queued for processingprocessing- Generation in progresscompleted- All slides generated successfullypartial- Some slides succeeded, some failedfailed- Generation failed completely
curl --request POST \
--url https://api.example.com/api/v1/presentations/generate-deck \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"options": {
"allow_textbox_reposition": false,
"auto_paginate_tables": true
},
"org_name": "acme-corp",
"slides": [
{
"slide_data": {
"subtitle": "Executive Summary",
"title": "Q4 2024 Business Review"
},
"template_slide_id": "slide_title001"
},
{
"slide_data": {
"content": {
"blocks": [
{
"text": {
"bullets": [
"Revenue grew 25% YoY to $56.6M",
"Customer base expanded to 1,890 accounts",
"NPS improved from 72 to 82"
]
},
"type": "text"
}
]
},
"title": "Key Highlights"
},
"template_slide_id": "slide_content001"
},
{
"options": {
"auto_paginate_tables": true,
"table_min_font_size": 9
},
"slide_data": {
"content": {
"blocks": [
{
"table": {
"table": {
"rows": [
{
"cells": [
{
"value": "Metric"
},
{
"value": "Q3"
},
{
"value": "Q4"
},
{
"value": "Change"
}
],
"is_header": true
},
{
"cells": [
{
"value": "Revenue"
},
{
"value": "$12.8M"
},
{
"value": "$14.2M"
},
{
"value": "+11%"
}
]
},
{
"cells": [
{
"value": "Customers"
},
{
"value": "1,620"
},
{
"value": "1,890"
},
{
"value": "+17%"
}
]
}
]
}
},
"type": "table"
}
]
},
"title": "Quarterly Performance"
},
"template_slide_id": "slide_table001"
}
]
}
'import requests
url = "https://api.example.com/api/v1/presentations/generate-deck"
payload = {
"options": {
"allow_textbox_reposition": False,
"auto_paginate_tables": True
},
"org_name": "acme-corp",
"slides": [
{
"slide_data": {
"subtitle": "Executive Summary",
"title": "Q4 2024 Business Review"
},
"template_slide_id": "slide_title001"
},
{
"slide_data": {
"content": { "blocks": [
{
"text": { "bullets": ["Revenue grew 25% YoY to $56.6M", "Customer base expanded to 1,890 accounts", "NPS improved from 72 to 82"] },
"type": "text"
}
] },
"title": "Key Highlights"
},
"template_slide_id": "slide_content001"
},
{
"options": {
"auto_paginate_tables": True,
"table_min_font_size": 9
},
"slide_data": {
"content": { "blocks": [
{
"table": { "table": { "rows": [{
"cells": [{ "value": "Metric" }, { "value": "Q3" }, { "value": "Q4" }, { "value": "Change" }],
"is_header": True
}, { "cells": [{ "value": "Revenue" }, { "value": "$12.8M" }, { "value": "$14.2M" }, { "value": "+11%" }] }, { "cells": [{ "value": "Customers" }, { "value": "1,620" }, { "value": "1,890" }, { "value": "+17%" }] }] } },
"type": "table"
}
] },
"title": "Quarterly Performance"
},
"template_slide_id": "slide_table001"
}
]
}
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({
options: {allow_textbox_reposition: false, auto_paginate_tables: true},
org_name: 'acme-corp',
slides: [
{
slide_data: {subtitle: 'Executive Summary', title: 'Q4 2024 Business Review'},
template_slide_id: 'slide_title001'
},
{
slide_data: {
content: {
blocks: [
{
text: {
bullets: [
'Revenue grew 25% YoY to $56.6M',
'Customer base expanded to 1,890 accounts',
'NPS improved from 72 to 82'
]
},
type: 'text'
}
]
},
title: 'Key Highlights'
},
template_slide_id: 'slide_content001'
},
{
options: {auto_paginate_tables: true, table_min_font_size: 9},
slide_data: {
content: {
blocks: [
{
table: {
table: {
rows: [
{
cells: [{value: 'Metric'}, {value: 'Q3'}, {value: 'Q4'}, {value: 'Change'}],
is_header: true
},
{
cells: [{value: 'Revenue'}, {value: '$12.8M'}, {value: '$14.2M'}, {value: '+11%'}]
},
{
cells: [{value: 'Customers'}, {value: '1,620'}, {value: '1,890'}, {value: '+17%'}]
}
]
}
},
type: 'table'
}
]
},
title: 'Quarterly Performance'
},
template_slide_id: 'slide_table001'
}
]
})
};
fetch('https://api.example.com/api/v1/presentations/generate-deck', 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.example.com/api/v1/presentations/generate-deck",
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([
'options' => [
'allow_textbox_reposition' => false,
'auto_paginate_tables' => true
],
'org_name' => 'acme-corp',
'slides' => [
[
'slide_data' => [
'subtitle' => 'Executive Summary',
'title' => 'Q4 2024 Business Review'
],
'template_slide_id' => 'slide_title001'
],
[
'slide_data' => [
'content' => [
'blocks' => [
[
'text' => [
'bullets' => [
'Revenue grew 25% YoY to $56.6M',
'Customer base expanded to 1,890 accounts',
'NPS improved from 72 to 82'
]
],
'type' => 'text'
]
]
],
'title' => 'Key Highlights'
],
'template_slide_id' => 'slide_content001'
],
[
'options' => [
'auto_paginate_tables' => true,
'table_min_font_size' => 9
],
'slide_data' => [
'content' => [
'blocks' => [
[
'table' => [
'table' => [
'rows' => [
[
'cells' => [
[
'value' => 'Metric'
],
[
'value' => 'Q3'
],
[
'value' => 'Q4'
],
[
'value' => 'Change'
]
],
'is_header' => true
],
[
'cells' => [
[
'value' => 'Revenue'
],
[
'value' => '$12.8M'
],
[
'value' => '$14.2M'
],
[
'value' => '+11%'
]
]
],
[
'cells' => [
[
'value' => 'Customers'
],
[
'value' => '1,620'
],
[
'value' => '1,890'
],
[
'value' => '+17%'
]
]
]
]
]
],
'type' => 'table'
]
]
],
'title' => 'Quarterly Performance'
],
'template_slide_id' => 'slide_table001'
]
]
]),
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.example.com/api/v1/presentations/generate-deck"
payload := strings.NewReader("{\n \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\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.example.com/api/v1/presentations/generate-deck")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/presentations/generate-deck")
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 \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"generation_id": "gen_abc123def456",
"status": "pending",
"status_url": "https://api.example.com/api/v1/presentations/gen_abc123def456/status",
"created_at": "2023-11-07T05:31:56Z",
"message": "Generation started. Poll status URL for progress."
}Authorizations
Production API key. Development/test deployments may also allow X-Org-Name.
Body
Request schema for generating a complete presentation deck with multiple slides.
This endpoint processes asynchronously due to the potentially large workload.
It returns immediately with a generation_id that you use to poll for status.
Workflow:
- POST to
/presentations/generate-deckwith this request body - Receive
generation_idandstatus_urlin response - Poll
GET /presentations/{generation_id}/statusuntil status iscompletedorfailed - Download the generated .pptx from the
download_urlin the status response
Slides ordering: Slides appear in the generated deck in the same order as the slides array.
Mixed templates: Each slide can use a different template slide, allowing you to combine slides from multiple templates into a single deck.
Ordered list of slides to generate. Minimum 1 slide required. Slides appear in the deck in this order.
1Show child attributes
Show child attributes
Organization name. If provided, must match the API key's organization. If omitted, the API key's organization is used.
"acme-corp"
Default generation options applied to all slides. Individual slides can override these by specifying their own options.
Show child attributes
Show child attributes
{
"allow_textbox_reposition": false,
"auto_paginate_tables": true,
"footer_font_name": "Arial",
"footer_font_size": 10,
"footer_text": "Confidential",
"show_slide_numbers": true,
"table_min_font_size": 8,
"textbox_min_font_size": 8
}
Response
Generation started - poll status endpoint for progress
Response schema for async generation requests.
This response is returned immediately when you POST to /presentations/generate
or /presentations/generate-deck, and when you PUT to
/presentations/{id}/update-charts. The actual Aspose work happens in the
background.
Next steps:
- Save the
generation_idfrom this response - Poll
status_url(orGET /presentations/{generation_id}/status) every few seconds - When status becomes
completed,partial, orfailed, generation is done - Download from
download_urlin the status response (forcompletedorpartial)
Unique identifier for this generation job. Use this to poll status and download the result.
"gen_abc123def456"
Initial status. Always 'pending' for new requests.
"pending"
Full URL to poll for generation status. Convenience field - you can also construct this as GET /presentations/{generation_id}/status.
"https://api.example.com/api/v1/presentations/gen_abc123def456/status"
Timestamp when the generation request was created.
Human-readable status message.
"Generation started. Poll status URL for progress."
curl --request POST \
--url https://api.example.com/api/v1/presentations/generate-deck \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"options": {
"allow_textbox_reposition": false,
"auto_paginate_tables": true
},
"org_name": "acme-corp",
"slides": [
{
"slide_data": {
"subtitle": "Executive Summary",
"title": "Q4 2024 Business Review"
},
"template_slide_id": "slide_title001"
},
{
"slide_data": {
"content": {
"blocks": [
{
"text": {
"bullets": [
"Revenue grew 25% YoY to $56.6M",
"Customer base expanded to 1,890 accounts",
"NPS improved from 72 to 82"
]
},
"type": "text"
}
]
},
"title": "Key Highlights"
},
"template_slide_id": "slide_content001"
},
{
"options": {
"auto_paginate_tables": true,
"table_min_font_size": 9
},
"slide_data": {
"content": {
"blocks": [
{
"table": {
"table": {
"rows": [
{
"cells": [
{
"value": "Metric"
},
{
"value": "Q3"
},
{
"value": "Q4"
},
{
"value": "Change"
}
],
"is_header": true
},
{
"cells": [
{
"value": "Revenue"
},
{
"value": "$12.8M"
},
{
"value": "$14.2M"
},
{
"value": "+11%"
}
]
},
{
"cells": [
{
"value": "Customers"
},
{
"value": "1,620"
},
{
"value": "1,890"
},
{
"value": "+17%"
}
]
}
]
}
},
"type": "table"
}
]
},
"title": "Quarterly Performance"
},
"template_slide_id": "slide_table001"
}
]
}
'import requests
url = "https://api.example.com/api/v1/presentations/generate-deck"
payload = {
"options": {
"allow_textbox_reposition": False,
"auto_paginate_tables": True
},
"org_name": "acme-corp",
"slides": [
{
"slide_data": {
"subtitle": "Executive Summary",
"title": "Q4 2024 Business Review"
},
"template_slide_id": "slide_title001"
},
{
"slide_data": {
"content": { "blocks": [
{
"text": { "bullets": ["Revenue grew 25% YoY to $56.6M", "Customer base expanded to 1,890 accounts", "NPS improved from 72 to 82"] },
"type": "text"
}
] },
"title": "Key Highlights"
},
"template_slide_id": "slide_content001"
},
{
"options": {
"auto_paginate_tables": True,
"table_min_font_size": 9
},
"slide_data": {
"content": { "blocks": [
{
"table": { "table": { "rows": [{
"cells": [{ "value": "Metric" }, { "value": "Q3" }, { "value": "Q4" }, { "value": "Change" }],
"is_header": True
}, { "cells": [{ "value": "Revenue" }, { "value": "$12.8M" }, { "value": "$14.2M" }, { "value": "+11%" }] }, { "cells": [{ "value": "Customers" }, { "value": "1,620" }, { "value": "1,890" }, { "value": "+17%" }] }] } },
"type": "table"
}
] },
"title": "Quarterly Performance"
},
"template_slide_id": "slide_table001"
}
]
}
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({
options: {allow_textbox_reposition: false, auto_paginate_tables: true},
org_name: 'acme-corp',
slides: [
{
slide_data: {subtitle: 'Executive Summary', title: 'Q4 2024 Business Review'},
template_slide_id: 'slide_title001'
},
{
slide_data: {
content: {
blocks: [
{
text: {
bullets: [
'Revenue grew 25% YoY to $56.6M',
'Customer base expanded to 1,890 accounts',
'NPS improved from 72 to 82'
]
},
type: 'text'
}
]
},
title: 'Key Highlights'
},
template_slide_id: 'slide_content001'
},
{
options: {auto_paginate_tables: true, table_min_font_size: 9},
slide_data: {
content: {
blocks: [
{
table: {
table: {
rows: [
{
cells: [{value: 'Metric'}, {value: 'Q3'}, {value: 'Q4'}, {value: 'Change'}],
is_header: true
},
{
cells: [{value: 'Revenue'}, {value: '$12.8M'}, {value: '$14.2M'}, {value: '+11%'}]
},
{
cells: [{value: 'Customers'}, {value: '1,620'}, {value: '1,890'}, {value: '+17%'}]
}
]
}
},
type: 'table'
}
]
},
title: 'Quarterly Performance'
},
template_slide_id: 'slide_table001'
}
]
})
};
fetch('https://api.example.com/api/v1/presentations/generate-deck', 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.example.com/api/v1/presentations/generate-deck",
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([
'options' => [
'allow_textbox_reposition' => false,
'auto_paginate_tables' => true
],
'org_name' => 'acme-corp',
'slides' => [
[
'slide_data' => [
'subtitle' => 'Executive Summary',
'title' => 'Q4 2024 Business Review'
],
'template_slide_id' => 'slide_title001'
],
[
'slide_data' => [
'content' => [
'blocks' => [
[
'text' => [
'bullets' => [
'Revenue grew 25% YoY to $56.6M',
'Customer base expanded to 1,890 accounts',
'NPS improved from 72 to 82'
]
],
'type' => 'text'
]
]
],
'title' => 'Key Highlights'
],
'template_slide_id' => 'slide_content001'
],
[
'options' => [
'auto_paginate_tables' => true,
'table_min_font_size' => 9
],
'slide_data' => [
'content' => [
'blocks' => [
[
'table' => [
'table' => [
'rows' => [
[
'cells' => [
[
'value' => 'Metric'
],
[
'value' => 'Q3'
],
[
'value' => 'Q4'
],
[
'value' => 'Change'
]
],
'is_header' => true
],
[
'cells' => [
[
'value' => 'Revenue'
],
[
'value' => '$12.8M'
],
[
'value' => '$14.2M'
],
[
'value' => '+11%'
]
]
],
[
'cells' => [
[
'value' => 'Customers'
],
[
'value' => '1,620'
],
[
'value' => '1,890'
],
[
'value' => '+17%'
]
]
]
]
]
],
'type' => 'table'
]
]
],
'title' => 'Quarterly Performance'
],
'template_slide_id' => 'slide_table001'
]
]
]),
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.example.com/api/v1/presentations/generate-deck"
payload := strings.NewReader("{\n \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\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.example.com/api/v1/presentations/generate-deck")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/presentations/generate-deck")
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 \"options\": {\n \"allow_textbox_reposition\": false,\n \"auto_paginate_tables\": true\n },\n \"org_name\": \"acme-corp\",\n \"slides\": [\n {\n \"slide_data\": {\n \"subtitle\": \"Executive Summary\",\n \"title\": \"Q4 2024 Business Review\"\n },\n \"template_slide_id\": \"slide_title001\"\n },\n {\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"text\": {\n \"bullets\": [\n \"Revenue grew 25% YoY to $56.6M\",\n \"Customer base expanded to 1,890 accounts\",\n \"NPS improved from 72 to 82\"\n ]\n },\n \"type\": \"text\"\n }\n ]\n },\n \"title\": \"Key Highlights\"\n },\n \"template_slide_id\": \"slide_content001\"\n },\n {\n \"options\": {\n \"auto_paginate_tables\": true,\n \"table_min_font_size\": 9\n },\n \"slide_data\": {\n \"content\": {\n \"blocks\": [\n {\n \"table\": {\n \"table\": {\n \"rows\": [\n {\n \"cells\": [\n {\n \"value\": \"Metric\"\n },\n {\n \"value\": \"Q3\"\n },\n {\n \"value\": \"Q4\"\n },\n {\n \"value\": \"Change\"\n }\n ],\n \"is_header\": true\n },\n {\n \"cells\": [\n {\n \"value\": \"Revenue\"\n },\n {\n \"value\": \"$12.8M\"\n },\n {\n \"value\": \"$14.2M\"\n },\n {\n \"value\": \"+11%\"\n }\n ]\n },\n {\n \"cells\": [\n {\n \"value\": \"Customers\"\n },\n {\n \"value\": \"1,620\"\n },\n {\n \"value\": \"1,890\"\n },\n {\n \"value\": \"+17%\"\n }\n ]\n }\n ]\n }\n },\n \"type\": \"table\"\n }\n ]\n },\n \"title\": \"Quarterly Performance\"\n },\n \"template_slide_id\": \"slide_table001\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"generation_id": "gen_abc123def456",
"status": "pending",
"status_url": "https://api.example.com/api/v1/presentations/gen_abc123def456/status",
"created_at": "2023-11-07T05:31:56Z",
"message": "Generation started. Poll status URL for progress."
}