This page describes how to perform certain high-level tasks involving presentations, such as:
- Create a presentation
- Copy an existing presentation
The following paragraphs describe these tasks in detail.
Create a blank presentation
To create a presentation, use the create method on the presentations collection, as shown in the following example.
This example creates a blank presentation with a specified title.
Work with Google Drive folders
There’s no option to create a presentation directly within a specified Drive folder using the Google Slides API. By default, the created presentation is saved to the user’s root folder on Drive.
However, there are 2 alternatives to saving a file to a Drive folder:
- After the presentation is created, move it to a specific folder using the files.update method of the Drive API. For more information on moving files, refer to Move files between folders.
- Add a blank presentation to a folder using the files.create method of the Drive API, specifying
application/vnd.google-apps.presentation
as themimeType
. For more information on creating files, refer to Create a file in a folder.
For either alternative, you'll need to add the appropriate Drive API scopes to authorize the call.
To move or create a file within a shared drive folder, refer to Implement shared drive support.
Copy an existing presentation
To copy a presentation, use Drive API's files().copy method.
The following example copies an existing presentation, using a provided string for both the presentation title and the name of the new Drive file.
Note that you need to use an appropriate Drive API scope to authorize the call.