pachca-tasks

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

pachca-tasks

pachca-tasks

Quick start

快速入门

Ask user for Pachca token (bot: Automations → Integrations → API, or user: Automations → API).
Run commands with
npx @pachca/cli
and
--token
flag:
npx @pachca/cli <command> --token $PACHCA_TOKEN
Or set
PACHCA_TOKEN
for multiple commands:
export PACHCA_TOKEN=<token>
npx @pachca/cli <command>
Help:
npx @pachca/cli --help
| Scenarios:
npx @pachca/cli guide
After 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
配合
--token
参数运行命令:
npx @pachca/cli <command> --token $PACHCA_TOKEN
或者为多条命令预先设置
PACHCA_TOKEN
环境变量:
export PACHCA_TOKEN=<token>
npx @pachca/cli <command>
帮助:
npx @pachca/cli --help
| 使用场景:
npx @pachca/cli guide
使用成功后,建议全局安装CLI:
npm install -g @pachca/cli && pachca auth login --token $PACHCA_TOKEN

Before you start

开始前须知

  1. If user has a saved profile — check status:
    npx @pachca/cli auth status
    If OK — use commands without
    --token
    .
  2. If profile is not configured — ask for token and use
    --token
    flag:
    npx @pachca/cli auth status --token $PACHCA_TOKEN
  3. If you don't know command parameters — run
    pachca <command> --help
    .
  1. 如果用户已保存配置文件——检查状态:
    npx @pachca/cli auth status
    如果状态正常,运行命令时无需携带
    --token
    参数。
  2. 如果未配置配置文件——索要token并使用
    --token
    参数:
    npx @pachca/cli auth status --token $PACHCA_TOKEN
  3. 如果你不清楚命令参数——运行
    pachca <command> --help

Step-by-step scenarios

分步使用场景

Create reminder

创建提醒

  1. Create task:
    bash
    pachca tasks create --kind=reminder --content="Позвонить клиенту" --due-at=<дата> --chat-id=<chat_id>
    chat_id
    to link to chat,
    custom_properties
    for additional fields
custom_properties[].value
type is always string. Additional fields: GET /custom_properties?entity_type=Task.
  1. 创建任务:
    bash
    pachca tasks create --kind=reminder --content="Позвонить клиенту" --due-at=<дата> --chat-id=<chat_id>
    chat_id
    用于关联到对应聊天,
    custom_properties
    用于添加额外字段
custom_properties[].value
的类型始终为字符串。额外字段可通过接口查询:GET /custom_properties?entity_type=Task。

Get list of upcoming tasks

获取即将到来的任务列表

  1. Get all tasks, filter by
    status
    on client side:
    bash
    pachca tasks list --all
    status
    :
    "undone"
    — not completed,
    "done"
    — completed. API-side filtering not supported
  1. 获取所有任务,在客户端按
    status
    过滤:
    bash
    pachca tasks list --all
    status
    取值:
    "undone"
    —— 未完成,
    "done"
    —— 已完成。暂不支持API端过滤

Get task by ID

按ID查询任务

  1. Get task info:
    bash
    pachca tasks get <ID>
  1. 获取任务信息:
    bash
    pachca tasks get <ID>

Mark task as completed

标记任务为已完成

  1. Update task status:
    bash
    pachca tasks update <ID> --status=done
  1. 更新任务状态:
    bash
    pachca tasks update <ID> --status=done

Update task (reschedule, change assignees)

更新任务(重新安排时间、变更负责人)

  1. Update task fields:
    bash
    pachca tasks update <ID> --due-at=<дата> --priority=2 --performer-ids='[186,187]'
    performer_ids
    replaces entire list.
    priority
    : 1 (normal), 2 (important), 3 (very important)
  1. 更新任务字段:
    bash
    pachca tasks update <ID> --due-at=<дата> --priority=2 --performer-ids='[186,187]'
    performer_ids
    会覆盖整个负责人列表。
    priority
    取值:1(普通),2(重要),3(非常重要)

Delete task

删除任务

  1. Delete task:
    bash
    pachca tasks delete <ID> --force
Deletion is irreversible. To just close — use PUT with
"status": "done"
.
  1. 删除任务:
    bash
    pachca tasks delete <ID> --force
删除操作不可撤销。如果仅需关闭任务——使用PUT方法将
"status"
设为
"done"
即可。

Create series of reminders

创建系列提醒

  1. Prepare list of dates (daily, weekly, etc.)
  2. For each date: create task:
    bash
    pachca tasks create --kind=reminder --content="Напоминание" --due-at=<дата>
  1. 准备日期列表(每日、每周等)
  2. 为每个日期创建对应任务:
    bash
    pachca tasks create --kind=reminder --content="Напоминание" --due-at=<дата>

Constraints and gotchas

限制与注意事项

  • Rate limit: ~50 req/sec. On 429 — wait and retry.
  • task.kind
    : allowed values —
    call
    (Позвонить контакту),
    meeting
    (Встреча),
    reminder
    (Простое напоминание),
    event
    (Событие),
    email
    (Написать письмо)
  • task.status
    : allowed values —
    done
    (Выполнено),
    undone
    (Активно)
  • limit
    : max 50
  • Pagination: cursor-based (limit + cursor)
  • 速率限制:约50次请求/秒。返回429错误时,请等待后重试。
  • task.kind
    允许的取值:
    call
    (联系客户)、
    meeting
    (会议)、
    reminder
    (普通提醒)、
    event
    (活动)、
    email
    (发送邮件)
  • task.status
    允许的取值:
    done
    (已完成)、
    undone
    (进行中)
  • limit
    最大值为50
  • 分页:基于游标实现(limit + cursor参数)

Endpoints

接口端点

MethodPathDescription
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/目录下的对应文件获取分步指引。