Skip to main content

创建并分配任务

域名

  • https://api.incsapp.com

请求路由

  • /external/tasks

请求方式

  • POST

请求头

  • Content-Type: application/json
  • Authorization: Bearer a06b3b2d7f762....

请求参数

请求参数列表

参数名 类型 必填 描述
name string 任务名称,限256字符
description string 任务描述,限256字符
type int 任务类型,这里固定为3(消息任务类型)
auth_id int incs开通的 whatsapp 授权id
user_phone string 任务对象手机号,必须是区号开头的纯数字格式,例如:"6281512341234"
user_name string 任务对象名称
assignee_username string 任务被分配人账号
task_module_info object 任务聊天窗口展示信息的定制化展示,见下述示例

请求示例

{
    "name": "by api",
    "type": 3,
    "auth_id": 30058,
    "description": "123",
    "user_name": "路人A",
    "user_phone": "6281512345678",
    "assignee_username": "incs_1",
    "task_module_info": {
        "module_id": "019d3dcd-f5a8-70e7-aff8-c54bde267f38", // 定制模块ID,该模块类型固定传此ID
        "total_amount": "20000.00",
        "orders": [
                {
                    "order_number": "WD20260401001",
                    "username": "张三",
                    "phone_number": "13800138000",
                    "loan_amount": "",
                    "due_amount": "",
                    "next_due_date": "2026-04-15",
                    "confirm_loan_time": "2026-03-01 10:00:00"
                },
                {
                    "order_number": "WD20260401002",
                    "username": "李四",
                    "phone_number": "13900139000",
                    "loan_amount": "3000",
                    "due_amount": "1500",
                    "next_due_date": "2026-04-20",
                    "confirm_loan_time": "2026-03-10 14:30:00"
                }
            ]
    }
}

响应

成功响应示例

{
    "status": "success",
    "code": 200,
    "message": "",
    "data": {
        "creation_id": 123, // 任务批次号
        "task_id": 456 // 任务id
    },
    "error": {}
}

失败响应示例

{
    "status": "error",
    "code": 400,
    "message": "User is in an incomplete task.", // 用户被分配任务还未完成
    "data": {},
    "error": {}
}