Unlock the full potential of Google Slides API with this in-depth guide designed for developers. Whether you're looking to create, manage, or customize Google Slides presentations programmatically, this guide covers everything from authentication to advanced features like batchUpdate and object manipulation. Learn how to integrate Google Slides with Google Workspace, utilize presentationId and objectId, and streamline workflows with powerful API capabilities.
The Google Slides API allows developers to:
Before using the API, you need to enable it in Google Cloud Console:
To access Google Slides API, authentication is required using OAuth 2.0:
Use the presentations.create
method to generate a new Google Slides presentation:
POST https://slides.googleapis.com/v1/presentations
Sample Response:{
"presentationId": "your_presentation_id",
"title": "New Presentation"
}
2. Adding and Editing SlidesOnce a presentation is created, you can modify it using batchUpdate requests.
POST https://slides.googleapis.com/v1/presentations/{presentationId}:batchUpdate
Request Body:
{
"requests": [{
"createSlide": {
"objectId": "new_slide_id",
"insertionIndex": 1
}
}]
}
Replacing Text in a SlideModify text elements dynamically using the replaceAllText request:
{
"requests": [{
"replaceAllText": {
"containsText": {"text": "{{placeholder}}"},
"replaceText": "Updated text"
}
}]
}
3. Adding Images and Other ElementsYou can insert images, shapes, and charts using the API:
{
"requests": [{
"createImage": {
"url": "https://example.com/image.jpg",
"elementProperties": {
"pageObjectId": "slide_id"
}
}
}]
}
Integrating Google Slides API with Google WorkspaceGoogle Slides API allows seamless integration with Google Sheets:
presentationId
and objectId
are correct.The Google Slides API offers powerful features for automating and customizing presentations. Whether you need to generate slide decks, integrate with Google Workspace, or dynamically update content, this API provides the tools to optimize your workflow.
Start building today by exploring the Google Slides API documentation!