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)