Using multiple templates
You may have a scenario where you want to build a PowerPoint using slides from multiple template PowerPoints.
To do this, you have to:
Attach Files and/or Provide Template URLs:
File Attachment: Attach your template PowerPoint files as
Fileattachments in thePOSTrequest, using the parameter namefiles.

Template URLs: You can also use URLs for templates stored online, such as in Google Drive or OneDrive, which provide direct download access.
Define Templates in Your JSON Payload: Add a
template_listparameter in your JSON payload, as shown below. Thetemplate_listshould contain an entry for each template file, with a uniquetemplate_idand the name of each template file. Eachtemplatename must exactly match the filename of the corresponding "files" parameter sent in the form.
{
"presentation":{
"template_list":[
{
"template_id":1,
"template":"template-1.pptx"
},
{
"template_id":2,
"template":"template-2.pptx"
},
{
"template_id":3,
"template":"template-3.pptx"
}
]
....
Assign Template IDs to Slides: In the JSON payload, specify a
template_idfor each slide to indicate which template file to use. Eachslideobject should include aslide_indexand thetemplate_idfor the template it should follow.
"slides":[
{
"template_id":1,
"slide_index":0,
.... Important Note
You cannot use both a single template file and multiple templates together. The following example demonstrates incorrect syntax:
//This syntax is not allowed.
{
"presentation":{
"template":"template.pptx",
"template_list":[
{
"template_id":1,
"template":"template-1.pptx"
},
{
"template_id":2,
"template":"template-2.pptx"
},
{
"template_id":3,
"template":"template-3.pptx"
}
],
....Reference: presentation
Download: input.zip | output.pptx



{
"presentation": {
"template_list": [
{
"template_id": 1,
"template": "template-1.pptx"
},
{
"template_id": 2,
"template": "template-2.pptx"
}
],
"slides": [
{
"slide_index": 0,
"template_id": 1,
"shapes": [
{
"name": "Chart 1",
"data": [
[
"North",
"South",
"East",
"West"
],
[
"January",
"February",
"March",
"April"
],
[
11,
15,
4,
7
],
[
15,
35,
23,
18
],
[
40,
50,
65,
44
],
[
60,
73,
52,
68
]
]
}
]
},
{
"slide_index": 0,
"template_id": 2,
"shapes": [
{
"name": "Chart 1",
"data": [
[
"Product A",
"Product B",
"Product C"
],
[
"Q1",
"Q2",
"Q3"
],
[
72,
78,
81
],
[
68,
74,
77
],
[
85,
88,
90
]
]
}
]
}
]
}
}Last updated
Was this helpful?