LogoLogo
  • Welcome
  • Getting Started
    • Quickstart
  • Basics
    • API Reference
    • Templates
    • Custom templates
      • Preparing your template
      • Using a custom template
    • Integrations
  • EXAMPLES
    • Editing an existing PowerPoint
Powered by GitBook
On this page
  • Step 1: Assign names to text layers
  • Step 2: Preparing API request
  • Step 3: Sending the request
  1. EXAMPLES

Editing an existing PowerPoint

Learn how to edit an existing PowerPoint

PreviousIntegrations

Last updated 4 months ago

It is also possible to edit an existing PowerPoint using the SlideSpeak API. This will work for any PowerPoint.

Step 1: Assign names to text layers

Before editing a PowerPoint using the SlideSpeak API, you first have to edit the names of the placeholder fields inside the PowerPoint you want to edit.

Open your PowerPoint inside the desktop application and open the Selection Pane by clicking on Arrange -> Selection Pane

After that, select a text placeholder that you want to be editable and give it a unique name. This name must be unique across the presentation. A recommendation to make this easier is to include the slide number in the name.

Do this for all text that you want to be able to edit using the SlideSpeak API across the different slides.

Step 2: Preparing API request

After we have prepared our PowerPoint we can look at sending the API request in order to edit it. We are going to be sending a post request that includes the document, as well as a config. Let's first look at the config. Here is an example config that edits the presentation we just prepared.

{
  "replacements": [
    {
      "shape_name": "1_TITLE",
      "content": "A new title for the first slide!"
    },
    {
      "shape_name": "1_SUBTITLE",
      "content": "A new subtitle for the first slide"
    },
    {
      "shape_name": "2_TOC",
      "content": "Introduction\nImportance\nMajor Threats\nConservation"
    }
  ]
}

To keep it simple, this config only changes the first slide and the Table of Contents. We can easily expand this by including replacements for the other slides. The "shape_name" must match the name of a given name of a shape in the PowerPoint. Each shape that matches that name will be replaced. For example, you might use the name "FOOTER" multiple times across different slides. If you use that shape name in your config you will see that every text box named FOOTER will have its text replaced to the provided text.

Step 3: Sending the request

We are now ready to send the API request. Make a POST request to the following endpoint:

In this request, include the file and config as form-data. "pptx_file" for the file and "config" for the config. After a few seconds you will get a URL where you can download the edited PowerPoint. You should see that the text has been replaced. If you don't, make sure the shape name matches that of the name selected inside the Selection Pane exactly.

Below you can download the PowerPoint file used in this example.

Prefer using Postman? Check out our .

For more details about the edit, or any other endpoint, please view the page.

Postman collection
https://api.slidespeak.co/api/v1/presentation/edit
API Reference
1MB
forest-preservation.pptx