|
通过托管OAuth认证访问Jobber API。管理现场服务业务的客户、工单、发票、报价、房产和团队成员。
bash
Jobber仅使用GraphQL API。所有请求均为向/graphql端点发送的POST请求,请求体为包含query字段的JSON格式。
https://gateway.maton.ai/jobber/graphql
网关将请求代理至api.getjobber.com/api/graphql,并自动注入您的OAuth令牌和API版本标头。
所有请求需要在Authorization标头中携带Maton API密钥:
Authorization: Bearer $MATONAPIKEY
网关会自动注入X-JOBBER-GRAPHQL-VERSION标头(当前为2025-04-16)。
环境变量: 将您的API密钥设置为MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在https://ctrl.maton.ai管理您的Jobber OAuth连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=jobber&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: jobber}).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: cc61da85-8bf7-4fbc-896b-4e4eb9a5aafd,
status: ACTIVE,
creation_time: 2026-02-07T09:29:19.946291Z,
lastupdatedtime: 2026-02-07T09:30:59.990084Z,
url: https://connect.maton.ai/?session_token=...,
app: jobber,
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
如果您有多个Jobber连接,请使用Maton-Connection标头指定要使用的连接:
bash
python <
query = {query: { account { id name } }}
req = urllib.request.Request(https://gateway.maton.ai/jobber/graphql, data=query.encode(), method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
req.add_header(Maton-Connection, cc61da85-8bf7-4fbc-896b-4e4eb9a5aafd)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最早)的活动连接。
bash
POST /jobber/graphql
Content-Type: application/json
{
query: { account { id name } }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: { clients(first: 20) { nodes { id name emails { primary address } phones { primary number } } pageInfo { hasNextPage endCursor } } }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: query($id: EncodedId!) { client(id: $id) { id name emails { primary address } phones { primary number } billingAddress { street city } } },
variables: { id: CLIENT_ID }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: mutation($input: ClientCreateInput!) { clientCreate(input: $input) { client { id name } userErrors { message path } } },
variables: {
input: {
firstName: John,
lastName: Doe,
email: john@example.com,
phone: 555-1234
}
}
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: mutation($id: EncodedId!, $input: ClientUpdateInput!) { clientUpdate(clientId: $id, input: $input) { client { id name } userErrors { message path } } },
variables: {
id: CLIENT_ID,
input: {
email: newemail@example.com
}
}
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: { jobs(first: 20) { nodes { id title jobNumber jobStatus client { name } } pageInfo { hasNextPage endCursor } } }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: query($id: EncodedId!) { job(id: $id) { id title jobNumber jobStatus instructions client { name } property { address { street city } } } },
variables: { id: JOB_ID }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: mutation($input: JobCreateInput!) { jobCreate(input: $input) { job { id jobNumber title } userErrors { message path } } },
variables: {
input: {
clientId: CLIENT_ID,
title: 草坪维护,
instructions: 每周草坪护理服务
}
}
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: { invoices(first: 20) { nodes { id invoiceNumber subject total invoiceStatus client { name } } pageInfo { hasNextPage endCursor } } }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: query($id: EncodedId!) { invoice(id: $id) { id invoiceNumber subject total amountDue invoiceStatus lineItems { nodes { name quantity unitPrice } } } },
variables: { id: INVOICE_ID }
}
bash
POST /jobber/graphql
Content-Type: application/json
{
query: mutation($input: InvoiceCreateInput!) {
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 jobber-1776345983 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 jobber-1776345983 技能
skillhub install jobber-1776345983
文件大小: 5.15 KB | 发布时间: 2026-4-17 15:10