|
通过托管 OAuth 认证访问 Zoho Mail API。支持发送、接收、搜索和管理邮件,并提供完整的文件夹和标签管理功能。
bash
https://gateway.maton.ai/zoho-mail/{native-api-path}
将 {native-api-path} 替换为实际的 Zoho Mail API 端点路径。网关会将请求代理到 mail.zoho.com,并自动注入您的 OAuth 令牌。
所有请求都需要在 Authorization 头中携带 Maton API 密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的 API 密钥设置为 MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的 Zoho Mail OAuth 连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=zoho-mail&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: zoho-mail}).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 <
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: zoho-mail,
metadata: {}
}
}
在浏览器中打开返回的 url 以完成 OAuth 授权。
bash
python <
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
如果您有多个 Zoho Mail 连接,可以通过 Maton-Connection 头指定使用哪个连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-mail/api/accounts)
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
如果省略此头,网关将使用默认(最早创建的)活动连接。
检索已认证用户的所有邮件账户。
bash
GET /zoho-mail/api/accounts
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-mail/api/accounts)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
GET /zoho-mail/api/accounts/{accountId}
bash
GET /zoho-mail/api/accounts/{accountId}/folders
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/folders)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
status: {
code: 200,
description: success
},
data: [
{
folderId: 1367000000000008014,
folderName: 收件箱,
folderType: Inbox,
path: /Inbox,
imapAccess: true,
isArchived: 0,
URI: https://mail.zoho.com/api/accounts/1367000000000008002/folders/1367000000000008014
},
{
folderId: 1367000000000008016,
folderName: 草稿,
folderType: Drafts,
path: /Drafts,
imapAccess: true,
isArchived: 0
}
]
}
bash
POST /zoho-mail/api/accounts/{accountId}/folders
Content-Type: application/json
{
folderName: 我的自定义文件夹
}
bash
PUT /zoho-mail/api/accounts/{accountId}/folders/{folderId}
Content-Type: application/json
{
folderName: 重命名后的文件夹
}
bash
DELETE /zoho-mail/api/accounts/{accountId}/folders/{folderId}
bash
GET /zoho-mail/api/accounts/{accountId}/labels
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/labels)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
POST /zoho-mail/api/accounts/{accountId}/labels
Content-Type: application/json
{
labelName: 重要
}
bash
PUT /zoho-mail/api/accounts/{accountId}/labels/{labelId}
Content-Type: application/json
{
labelName: 更新后的标签
}
bash
DELETE /zoho-mail/api/accounts/{accountId}/labels/{labelId}
bash
GET /zoho-mail/api/accounts/{accountId}/messages/view?folderId={folderId}
查询参数:
| 参数 | 类型 | 描述 |
|---|---|---|
| folderId | long | 要列出邮件的文件夹 ID |
| limit |
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-mail/api/accounts/{accountId}/
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 zoho-mail-1776351451 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 zoho-mail-1776351451 技能
skillhub install zoho-mail-1776351451
文件大小: 5.95 KB | 发布时间: 2026-4-17 15:34