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
  • generator/create
  • Example request

Was this helpful?

  1. API reference

generator/create

How to create a presentation

Use this endpoint to create a new presentation from a .pptx template file and JSON data.

generator/create

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

Headers

Name
Type
Description

Content-Type*

String

multipart/form-data

Authorization*

String

Bearer authentication token

Request Body

Name
Type
Description

files*

Object

.pptx file

jsonData*

String

JSON data

Example request

curl --location --request POST 'https://gen.powerpointgeneratorapi.com/v1.0/generator/create' \
-H 'Content-Type: multipart/form-data' \
-H 'Authorization: Bearer {add_your_token_here}' \
-F 'files=@my_dummy_presentation.pptx' \
-F 'jsonData={"presentation":{"template":"my_dummy_presentation.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"Your generated PowerPoint presentation"},{"name":"Subtitle 2","content":"Create,fill and manage PowerPoint documents through simple API requests."}]}]}}'
import requests

payload={'jsonData': '{"template":"my_dummy_presentation.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"Your generated PowerPoint presentation"},{"name":"Subtitle 2","content":"Create, fill and manage PowerPoint documents through simple API requests."}]}]}'}

files=[
  ('files', ('my_dummy_presentation.pptx', open('./my_dummy_presentation.pptx','rb'), 'application/vnd.openxmlformats-officedocument.presentationml.presentation'))
]

response = requests.post(
    'https://gen.powerpointgeneratorapi.com/v1.0/generator/create',
    data=payload,
    files=files,
    headers={
        'Authorization': f'Bearer {add_your_token_here}',
    },
    timeout=360
)

with open("./generated.pptx", "wb") as file:
    file.write(response.content)
const formData = new FormData();

  formData.append("jsonData", JSON.stringify('{"presentation":{"template":"url of title_slide_template.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"YourgeneratedPowerPointpresentation"},{"name":"Subtitle 2","content":"Create,fillandmanagePowerPointdocumentsthroughsimpleAPIrequests."}]}]}}'));

  const request = new XMLHttpRequest();
  request.open(
    "POST",
    "https://gen.powerpointgeneratorapi.com/v1.0/generator/create",
    true
  );
  request.setRequestHeader(
    "Authorization",
    "Bearer {add_your_token_here}"
  );

  request.responseType = "blob";

  request.onload = function () {
    if (request.readyState === request.DONE && request.status === 200) {
      var blob = new Blob([request.response], {
      type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
      });
      var link = document.createElement("a");
      link.href = window.URL.createObjectURL(blob);
      link.download = "generated.pptx";
      link.click();      
    }
  };

  request.send(formData);
  1. Select the Authorization tab, enter your Token .

  2. Select the Body tab, select form-data , add the two key-value parameters below:

    KEY
    VALUE

    files

    upload/ attach your .pptx file

    jsonData

    copy and paste the data from your .json payload

  1. Click the down arrow next to Send then select Send and Download . Once the result is successfully received, save the output as .pptx.

Previoustoken/createNextKey concepts

Last updated 2 months ago

Was this helpful?