Building your JSON payload
and configuring your presentation.
Here we outline the component parts of the JSON payload necessary for creating a presentation.
Referencing your template PowerPoint file
First you must tell the API where to retrieve the PowerPoint file that contains the slides you intend to use as templates for your presentation. You will either refer to the template PowerPoint file by its name, or the link where it can be downloaded.
In this case we are sending the template PowerPoint file directly with the POST request:
Refer to Templating your presentation for more on sharing template PowerPoint files.
Defining your slides:
For each slide you want to create, you will need to build an object in the "slides" array:
Template type and which slide to use:
For each slide object you are required to specify the type of slide you want to use as template. In this case we are using a slide from our template PowerPoint file.
Additionally you are required to choose which template slide to use as template for your new slide (zero-based):
Updating your shapes
Within your slide object you can refer to an array of shape objects.
Everything on a slide is a shape. Each shape object has a name. To select and populate a specific shape, you must reference it by name. To find a specific shape by name see here. Then you can specify the content you want placed into that shape on your slide. In this case we are adding a string to a text shape:
Complete example payload
Payload below will generate a PowerPoint presentation with two slides, populating a textbox on slide one and a chart on slide two whilst retaining the styling of the two slides from the template PowerPoint file:
Template Presentation
JSON Payload
Using above payload, create a presentation using slide as template
POST
https://gen.powerpointgeneratorapi.com/v1.0/generator/create
Headers
Content-Type*
string
multipart/form-data
Authorization*
string
Bearer authorization token
Request Body
files
object
PPTX file used as styling and layout template
jsonData*
string
JSON payload which contains the presentation definition
Last updated