PowerPoint Generator API
  • PowerPoint Generator API
  • Getting started
    • Quick start
  • API reference
    • token/create
    • generator/create
  • Knowledge base
    • Key concepts
    • Templating your presentation
    • Building your JSON payload
    • Finding shape names
  • JSON/ PPTX Reference
    • presentation
    • slides
    • shapes
      • textbox
      • chart
      • picture
      • table
    • tags
    • Deprecated
  • Examples
    • Presentation
      • Naming output presentation
      • Using multiple templates
    • Slide
      • Change shape size and position
      • Change shape background color
      • Hide or remove shape
      • Replacing tags
    • Textboxes
      • Add text
      • Set font type and size
      • Set font color and font background color
      • Set bold, italic & underline
      • Set text alignment
      • Set text indentation
      • Set text line spacing
      • Using bullet-points
    • Chart
      • Change font settings
      • Insert data
      • Adjust chart legend
      • Appending to data labels
    • Pictures
    • Table
      • Populate simple table
      • Using `text_runs` in Table cells
      • Handling merged cells
      • Update a specific cells in existing table
    • Tags
Powered by GitBook
On this page
  • Referencing your template PowerPoint file
  • Defining your slides:
  • Template type and which slide to use:
  • Updating your shapes
  • Complete example payload
  • Using above payload, create a presentation using slide as template

Was this helpful?

  1. Knowledge base

Building your JSON payload

and configuring your presentation.

PreviousTemplating your presentationNextFinding shape names

Last updated 1 year ago

Was this helpful?

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:

{
  "presentation": {
    "template": "slides_as_template.pptx",
    "export_version": "Pptx2010",
    ....

Refer to 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:

....
  "slides": [
    {
      ...shape objects...
    }
  ]
....

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):

....
  "type": "slide",
  "slide_index": 0,
....

Updating your shapes

Within your slide object you can refer to an array of shape objects.

....
  "shapes": [
    {
      "name": "Title 1",
      "content": "Automate PowerPoint Generation"
    }
  ]
....

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

{
   "presentation":{
      "template":"slides_as_template.pptx",
      "export_version":"Pptx2010",
      "slides":[
         {
            "type":"slide",
            "slide_index":0,
            "shapes":[
               {
                  "name":"Title 1",
                  "content":"Automate PowerPoint Generation"
               }
            ]
         },
         {
            "type":"slide",
            "slide_index":1,
            "shapes":[
               {
                  "name":"Chart 14",
                  "title":"Average Annual Precipitations",
                  "data":[
                     [
                        "North",
                        "South",
                        "East",
                        "West"
                     ],
                     [
                        "January",
                        "February",
                        "March"
                     ],
                     [
                        11,
                        15,
                        4,
                        7
                     ],
                     [
                        25,
                        60,
                        77,
                        30
                     ],
                     [
                        40,
                        50,
                        65,
                        44
                     ]
                  ]
               }
            ]
         }
      ]
   }
}

Using above payload, create a presentation using slide as template

POST https://gen.powerpointgeneratorapi.com/v1.0/generator/create

Headers

Name
Type
Description

Content-Type*

string

multipart/form-data

Authorization*

string

Bearer authorization token

Request Body

Name
Type
Description

files

object

PPTX file used as styling and layout template

jsonData*

string

JSON payload which contains the presentation definition

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 . 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:

Templating your presentation
here
806KB
slides_as_template.pptx