飛書日曆操作技能,用於讀取、建立、管理飛書日曆事件,支援個人和企業日曆操作。
✅ 獲取日曆列表
✅ 查詢日程事件(支援時間範圍、分頁)
✅ 建立日程(支援全天事件、定時事件)
✅ 更新日程(修改內容、設定重複規則)
✅ 刪除日程
✅ 設定提醒(支援多層級提醒)
✅ 支援每年/每月/每週重複
✅ 正確處理時區和全天事件
feishu-calendar 目錄到你的 OpenClaw skills 目錄訪問 飛書開放平臺 建立企業自建應用:
calendar:calendar:read - 讀取日曆calendar:calendar.event:read - 讀取日程calendar:calendar.event:create - 建立日程calendar:calendar.event:update - 更新日程calendar:calendar.event:delete - 刪除日程在「憑證與基礎資訊」中獲取:
- App ID: cli_xxxxxxxxxxxx
- App Secret: xxxxxxxxxxxxx
# 在 OpenClaw 環境或指令碼中設定
export FEISHU_APP_ID=cli_xxxxxxxxxxxx
export FEISHU_APP_SECRET=xxxxxxxxxxxxx
或者在程式碼中直接使用:
const config = {
appId: 'cli_xxxxxxxxxxxx',
appSecret: 'xxxxxxxxxxxxx'
};
const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
app_id: FEISHU_APP_ID,
app_secret: FEISHU_APP_SECRET
})
});
const { tenant_access_token } = await response.json();
const calendars = await fetch('https://open.feishu.cn/open-apis/calendar/v4/calendars?page_size=100', {
headers: { 'Authorization': `Bearer ${tenant_access_token}` }
});
// 時間戳格式(秒)
const startTime = Math.floor(new Date('2026-03-01T00:00:00+08:00').getTime() / 1000);
const endTime = Math.floor(new Date('2026-03-01T23:59:59+08:00').getTime() / 1000);
const events = await fetch(
`https://open.feishu.cn/open-apis/calendar/v4/calendars/${calendarId}/events?start_time=${startTime}&end_time=${endTime}`,
{ headers: { 'Authorization': `Bearer ${tenant_access_token}` } }
);
// 全天事件示例
const event = {
summary: '🎂 生日',
description: '祝生日快樂!',
start_time: { date: '2026-05-01', timezone: 'Asia/Shanghai' },
end_time: { date: '2026-05-01', timezone: 'Asia/Shanghai' },
is_all_day: true,
reminders: [
{ minutes: 7200 }, // 提前5天
{ minutes: 1440 } // 提前1天
],
recurrence: 'FREQ=YEARLY;INTERVAL=1' // 每年重複
};
const result = await fetch(`https://open.feishu.cn/open-apis/calendar/v4/calendars/${calendarId}/events`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${tenant_access_token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(event)
});
const update = {
recurrence: 'FREQ=YEARLY;INTERVAL=1'
};
await fetch(`https://open.feishu.cn/open-apis/calendar/v4/calendars/${calendarId}/events/${eventId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${tenant_access_token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(update)
});
| 功能 | 方法 | API 路徑 |
|---|---|---|
| 獲取 Token | POST | /auth/v3/tenant_access_token/internal |
| 獲取日曆列表 | GET | /calendar/v4/calendars |
| 獲取日程 | GET | /calendar/v4/calendars/{calendar_id}/events |
| 建立日程 | POST | /calendar/v4/calendars/{calendar_id}/events |
| 更新日程 | PATCH | /calendar/v4/calendars/{calendar_id}/events/{event_id} |
| 刪除日程 | DELETE | /calendar/v4/calendars/{calendar_id}/events/{event_id} |
全天事件:
{
"start_time": { "date": "2026-05-01", "timezone": "Asia/Shanghai" },
"end_time": { "date": "2026-05-01", "timezone": "Asia/Shanghai" },
"is_all_day": true
}
定時事件:
{
"start_time": { "timestamp": "1772366400", "timezone": "Asia/Shanghai" },
"end_time": { "timestamp": "1772373600", "timezone": "Asia/Shanghai" }
}
| 規則 | 說明 |
|---|---|
FREQ=DAILY;INTERVAL=1 |
每天重複 |
FREQ=WEEKLY;INTERVAL=1 |
每週重複 |
FREQ=MONTHLY;INTERVAL=1 |
每月重複 |
FREQ=YEARLY;INTERVAL=1 |
每年重複 |
{
"reminders": [
{ "minutes": 5 }, // 提前5分鐘
{ "minutes": 60 }, // 提前1小時
{ "minutes": 1440 }, // 提前1天
{ "minutes": 7200 } // 提前5天
]
}
Asia/Shanghai 時區date 欄位而非 timestamp,並設定 is_all_day: truestatus: cancelled 的事件,需要過濾has_more 和 page_token想要更強大的技能外掛,就來小蔥技能站7w4.net看看吧。
見 example.md 和 calendar-client.js 獲取完整示例。
| 問題 | 解決方案 |
|---|---|
| 99991661 - Missing access token | 檢查 token 是否正確傳遞 |
| 403 - 許可權不足 | 在飛書後臺開通相應許可權 |
| 事件查詢不到 | 擴大時間範圍,檢查是否已取消 |
| 建立失敗 | 檢查必填欄位(summary, start_time, end_time) |
License: MIT
Author: nuonuo
Repository: https://github.com/openclaw-community/feishu-calendar
這個飛書日曆 Skill 文件寫得非常詳細,看起來功能很全面,但實際可用的功能只有查詢日程,建立、修改、刪除等功能沒有真正實現。文件描述的功能比程式碼能做的多,容易讓人誤以為都能用,實際體驗會有落差。如果你只需要檢視日程可以用,但如果需要建立或管理日程,目前還做不到。