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
  • Objective
  • Step 1. Create an account
  • Step 2. Create an authentication token
  • Create authentication token
  • Example Requests
  • Step 3: Make a request to PowerPointGeneratorAPI
  • Create presentation
  • Example Requests
  • Output .pptx file

Was this helpful?

  1. Getting started

Quick start

Get started in 3 easy steps

PreviousPowerPoint Generator APINexttoken/create

Last updated 2 months ago

Was this helpful?

Objective

Generate a fresh presentation by utilizing a PowerPoint template and JSON data via a request to the PowerPointGeneratorAPI service.

Step 1. Create an account

Security key will be emailed to you.

Step 2. Create an authentication token

Create authentication token

POST https://auth.powerpointgeneratorapi.com/v1.0/token/create

This endpoint enables you to create an authentication token. You will need this for all requests to the API. Your authentication token is only valid for 24 hours. Once your token has expired you will need to request a new token.

Headers

Name
Type
Description

Content-Type*

String

multipart/form-data

Request Body

Name
Type
Description

username*

String

your email address

password*

String

your account password

key*

String

your security key

Success
Bad Request 

Example Requests

curl -d "username=<your_username>&password=<your_password>&key=<your_security_key>" \
     -X POST https://auth.powerpointgeneratorapi.com/v1.0/token/create
import requests

# API endpoint for token creation
url = "https://auth.powerpointgeneratorapi.com/v1.0/token/create"

# Your credentials and security key
credentials = {
    'username': '<your_username>',
    'password': '<your_password>',
    'key': '<your_security_key>'
}

# Headers for the HTTP request
headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

# Send a POST request to the API endpoint with credentials
response = requests.post(url, headers=headers, data=credentials)

# Print the response from the API
print(response.text)
// Create a new FormData object to handle the form data
const formData = new FormData();
formData.append("username", "<your_username>");
formData.append("password", "<your_password>");
formData.append("key", "<your_security_key>");

// Define the options for the fetch request
const requestOptions = {
  method: 'POST',
  body: formData,          // Set the body of the request to the FormData object
  redirect: 'follow'       // Specify the redirect behavior
};

// Make a POST request to the authentication endpoint
fetch("https://auth.powerpointgeneratorapi.com/v1.0/token/create", requestOptions)
  .then(response => response.text())    // Parse the response as text
  .then(result => console.log(result)) // Log the result to the console
  .catch(error => console.error('Error:', error)); // Log any errors that occur
  1. Select form-data in the Body tab

  2. Populate the KEY and VALUE with your username, password and key

  3. Hit Send to get your Token

Step 3: Make a request to PowerPointGeneratorAPI

Download the ZIP folder below and extract its contents. Then, use Postman or any API client to send the .pptx template file and the JSON data file to the generator/create endpoint to generate your presentation.

Create presentation

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 template file

jsonData*

String

JSON payload

Success
Bad Request
Unauthorized

Example Requests

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=@title_slide_template.pptx' \
-F 'jsonData={"presentation":{"template":"title_slide_template.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

auth_token = 'your_actual_token_here'

payload = {
    "jsonData": '''{
        "presentation": {
            "template": "title_slide_template.pptx",
            "export_version": "Pptx2013",
            "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."
                        }
                    ]
                }
            ]
        }
    }'''
}

with open("./title_slide_template.pptx", "rb") as pptx_file:
    files = [
        ('files', ('title_slide_template.pptx', pptx_file, 'application/vnd.openxmlformats-officedocument.presentationml.presentation'))
    ]
    
    try:
        print("⏳ Sending request...")
        response = requests.post(
            'https://gen.powerpointgeneratorapi.com/v1.0/generator/create',
            data=payload,
            files=files,
            headers={'Authorization': f'Bearer {auth_token}'},
            timeout=360
        )
        
        print("🚀 Response received!")
        
        # Validate response before saving
        if response.status_code == 200:
            with open("./generated.pptx", "wb") as output_file:
                output_file.write(response.content)
            print("✅ PowerPoint file generated successfully!")
        else:
            print(f"❌ Error: {response.status_code} - {response.text}")
    
    except requests.exceptions.RequestException as e:
        print(f"⚠️ Request failed: {e}")
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 .

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

KEY
VALUE

files

upload/ attach the .pptx file from the quick-start.zip folder above

jsonData

Copy and paste the data from the .json file in the quick-start.zip folder above.

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

Output .pptx file

You will receive a byte array that can be converted to a PowerPoint presentation. Your PowerPoint will contain a single slide that looks like this:

Sign up to PowerPointGeneratorAPI . Make a note of your email address, password and security key. You will need these to create an authentication token.

All API calls require authentication. You can create an authentication token manually using the or programmatically using the POST below.

Post:

here
Web Console
https://auth.powerpointgeneratorapi.com/v1.0/token/create
507KB
quick-start.zip
archive
How the API works