PJ Bergeron
PJ Bergeron

Reputation: 2998

Delete one slide from a Google Presentation using API

How is it possible to delete a slide from a Google Presentation using Google API?

In https://developers.google.com/slides/samples/slides it is said: The Slides API allows you to create, move, and delete slides. However, I'm unable to find how to do it.

Upvotes: 1

Views: 2294

Answers (2)

WayneSchuller
WayneSchuller

Reputation: 21

In google app script you can do:

var presentation = SlidesApp.openById("23423423lksdjfsdlkfj");
var slides = presentation.getSlides();
slides[0].remove(); // Remove the first slide

You have to put the proper file id from the long part of the URL of the slide document.

Upvotes: 0

volkovbro
volkovbro

Reputation: 58

You can use DeleteObjectRequest for tihs https://developers.google.com/slides/reference/rest/v1/presentations/request#DeleteObjectRequest Pass your slide id to objectId.

Upvotes: 1

Related Questions