PPTX Builder API
PPTX BuilderBook a demoAccount
v2
v2
  • Introduction
  • Guide
    • Create account
    • Get API Token
    • Webhook
    • Preparing 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 Settings
          • Chart View Settings
        • Columns
        • Rows
        • Significance Test
        • Chart Title
    • JSON to PPTX
    • Append slide
      • Request Payload
    • Upload template
  • Fonts
  • Chart Types
  • Data Labels
  • Legend
  • Chart Specific Settings
  • Examples
    • JSON to PPTX Builder
    • API Token
    • Append slide
    • More examples
Powered by GitBook
On this page

Was this helpful?

  1. Examples

Append slide

This page describes an example usage of the append_slide endpoint.

JSON Example

{
	"slide": {
		"id": null,
		"base_text": "Weighted Base (All Answering):ALL",
		"table_text": "Q1",
		"index": 0,
		"layout": {
			"pptx_template": "Default",
			"slide_layout_index": 5,
			"slide_master_index": 0
		},
		"question_text": "Q1. Which of these have you done in the last week?"
	},
	"charts": [{
		"rows": [{
			"text": "Read a printed newspaper",
			"visible": true
		}, {
			"text": "Visited a newspaper website",
			"visible": true
		}, {
			"text": "Read a printed magazine",
			"visible": true
		}],
		"columns": [{
			"text": "Total",
			"selected": true,
			"items": [{
				"base": 1949,
				"data": [43, 41, 25],
				"text": "Total",
				"selected": true
			}]
		}, {
			"text": "Gender",
			"selected": true,
			"items": [{
				"base": 175,
				"data": [44, 44, 24],
				"text": "Male",
				"selected": true
			}, {
				"base": 434,
				"data": [42, 39, 27],
				"text": "Female",
				"selected": true
			}]
		}],
        "view_settings": {
            "chart_type": "bar",
            "placeholder_index": 0
        }
	}]
}

This is a minimal example of a json data request.

Python example using requests library

append_slide.py
import requests

url = "https://api.pptxbuilder.com/api/v2/append-slide?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyFERder34DM4OTcyMzksImRhdGFfaWQiOjg5LCJhcGlfdmVyc2lvbiI6Mn0.2XGoQSYkYepCeypTfP323UDlxyR_3LCSzovoLYd5_co"

payload = YOUR_SLIDE_JSON_PAYLOAD
headers = {
  'Authorization': YOUR_TOKEN,
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

PreviousAPI TokenNextMore examples

Last updated 4 years ago

Was this helpful?