返回顶部
g

google-slides谷歌幻灯片

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
17,705
下载量
免费
免费
33
收藏
概述
安装方式
版本历史

google-slides

Google Slides

通过托管OAuth认证访问Google Slides API。创建和管理演示文稿,添加幻灯片,插入文本和图片,并控制格式。

快速开始

bash

创建新演示文稿


python < import urllib.request, os, json
data = json.dumps({title: 我的演示文稿}).encode()
req = urllib.request.Request(https://gateway.maton.ai/google-slides/v1/presentations, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础URL

https://gateway.maton.ai/google-slides/{native-api-path}

将{native-api-path}替换为实际的Google Slides API端点路径。网关将请求代理到slides.googleapis.com并自动注入您的OAuth令牌。

认证

所有请求都需要在Authorization头中包含Maton API密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的API密钥设置为MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取API密钥

  1. 1. 在maton.ai登录或创建账户
  2. 前往maton.ai/settings
  3. 复制您的API密钥

连接管理

在https://ctrl.maton.ai管理您的Google OAuth连接。

列出连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=google-slides&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python < import urllib.request, os, json
data = json.dumps({app: google-slides}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: 21fd90f9-5935-43cd-b6c8-bde9d915ca80,
status: ACTIVE,
creation_time: 2025-12-08T07:20:53.488460Z,
lastupdatedtime: 2026-01-31T20:03:32.593153Z,
url: https://connect.maton.ai/?session_token=...,
app: google-slides,
metadata: {}
}
}

在浏览器中打开返回的url以完成OAuth授权。

删除连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个Google Slides连接,请使用Maton-Connection头指定要使用的连接:

bash
python < import urllib.request, os, json
data = json.dumps({title: 我的演示文稿}).encode()
req = urllib.request.Request(https://gateway.maton.ai/google-slides/v1/presentations, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最旧)的活动连接。

API参考

演示文稿

创建演示文稿

bash
POST /google-slides/v1/presentations
Content-Type: application/json

{
title: 我的演示文稿
}

获取演示文稿

bash
GET /google-slides/v1/presentations/{presentationId}

页面(幻灯片)

获取页面

bash
GET /google-slides/v1/presentations/{presentationId}/pages/{pageId}

获取页面缩略图

bash
GET /google-slides/v1/presentations/{presentationId}/pages/{pageId}/thumbnail

自定义尺寸:

bash
GET /google-slides/v1/presentations/{presentationId}/pages/{pageId}/thumbnail?thumbnailProperties.mimeType=PNG&thumbnailProperties.thumbnailSize=LARGE

批量更新

batchUpdate端点用于大多数修改。它接受一个请求数组,这些请求将被原子性地应用。

bash
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json

{
requests: [...]
}

创建幻灯片

bash
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json

{
requests: [
{
createSlide: {
objectId: slide_001,
slideLayoutReference: {
predefinedLayout: TITLEANDBODY
}
}
}
]
}

可用的预定义布局:

  • - BLANK
  • TITLE
  • TITLEANDBODY
  • TITLEANDTWOCOLUMNS
  • TITLEONLY
  • SECTIONHEADER
  • ONECOLUMNTEXT
  • MAINPOINT
  • BIG_NUMBER

插入文本

bash
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json

{
requests: [
{
insertText: {
objectId: {shapeId},
text: 你好,世界!,
insertionIndex: 0
}
}
]
}

删除文本

bash
POST /google-slides/v1/presentations/{presentationId}:batchUpdate
Content-Type: application/json

{
requests: [
{
deleteText: {
objectId: {shapeId},
textRange: {
type: ALL
}
}
}
]
}

创建形状

bash
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
}
}
}
}
]
}

创建图片

bash
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}
},
transform: {
scaleX: 1,
scaleY: 1,
translateX: 200,
translateY: 200,
unit: PT
}
}
}
}
]
}

删除对象

bash

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-slides-1776362990 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-slides-1776362990 技能

通过命令行安装

skillhub install google-slides-1776362990

下载

⬇ 下载 google-slides v1.0.3(免费)

文件大小: 4.71 KB | 发布时间: 2026-4-17 15:56

v1.0.3 最新 2026-4-17 15:56
- Added a new metadata section under `metadata.clawdbot` with an emoji and required environment variable (`MATON_API_KEY`).
- No user-facing functionality changes; documentation only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部