Danh mục thao tác

Gửi một phần dữ liệu nhập

contacts.import.chunkMCP:contacts_import_chunkBộ công cụ: Khách hàng

Send up to 500 rows of an import; returns created/updated/duplicate/invalid counts for the chunk.

Cần Idempotency-Key
Xếp hàng theo hạn mức của tài khoản
Quyền: Khách hàng

Gọi bằng REST v2

curl -X POST https://zl.builera.app/api/public/v2/ops/contacts.import.chunk \
  -H "Authorization: Bearer za_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"importId":"3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f","rows":[{"line":1,"name":"Nguyễn Văn A","phone":"+84901234567","custom":{}}]}'

Mỗi khoá/kết nối tối đa 300 lệnh đọc và 60 lệnh ghi mỗi phút. Gọi lại cùng Idempotency-Key trả đúng kết quả cũ, không làm lại.

Gọi qua MCP

{
  "method": "tools/call",
  "params": {
    "name": "contacts_import_chunk",
    "arguments": {
      "importId": "3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f",
      "rows": [
        {
          "line": 1,
          "name": "Nguyễn Văn A",
          "phone": "+84901234567",
          "custom": {}
        }
      ]
    }
  }
}

Thêm https://zl.builera.app/mcp vào ứng dụng AI rồi cho phép kết nối; AI chỉ thấy công cụ trong bộ bạn chọn.

Kết quả

HTTP 202
{ "status": "accepted", "operationId": "…", "jobId": "…", "data": { … } }

→ operations.wait (tối đa 20 giây) hoặc webhook để biết kết quả trên Zalo

Ví dụ đầu vào

{
  "importId": "3f2b8c1e-5d4a-4e6b-9c7d-1a2b3c4d5e6f",
  "rows": [
    {
      "line": 1,
      "name": "Nguyễn Văn A",
      "phone": "+84901234567",
      "custom": {}
    }
  ]
}

Thay mã (id) mẫu bằng mã thật lấy từ các thao tác liệt kê/tìm kiếm.

Lược đồ đầu vào (JSON Schema)

{
  "type": "object",
  "properties": {
    "importId": {
      "type": "string",
      "format": "uuid"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "line": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "custom": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            }
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "line",
          "name",
          "phone",
          "custom"
        ],
        "additionalProperties": false
      },
      "maxItems": 500
    }
  },
  "required": [
    "importId",
    "rows"
  ],
  "additionalProperties": false
}

Cùng bộ công cụ