产品指南
空间站
README
help
zh-CN
guide
integration
space
大数据多维表格
集成指南
自动化指南
AI应用与模板指南
私有化部署
开发者与扩展
最佳实践
marketing
功能参考
自动化触发器
自动化执行器
第三方集成
节点资源
数据表视图
数据表字段
仪表盘组件
智能任务
AI 向导
公式
空间站
更新日志
视频演示

使用 Bika.ai 开发者 OpenAPI

Bika.ai OpenAPI

Quick Start

Bika.ai's offical JavaScript use beautiful Object-Oriented Programming (OOP) style for your better use.

npm install bika.ai
<em># or</em>
yarn add bika.ai
pnpm add bika.ai

Examples to use Bika.ai offical Node.js SDK. (TypeScript example)

Get Spaces:

import { Bika } from 'bika.ai';

const bika = new Bika({apiKey: '__PASTE_YOUR_API_TOKEN_FROM_USER_SETTING__',<em>// default is:// baseURL: '</em><em>https://bika.ai/api/openapi/bika',</em>
})

<em>// firstly, fetch your spaces</em>const spaces = await bika.spaces.list();

<em>// now we use your first space as our operations</em>const space = spaces[0];

Find Node Resources (Database, Automation, Folder, Documents, etc.):

<em>// find node resources</em>const nodes = await space.nodes.list();

<em>// get one node resource</em>const node = nodes[0];
const database = await node.asDatabase();
const automation = await node.asAutomation();

Here’s an example of Create, Read, Update, and Delete (CRUD) operations for databases.

Given that Bika.ai's database can handle billions of rows, you can use Bika.ai databases as a fully functional production database, such as for an order table, user table, and more.

<em>// notice,  use </em><em>asXXX</em><em>,depends on your node resource type, includes database, automation, folder, and so-on</em>const database = await node.asDatabase();
const records = await database.records.list();
const views = await database.views.list();

CRUD Automations:

const automation = await node.asAutomation();
const triggers = await automation.triggers.list();
const actions = await automation.actions.list();

Here are examples of registering global-scope or space-scope outgoing webhooks (Server Events in Bika.ai).

You can utilize outgoing webhooks to send HTTP POST requests to your callback URL whenever a specific event takes place in Bika.ai.

Use cases include contact synchronization, data synchronization, custom notifications, plugins, and more.

<em>// Outoging Webhooks// Register a Bika.ai server event, and send a HTTP POST request to your callback URL</em>const outgoingWebhook = await space.outgoingWebhooks.create({eventType: 'ON_RECORD_CREATED',name: 'Test Outgoing Webhook',description: 'Test Outgoing Webhook Desc',callbackURL: 'https://your-custom-callback-url.com',
});
const outgoingWebhooks = await space.outgoingWebhooks.list();
const delteOutgoingWebhook = await space.outgoingWebhooks.delete({id: outgoingWebhook.id});

Here are examples of embedding Bika.ai's UI into your own application.

If you want to incorporate Bika.ai's robust UI for databases, documents, and more, you can utilize the embed link API.

Generate an embed link to obtain a URL, and then use an <iframe> in your application.

<em>// Embed Links// You can embed Bika.ai's UI into your own application</em>const embedLink = await space.embedLink.create({objectType: 'NODE_RESOURCE',objectId: '__NODE_RESOURCE_ID_YOU_WANT_TO_EMBED__',
})
const embedLinks = await space.embedLink.list();
const deleteEmbedLink = await space.embedLink.delete({id: embedLink.id});

<em>// ...</em>

Please checkout the Bika.ai API Reference for more API details.

Bika.ai Site-Admin OpenAPI

APITable compatible API SDK (beta)

Bika.ai support APITable compatible Open API interfaces.

That means you can use the APITable's SDK (JavaScript, Python, etc.) to interact with Bika.ai.

Quick start with APITable.js SDK for Bika.ai:

import { APITable } from "apitable";
<em>// Get token from your Bika.ai user setting</em>const apitable  = new APITable({ token: "_PASTE_YOUR_API_TOKEN_FROM_USER_SETTING", host: "https://bika.ai/api/openapi/apitable" }); 

<em>// Get a list of spaces for the current user</em>const spaceListResp = await apitable.spaces.list()

if (spaceListResp.success) {console.log(spaceListResp.data.spaces);
} else {console.error(spaceListResp);
}

More SDK usage please refer to:

bika cta

推荐阅读

推荐AI自动化模板

费用追踪
轻松管理个人消费,清晰记录每一笔支出,明确消费细节,简化日常与家庭费用管理,全面掌控财务状况.
Facebook帖子自动化
您可以使用此模板实现AI自动化Facebook帖子,从数据库中读取准备好的Facebook内容,并自动发布,以帮助您增加社交媒体的曝光率,并自动记录其公共URL以跟踪参与度。

Coming soon

飞书群消息定时提醒
利用 Bika 的强大功能,自动化您的飞书群通知和提醒流程,轻松实现文本、富文本、消息卡片等多样化自定义机器人消息类型的发送。这一创新解决方案不仅节省了您的宝贵时间,还提升了信息传达的效率和专业性,是您提升团队协作和沟通效率的理想选择。
HR Knowledge Base
HR Knowledge Base offers team members clear views of policies, processes, and benefits. With easy access to detailed information and links, it keeps HR data updated, promoting learning and regulatory compliance.
招聘模板
一个用于招聘流程的模板,可以收集候选人信息,并每天提醒候选人进度。

Coming soon

HR Team Project Tracker
Monitoring staff programs, spontaneous client requests, and strategic initiatives can be difficult in expanding teams. Centralize your projects and tasks to improve teamwork and control.