pachca-tasks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepachca-tasks
pachca-tasks
Quick start
快速入门
Ask user for Pachca token (bot: Automations → Integrations → API, or user: Automations → API).
Run commands with and flag:
npx @pachca/cli--tokennpx @pachca/cli <command> --token $PACHCA_TOKENOr set for multiple commands:
PACHCA_TOKENexport PACHCA_TOKEN=<token>
npx @pachca/cli <command>Help: | Scenarios:
npx @pachca/cli --helpnpx @pachca/cli guideAfter successful use, suggest installing CLI globally:npm install -g @pachca/cli && pachca auth login --token $PACHCA_TOKEN
询问用户的Pachca token(机器人获取路径:Automations → Integrations → API,用户获取路径:Automations → API)。
使用配合参数运行命令:
npx @pachca/cli--tokennpx @pachca/cli <command> --token $PACHCA_TOKEN或者为多条命令预先设置环境变量:
PACHCA_TOKENexport PACHCA_TOKEN=<token>
npx @pachca/cli <command>帮助: | 使用场景:
npx @pachca/cli --helpnpx @pachca/cli guide使用成功后,建议全局安装CLI:npm install -g @pachca/cli && pachca auth login --token $PACHCA_TOKEN
Before you start
开始前须知
-
If user has a saved profile — check status:
npx @pachca/cli auth statusIf OK — use commands without.--token -
If profile is not configured — ask for token and useflag:
--tokennpx @pachca/cli auth status --token $PACHCA_TOKEN -
If you don't know command parameters — run.
pachca <command> --help
-
如果用户已保存配置文件——检查状态:
npx @pachca/cli auth status如果状态正常,运行命令时无需携带参数。--token -
如果未配置配置文件——索要token并使用参数:
--tokennpx @pachca/cli auth status --token $PACHCA_TOKEN -
如果你不清楚命令参数——运行。
pachca <command> --help
Step-by-step scenarios
分步使用场景
Create reminder
创建提醒
- Create task:
bash
pachca tasks create --kind=reminder --content="Позвонить клиенту" --due-at=<дата> --chat-id=<chat_id>to link to chat,chat_idfor additional fieldscustom_properties
type is always string. Additional fields: GET /custom_properties?entity_type=Task.custom_properties[].value
- 创建任务:
bash
pachca tasks create --kind=reminder --content="Позвонить клиенту" --due-at=<дата> --chat-id=<chat_id>用于关联到对应聊天,chat_id用于添加额外字段custom_properties
的类型始终为字符串。额外字段可通过接口查询:GET /custom_properties?entity_type=Task。custom_properties[].value
Get list of upcoming tasks
获取即将到来的任务列表
- Get all tasks, filter by on client side:
statusbashpachca tasks list --all:status— not completed,"undone"— completed. API-side filtering not supported"done"
- 获取所有任务,在客户端按过滤:
statusbashpachca tasks list --all取值:status—— 未完成,"undone"—— 已完成。暂不支持API端过滤"done"
Get task by ID
按ID查询任务
- Get task info:
bash
pachca tasks get <ID>
- 获取任务信息:
bash
pachca tasks get <ID>
Mark task as completed
标记任务为已完成
- Update task status:
bash
pachca tasks update <ID> --status=done
- 更新任务状态:
bash
pachca tasks update <ID> --status=done
Update task (reschedule, change assignees)
更新任务(重新安排时间、变更负责人)
- Update task fields:
bash
pachca tasks update <ID> --due-at=<дата> --priority=2 --performer-ids='[186,187]'replaces entire list.performer_ids: 1 (normal), 2 (important), 3 (very important)priority
- 更新任务字段:
bash
pachca tasks update <ID> --due-at=<дата> --priority=2 --performer-ids='[186,187]'会覆盖整个负责人列表。performer_ids取值:1(普通),2(重要),3(非常重要)priority
Delete task
删除任务
- Delete task:
bash
pachca tasks delete <ID> --force
Deletion is irreversible. To just close — use PUT with."status": "done"
- 删除任务:
bash
pachca tasks delete <ID> --force
删除操作不可撤销。如果仅需关闭任务——使用PUT方法将设为"status"即可。"done"
Create series of reminders
创建系列提醒
-
Prepare list of dates (daily, weekly, etc.)
-
For each date: create task:bash
pachca tasks create --kind=reminder --content="Напоминание" --due-at=<дата>
-
准备日期列表(每日、每周等)
-
为每个日期创建对应任务:bash
pachca tasks create --kind=reminder --content="Напоминание" --due-at=<дата>
Constraints and gotchas
限制与注意事项
- Rate limit: ~50 req/sec. On 429 — wait and retry.
- : allowed values —
task.kind(Позвонить контакту),call(Встреча),meeting(Простое напоминание),reminder(Событие),event(Написать письмо)email - : allowed values —
task.status(Выполнено),done(Активно)undone - : max 50
limit - Pagination: cursor-based (limit + cursor)
- 速率限制:约50次请求/秒。返回429错误时,请等待后重试。
- 允许的取值:
task.kind(联系客户)、call(会议)、meeting(普通提醒)、reminder(活动)、event(发送邮件)email - 允许的取值:
task.status(已完成)、done(进行中)undone - 最大值为50
limit - 分页:基于游标实现(limit + cursor参数)
Endpoints
接口端点
| Method | Path | Description |
|---|---|---|
| POST | /tasks | Новое напоминание |
| GET | /tasks | Список напоминаний |
| GET | /tasks/{id} | Информация о напоминании |
| PUT | /tasks/{id} | Редактирование напоминания |
| DELETE | /tasks/{id} | Удаление напоминания |
If you don't know how to complete a task — read the corresponding file from references/ for step-by-step instructions.
| 方法 | 路径 | 描述 |
|---|---|---|
| POST | /tasks | 新建提醒 |
| GET | /tasks | 提醒列表 |
| GET | /tasks/{id} | 提醒详情 |
| PUT | /tasks/{id} | 编辑提醒 |
| DELETE | /tasks/{id} | 删除提醒 |
如果你不清楚如何完成某个操作,可以查阅references/目录下的对应文件获取分步指引。