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

multipart/form-data message

Title slideFinancials slideThank you slide
 +

Tailored Presentation

Title slide
Thank you slide
"template"
part
"instructions"
part
acme-business-plan.pptx

Rather than upload your PowerPoint template to the cloud and referto 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.

Standard web references explain multipart messages in detail. Each part must have a Content-Disposition header declaring its name, and 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 templateUrl 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 from this site, then bundles it and JSON tailoring instructions in a single multipart HTTP message to the API. It deletes one slide from the template and downloads a business-plan.pptx into your current directory.