4.5 KiB
4.5 KiB
Google Slides Routing Reference
App name: google-slides
Base URL proxied: slides.googleapis.com
API Path Pattern
/google-slides/v1/presentations/{presentationId}
Common Endpoints
Create Presentation
POST /google-slides/v1/presentations
Content-Type: application/json
{
"title": "My Presentation"
}
Get Presentation
GET /google-slides/v1/presentations/{presentationId}
Get Page (Slide)
GET /google-slides/v1/presentations/{presentationId}/pages/{pageId}
Get Page Thumbnail
GET /google-slides/v1/presentations/{presentationId}/pages/{pageId}/thumbnail
Batch Update (All Modifications)
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [...]
}
Create Slide
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"createSlide": {
"objectId": "slide_001",
"slideLayoutReference": {
"predefinedLayout": "TITLE_AND_BODY"
}
}
}
]
}
Predefined layouts: BLANK, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, TITLE_ONLY, SECTION_HEADER, ONE_COLUMN_TEXT, MAIN_POINT, BIG_NUMBER
Insert Text
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"insertText": {
"objectId": "{shapeId}",
"text": "Hello, World!",
"insertionIndex": 0
}
}
]
}
Create Shape (Text Box)
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"createShape": {
"objectId": "shape_001",
"shapeType": "TEXT_BOX",
"elementProperties": {
"pageObjectId": "{slideId}",
"size": {
"width": {"magnitude": 300, "unit": "PT"},
"height": {"magnitude": 100, "unit": "PT"}
},
"transform": {
"scaleX": 1,
"scaleY": 1,
"translateX": 100,
"translateY": 100,
"unit": "PT"
}
}
}
}
]
}
Create Image
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"createImage": {
"objectId": "image_001",
"url": "https://example.com/image.png",
"elementProperties": {
"pageObjectId": "{slideId}",
"size": {
"width": {"magnitude": 200, "unit": "PT"},
"height": {"magnitude": 200, "unit": "PT"}
}
}
}
}
]
}
Delete Object
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"deleteObject": {
"objectId": "{objectId}"
}
}
]
}
Replace All Text (Template Substitution)
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"replaceAllText": {
"containsText": {
"text": "{{placeholder}}",
"matchCase": true
},
"replaceText": "Actual Value"
}
}
]
}
Update Text Style
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json
{
"requests": [
{
"updateTextStyle": {
"objectId": "{shapeId}",
"textRange": {"type": "ALL"},
"style": {
"bold": true,
"fontSize": {"magnitude": 24, "unit": "PT"}
},
"fields": "bold,fontSize"
}
}
]
}
Notes
- Object IDs must be unique within a presentation
- Use batchUpdate for all modifications (adding slides, text, shapes, etc.)
- Multiple requests in a batchUpdate are applied atomically
- Sizes and positions use PT (points) as the unit (72 points = 1 inch)
- Use
replaceAllTextfor template-based presentation generation