|
通过托管OAuth认证访问Zoho Books API。支持对发票、联系人、账单、费用、销售订单、采购订单及其他会计数据进行完整的增删改查操作。
bash
https://gateway.maton.ai/zoho-books/books/v3/{endpoint}
该网关将请求代理至 www.zohoapis.com/books/v3,并自动注入您的OAuth令牌。
所有请求均需在Authorization头中包含Maton API密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的API密钥设置为 MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的Zoho Books OAuth连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=zoho-books&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-books}).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-books,
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 Books连接,可通过 Maton-Connection 头指定使用哪个连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-books/books/v3/contacts)
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
如果省略,网关将使用默认(最早创建的)活动连接。
Zoho Books将数据组织为模块。关键模块包括:
| 模块 | 端点 | 描述 |
|---|---|---|
| 联系人 | /contacts | 客户和供应商 |
| 发票 |
bash
GET /zoho-books/books/v3/contacts
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-books/books/v3/contacts)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
code: 0,
message: success,
contacts: [...],
page_context: {
page: 1,
per_page: 200,
hasmorepage: false,
sortcolumn: contactname,
sort_order: A
}
}
bash
GET /zoho-books/books/v3/contacts/{contact_id}
示例:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/zoho-books/books/v3/contacts/8527119000000099001)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
POST /zoho-books/books/v3/contacts
Content-Type: application/json
{
contact_name: Customer Name,
contact_type: customer
}
必填字段:
可选字段:
示例:
bash
python <
data = json.dumps({
contact_name: Acme Corporation,
contact_type: customer,
company_name: Acme Corp,
email: billing@acme.com,
phone: +1-555-1234
}).encode()
req = urllib.request.Request(https://gateway.maton.ai/zoho-books/books/v3/contacts, 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
响应:
json
{
code: 0,
message: The contact has been added.,
contact: {
contact_id: 8527119000000099001,
contact_name: Acme Corporation,
company_name: Acme Corp,
contact_type: customer,
...
}
}
bash
PUT /zoho-books/books/v3/contacts/{contact_id}
Content-Type: application/json
{
contact_name: Updated Name,
phone: +1-555-9999
}
示例:
bash
python <
data = json.dumps({
contact_name: Acme Corporation Updated,
phone: +1-555-9999
}).encode()
req = urllib.request.Request(https://gateway.maton.ai/zoho-books/books
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 zoho-books-1776208625 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 zoho-books-1776208625 技能
skillhub install zoho-books-1776208625
文件大小: 5.3 KB | 发布时间: 2026-4-15 10:48