Attaching a .pptx template and JSON tailoring instructions in a single HTTP message

multipart/form-data message

"template"

Property template

"instructions"

"patio.jpg"

Patio image

Tailored Presentation

Finished slide

Rather than upload your PowerPoint template to the cloud and refer to it by URL, you can bundle it as an attachment to your JSON tailoring instructions and send both as a single message, using Content-Type: multipart/form-data.

Each part of a multipart message must have a Content-Disposition header declaring its name. Two names are special to Slide Tailor. You must include a part named "instructions" containing the JSON instructions for tailoring your template. You may include a part named "template" containing the .pptx template to modify; otherwise you must specify a template URL in the instructions.

You can send additional parts containing images to be used in your tailoring operation. You may give these whatever names you like and use those names in place of an image URL in your instructions.

This bash/PowerShell example first downloads a .pptx template and an image from this site, then bundles them with JSON tailoring instructions in a single multipart HTTP message to the API. It inserts the image in the presentation and downloads a property.pptx into your current directory.