返回顶部
g

google-workspace-admin谷歌工作区管理

|

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

google-workspace-admin

Google Workspace 管理员

通过托管 OAuth 认证访问 Google Workspace Admin SDK。管理 Google Workspace 的用户、群组、组织单位、角色和域名设置。

快速开始

bash

列出域中的用户


python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=10)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础 URL

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

将 {native-api-path} 替换为实际的 Admin SDK API 端点路径。网关将请求代理到 admin.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-workspace-admin&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-workspace-admin}).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-workspace-admin,
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 Workspace 管理员连接,请使用 Maton-Connection 头指定要使用的连接:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

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

API 参考

用户

列出用户

bash
GET /google-workspace-admin/admin/directory/v1/users?customer=my_customer&maxResults=100

查询参数:

  • - customer - 客户 ID 或 my_customer(您的域)(必需)
  • domain - 按特定域筛选
  • maxResults - 每页最大结果数(1-500,默认 100)
  • orderBy - 按 email、familyName 或 givenName 排序
  • query - 搜索查询(例如 email:john、name:John
  • pageToken - 分页令牌

示例:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-workspace-admin/admin/directory/v1/users?customer=my_customer&query=email:john*)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
kind: admin#directory#users,
users: [
{
id: 123456789,
primaryEmail: john@example.com,
name: {
givenName: John,
familyName: Doe,
fullName: John Doe
},
isAdmin: false,
isDelegatedAdmin: false,
suspended: false,
creationTime: 2024-01-15T10:30:00.000Z,
lastLoginTime: 2025-02-01T08:00:00.000Z,
orgUnitPath: /Sales
}
],
nextPageToken: ...
}

获取用户

bash
GET /google-workspace-admin/admin/directory/v1/users/{userKey}

userKey 可以是用户的主邮箱或唯一用户 ID。

创建用户

bash
POST /google-workspace-admin/admin/directory/v1/users
Content-Type: application/json

{
primaryEmail: newuser@example.com,
name: {
givenName: Jane,
familyName: Smith
},
password: temporaryPassword123!,
changePasswordAtNextLogin: true,
orgUnitPath: /Engineering
}

更新用户

bash
PUT /google-workspace-admin/admin/directory/v1/users/{userKey}
Content-Type: application/json

{
name: {
givenName: Jane,
familyName: Smith-Johnson
},
suspended: false,
orgUnitPath: /Sales
}

部分更新用户

bash
PATCH /google-workspace-admin/admin/directory/v1/users/{userKey}
Content-Type: application/json

{
suspended: true
}

删除用户

bash
DELETE /google-workspace-admin/admin/directory/v1/users/{userKey}

将用户设为管理员

bash
POST /google-workspace-admin/admin/directory/v1/users/{userKey}/makeAdmin
Content-Type: application/json

{
status: true
}

群组

列出群组

bash
GET /google-workspace-admin/admin/directory/v1/groups?customer=my_customer

查询参数:

  • - customer - 客户 ID 或 my_customer(必需)
  • domain - 按域筛选
  • maxResults - 最大结果数(1-200)
  • userKey - 列出特定用户的群组

获取群组

bash
GET /google-workspace-admin/admin/directory/v1/groups/{groupKey}

groupKey 可以是群组的邮箱或唯一 ID。

创建群组

bash
POST /google-workspace-admin/admin/directory/v1/groups
Content-Type: application/json

{
email: engineering@example.com,
name: Engineering Team,
description: All engineering staff
}

更新群

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-workspace-admin-1776365669 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-workspace-admin-1776365669 技能

通过命令行安装

skillhub install google-workspace-admin-1776365669

下载

⬇ 下载 google-workspace-admin v1.0.4(免费)

文件大小: 5.17 KB | 发布时间: 2026-4-17 14:53

v1.0.4 最新 2026-4-17 14:53
- Added a homepage field (https://maton.ai) to the skill metadata.
- No changes to code or functionality.

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

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

p2p_official_large
返回顶部