PPTX Builder API
PPTX BuilderBook a demoAccount
v1
v1
  • Introduction
  • Guide
    • Create account
    • Get API token
    • Webhook
    • Preparing your slides
  • Concepts
    • Intro
    • Slide Masters
    • Slide Layouts
    • Placeholders
    • Slide
  • API Reference
    • Authentication
    • JSON to PPTX Builder
      • Request Payload
        • Base Settings
        • Custom Settings
        • Global Chart Settings
        • Slide Settings
        • Chart View Settings
        • Columns
        • Rows
        • Chart title
    • JSON to PPTX
      • Request Payload
        • Base settings
        • Slide Settings
        • Chart View Settings
        • Columns
        • Rows
        • Chart Title
  • Fonts
  • Chart Types
  • Data Labels
  • Chart Settings Specifics
  • Examples
    • JSON to PPTX Builder
    • JSON to PPTX
    • API Token
Powered by GitBook
On this page

Was this helpful?

  1. Examples

JSON to PPTX

This page shows a simple example of how to get started with the endpoint JSON to PPTX

JSON Example

{
  "base_settings": {
    "file_name": "test_demo"
  },
  "body": [{
    "table_text": "Demo",
    "question_text": "What is Demo?",
    "base_text": "A Demo is something that is used for presentation!",
    "rows": ["Cardiology", "Endocrinology / Diabetology", "General Practice / Family Medicine", "Internal Medicine", "Other"],
    "columns": [{
      "text": "Total",
      "items": [{
        "text": "Total n=100",
        "base": 100,
        "data": [16, 5, 37, 42, 0]
      }]
    }, {
      "text": "Gender",
      "items": [{
        "text": "Male",
        "base": 100,
        "data": [16, 5, 37, 42, 0]
      }, {
        "text": "Female",
        "base": 100,
        "data": [20, 15, 47, 22, 10]
      }]
    }],
    "view_settings": {
      "slide_master_index": 0,
      "slide_layout_index": 0,
      "placeholder_index": 0,
      "chart_type": "bar"
    }
  }]
}

This is a minimal example of a json data request.

pptx_request.py
import requests

# preparing body for request
with open('example.json', 'rb') as f:
    body = f.read()

url = 'https://api.pptxbuilder.com/api/v1/convert'
headers = {"content-type": "application/json"}
headers['Authorization'] = 'Bearer ' + '<your-token>'

response = requests.post(url, data=body, headers=headers)
content = response.content

Converting request content to pptx with Python

disposition = response.headers['Content-Disposition']
file_name = disposition.split(';')[-1].strip().split('=')[1]
with open(file_name, 'wb') as w:
    w.write(content)
PreviousJSON to PPTX BuilderNextAPI Token

Last updated 4 years ago

Was this helpful?

Python example using library

requests