wecomcli-manage-schedule

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

企业微信日程管理技能

WeCom Schedule Management Skill

wecom-cli
是企业微信提供的命令行程序,所有操作通过执行
wecom-cli
命令完成。
通过
wecom-cli schedule <接口名> '<json入参>'
与企业微信日程系统交互。
wecom-cli
is the command line program provided by WeCom, all operations are completed by executing the
wecom-cli
command.
Interact with the WeCom schedule system via
wecom-cli schedule <interface name> '<json parameter>'
.

注意事项

Notes

  • 日程列表查询仅支持当日前后 30 天,时间格式
    YYYY-MM-DD
    YYYY-MM-DD HH:MM:SS
  • 涉及参与者 userid 时,需先使用 wecomcli-lookup-contact 技能获取;存在同名时展示候选让用户选择(禁止暴露 userid)
  • 创建/修改/取消前,先确认目标日程和参与者信息
  • errcode != 0
    时展示错误信息;返回的
    start_time
    /
    end_time
    为 Unix 时间戳(秒),需转为可读格式
  • 注意时间格式转换:接口入参使用字符串格式(如
    YYYY-MM-DD HH:MM:SS
    ),但返回值多为 Unix 时间戳,使用时需进行格式转换

  • Schedule list query only supports 30 days before and after the current day, time format is
    YYYY-MM-DD
    or
    YYYY-MM-DD HH:MM:SS
  • When participant userid is involved, you need to use the wecomcli-lookup-contact skill to obtain it first; if there are duplicate names, show candidates for users to choose (exposure of userid is prohibited)
  • Before creating/modifying/canceling, confirm the target schedule and participant information first
  • When
    errcode != 0
    , display the error message; the returned
    start_time
    /
    end_time
    are Unix timestamps (in seconds), which need to be converted to a human-readable format
  • Pay attention to time format conversion: The interface input parameters use string format (such as
    YYYY-MM-DD HH:MM:SS
    ), but most return values are Unix timestamps, which require format conversion when used

接口列表

Interface List

get_schedule_list_by_range — 查询日程 ID 列表

get_schedule_list_by_range — Query Schedule ID List

bash
wecom-cli schedule get_schedule_list_by_range '{"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'
返回
schedule_id_list
数组。仅支持当日前后 30 天。
bash
wecom-cli schedule get_schedule_list_by_range '{"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'
Returns the
schedule_id_list
array. Only supports 30 days before and after the current day.

get_schedule_detail — 获取日程详情

get_schedule_detail — Get Schedule Details

bash
wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}'
支持 1~50 个 ID,返回日程标题、时间、地点、参与者等。参见 API 详情
bash
wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}'
Supports 1~50 IDs, returns schedule title, time, location, participants, etc. See API Details.

create_schedule — 创建日程

create_schedule — Create Schedule

bash
wecom-cli schedule create_schedule '{"schedule": {"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS", "summary": "日程标题", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}}}'
参见 API 详情 | reminders 字段
bash
wecom-cli schedule create_schedule '{"schedule": {"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS", "summary": "日程标题", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}}}'
See API Details | reminders Field.

update_schedule — 修改日程

update_schedule — Modify Schedule

只需传入需修改的字段,未传字段保持不变。
bash
wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "更新后的标题"}}'
参见 API 详情
Only pass in the fields that need to be modified, fields not passed will remain unchanged.
bash
wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "更新后的标题"}}'
See API Details.

cancel_schedule — 取消日程

cancel_schedule — Cancel Schedule

bash
wecom-cli schedule cancel_schedule '{"schedule_id": "SCHEDULE_ID"}'
bash
wecom-cli schedule cancel_schedule '{"schedule_id": "SCHEDULE_ID"}'

add_schedule_attendees / del_schedule_attendees — 管理参与人

add_schedule_attendees / del_schedule_attendees — Manage Participants

  • 添加参与人:
bash
wecom-cli schedule add_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
  • 移除参与人:
bash
wecom-cli schedule del_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
  • Add participants:
bash
wecom-cli schedule add_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
  • Remove participants:
bash
wecom-cli schedule del_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'

check_availablity — 查询闲忙

check_availablity — Query Busy/Free Status

bash
wecom-cli schedule check_availablity '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'
支持 1~10 个用户,返回各用户的忙碌时段列表。参见 API 详情

bash
wecom-cli schedule check_availablity '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'
Supports 1~10 users, returns the list of busy time slots for each user. See API Details.

典型工作流

Typical Workflows

查询日程

Query Schedules

经典 query 示例:
  • "我今天有哪些日程?"
  • "帮我看看这周三下午有没有会议"
  • "明天的日程安排是什么?"
  • "查一下最近有没有关于项目评审的日程"
  • "我下周一到周五的日程都有哪些?"
流程:
  1. 根据用户意图计算时间范围(如"今天"→当日 00:00:00 至 23:59:59,"这周"→本周一至周日)
  2. 调用
    get_schedule_list_by_range
    获取日程 ID 列表
  3. 调用
    get_schedule_detail
    批量获取详情,将 Unix 时间戳转为可读时间
  4. 若用户提到关键词(如"项目评审"),在
    summary
    中匹配筛选;未找到则逐步扩大范围至前后 30 天上限
  5. 展示日程列表时包含标题、时间、地点、参与者等关键信息,方便用户快速了解
Classic query examples:
  • "What schedules do I have today?"
  • "Check if I have any meetings on Wednesday afternoon"
  • "What is my schedule for tomorrow?"
  • "Check if there are any schedules related to project review recently"
  • "What schedules do I have from next Monday to Friday?"
Process:
  1. Calculate the time range according to the user's intent (e.g. "today" → 00:00:00 to 23:59:59 of the current day, "this week" → Monday to Sunday of the current week)
  2. Call
    get_schedule_list_by_range
    to get the schedule ID list
  3. Call
    get_schedule_detail
    to get details in batches, convert Unix timestamps to readable time
  4. If the user mentions keywords (such as "project review"), match and filter in
    summary
    ; if no results are found, gradually expand the range to the upper limit of 30 days before and after
  5. When displaying the schedule list, include key information such as title, time, location, participants, etc., for users to quickly understand

创建日程

Create Schedule

经典 query 示例:
  • "帮我创建一个明天下午 2 点到 3 点的会议,标题叫需求评审"
  • "安排一个周五全天的团建活动"
  • "创建日程:后天上午 10 点和张三、李四开产品方案讨论会,地点在 3 楼会议室"
  • "帮我建个日程,下周一 14:00-15:00,提前 15 分钟提醒"
  • "约一个明天上午的日程,邀请王伟参加"
流程:
  1. 解析用户意图,提取时间、标题、地点、参与人、提醒设置等信息
  2. 若涉及参与人,先通过 wecomcli-lookup-contact 查询 userid;存在同名时展示候选让用户选择
  3. 若用户未指定提醒,默认设置提前 15 分钟提醒(
    remind_before_event_secs: 900
  4. 若用户说"全天",设置
    is_whole_day: 1
    ,时间设为当天 00:00:00 至 23:59:59
  5. 向用户确认日程信息(标题、时间、地点、参与人等)后调用
    create_schedule
Classic query examples:
  • "Help me create a meeting from 2 pm to 3 pm tomorrow, titled Requirements Review"
  • "Arrange a full-day team building activity on Friday"
  • "Create a schedule: have a product plan discussion with Zhang San and Li Si at 10 am the day after tomorrow, location is the 3rd floor meeting room"
  • "Help me create a schedule, next Monday 14:00-15:00, remind 15 minutes in advance"
  • "Arrange a schedule for tomorrow morning, invite Wang Wei to participate"
Process:
  1. Analyze user intent, extract information such as time, title, location, participants, reminder settings, etc.
  2. If participants are involved, first query userid via wecomcli-lookup-contact; if there are duplicate names, show candidates for users to choose
  3. If the user does not specify a reminder, set a default 15-minute advance reminder (
    remind_before_event_secs: 900
    )
  4. If the user says "full day", set
    is_whole_day: 1
    , and set the time from 00:00:00 to 23:59:59 of that day
  5. Confirm the schedule information (title, time, location, participants, etc.) with the user before calling
    create_schedule

修改日程

Modify Schedule

经典 query 示例:
  • "把明天的需求评审改到后天下午 3 点"
  • "帮我修改下今天下午的会议标题,改成技术方案评审"
  • "我今天 14 点的日程地点改成线上腾讯会议"
  • "把周五的团建活动推迟一个小时"
  • "帮我给明天的周会加个描述:讨论 Q2 规划"
流程:
  1. 先通过查询工作流定位目标日程(根据用户提到的时间、标题等关键词匹配)
  2. 若匹配到多个日程,展示候选列表让用户确认
  3. 向用户确认要修改的字段和目标值
  4. 调用
    update_schedule
    ,只传入需修改的字段
Classic query examples:
  • "Change tomorrow's requirements review to 3 pm the day after tomorrow"
  • "Help me modify the title of this afternoon's meeting to Technical Solution Review"
  • "Change the location of my 14:00 schedule today to online Tencent Meeting"
  • "Postpone the team building activity on Friday by one hour"
  • "Help me add a description to tomorrow's weekly meeting: Discuss Q2 planning"
Process:
  1. First locate the target schedule through the query workflow (match according to keywords such as time and title mentioned by the user)
  2. If multiple schedules are matched, show the candidate list for the user to confirm
  3. Confirm the fields to be modified and target values with the user
  4. Call
    update_schedule
    , only pass in the fields that need to be modified

取消日程

Cancel Schedule

经典 query 示例:
  • "取消明天下午的需求评审"
  • "帮我把周五的团建日程删掉"
  • "我不想开今天 15 点的会了,帮我取消"
流程:
  1. 先通过查询工作流定位目标日程
  2. 向用户确认取消的日程信息(标题、时间等),避免误操作
  3. 确认后调用
    cancel_schedule
Classic query examples:
  • "Cancel tomorrow afternoon's requirements review"
  • "Help me delete the team building schedule on Friday"
  • "I don't want to attend the 15:00 meeting today, help me cancel it"
Process:
  1. First locate the target schedule through the query workflow
  2. Confirm the schedule information to be canceled (title, time, etc.) with the user to avoid misoperation
  3. Call
    cancel_schedule
    after confirmation

管理参与人

Manage Participants

经典 query 示例:
  • "把张三加到明天的需求评审会议里"
  • "帮我把李四从周五的日程里移除"
  • "明天下午的会议再邀请一下王伟和赵敏"
  • "把我后天那个技术分享的参与人里去掉刘强"
流程:
  1. 通过 wecomcli-lookup-contact 获取目标人员 userid;存在同名时展示候选让用户选择
  2. 通过查询工作流定位目标日程
  3. 调用
    add_schedule_attendees
    del_schedule_attendees
    完成添加/移除
Classic query examples:
  • "Add Zhang San to tomorrow's requirements review meeting"
  • "Help me remove Li Si from the Friday schedule"
  • "Invite Wang Wei and Zhao Min to the meeting tomorrow afternoon"
  • "Remove Liu Qiang from the participants of my technical sharing the day after tomorrow"
Process:
  1. Obtain the userid of the target person via wecomcli-lookup-contact; if there are duplicate names, show candidates for users to choose
  2. Locate the target schedule through the query workflow
  3. Call
    add_schedule_attendees
    or
    del_schedule_attendees
    to complete addition/removal

查询闲忙并安排会议

Query Busy/Free Status and Arrange Meetings

经典 query 示例:
  • "帮我看看张三和李四明天下午有没有空"
  • "查一下我和王伟这周的空闲时间,想约个会"
  • "我想跟产品组的小明、小红开个会,看看大家什么时候有空"
  • "找一个明天下午大家都有空的时段,安排一个 1 小时的会议"
流程:
  1. 通过 wecomcli-lookup-contact 获取相关人员 userid
  2. 调用
    check_availablity
    查询指定时间范围内各用户的忙碌时段
  3. 分析所有用户的忙碌时段,计算出共同空闲时段并推荐给用户
  4. 用户确认时段后,调用
    create_schedule
    创建会议并自动添加参与人
Classic query examples:
  • "Help me check if Zhang San and Li Si are free tomorrow afternoon"
  • "Check the free time of Wang Wei and I this week, I want to arrange a meeting"
  • "I want to have a meeting with Xiao Ming and Xiao Hong from the product team, check when everyone is free"
  • "Find a time slot when everyone is free tomorrow afternoon, arrange a 1-hour meeting"
Process:
  1. Obtain the userid of relevant personnel via wecomcli-lookup-contact
  2. Call
    check_availablity
    to query the busy time slots of each user within the specified time range
  3. Analyze the busy time slots of all users, calculate common free time slots and recommend them to users
  4. After the user confirms the time slot, call
    create_schedule
    to create the meeting and add participants automatically