Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 Teable MCP 现已上线。查看更新日志了解详情。
使用个人访问令牌和 JavaScript 调用自动化 API,创建工作流、添加触发器与操作,并在测试后启用。
const baseUrl = "https://app.teable.ai/api"; const token = process.env.TEABLE_TOKEN; const baseId = "bserxxxxxx"; const headers = { Authorization: `Bearer ${token}`, "Content-Type": "application/json", }; async function api(method, path, body) { const res = await fetch(`${baseUrl}${path}`, { method, headers, body: body ? JSON.stringify(body) : undefined, }); if (!res.ok) throw new Error(`${method} ${path} → ${res.status}`); return res.json(); }
// 1. 创建工作流 const wf = await api("POST", `/base/${baseId}/workflow`, { name: "Notify on shipment", description: "Send webhook when order status becomes Shipped", }); // 2. 添加触发器 const trigger = await api("POST", `/base/${baseId}/workflow/${wf.id}/trigger`, { type: "recordUpdated", config: { tableId: "tblOrders", watchFieldIds: ["fldStatus"] }, }); // 3. 测试触发器 await api("POST", `/base/${baseId}/workflow/${wf.id}/test/${trigger.id}`); // 4. 添加 HTTP 请求操作 const action = await api("POST", `/base/${baseId}/workflow/${wf.id}/action`, { type: "httpRequest", parentNodeId: trigger.id, }); // 5. 启用 await api("PUT", `/base/${baseId}/workflow/${wf.id}/active`, { method: "activate", });
此页面对您有帮助吗?