I am building an Android app that programmatically creates a presentation. I've tried using both the Java libraries as well as the online interactive slides API to create a new presentation and set the master slides. I am starting simple here - all I want to do is have a solid blue background master slide. Here is my API call to create:
{
"title": "test",
"masters": [
{
"pageProperties": {
"pageBackgroundFill": {
"solidFill": {
"color": {
"rgbColor": {
"blue": 1.0,
"green": 0.5,
"red": 1.0
}
}
}
}
},
"pageType": "MASTER",
"masterProperties": {
"displayName": "mymaster"
},
"objectId": "mymaster1"
}
]
}
Result is 200 OK. I look at the data in the result and my master is not there. The default master is there however. This is maddening - I have been searching for days on this. I must be missing some required fields - but this is not documented well by Google. I'd greatly appreciate some guidance on this.
Here is my Java code:
// Build master -
List<Page> master = new ArrayList<>();
master.add(new Page().setPageProperties(new PageProperties().setPageBackgroundFill(new PageBackgroundFill()
.setSolidFill(new SolidFill().setColor(new OpaqueColor()
.setRgbColor(new RgbColor().setRed(1.0f).setGreen(0.5f).setBlue(1.0f))))))
.setPageType("MASTER").setObjectId("mymaster1").setMasterProperties(new MasterProperties().setDisplayName("mymaster")));
// Create presentation
Presentation presentation = new Presentation()
.setTitle("test").setMasters(master);
presentation = mSlidesService.presentations().create(presentation)
.setFields("presentationId")
.execute();