Skip to content

Quản lý khách hàng

API quản lý thông tin khách hàng.

Thêm khách hàng

POST[URL]/api/crm/customer/create

Header

Tham sốGiá trị
AuthorizationBearer access_token

Body

Tham sốKiểuMô tả
vbot_idStringVBotID khách hàng
project_codeStringMã nhóm
customer_nameStringTên khách hàng
customer_noStringMã khách hàng
customer_addressStringĐịa chỉ khách hàng
customer_emailStringEmail khách hàng
customer_phonesList[String]Danh sách số điện thoại
customer_status_codeStringMã trạng thái
customer_type_codeStringMã loại
customer_group_nameStringTên nhóm

Ví dụ request

json
{
  "vbot_id": "sample string 1",
  "project_code": "sample string 2",
  "customer_name": "sample string 3",
  "customer_no": "sample string 4",
  "customer_address": "sample string 5",
  "customer_email": "sample string 6",
  "customer_phones": [
    "sample string 1",
    "sample string 2"
  ],
  "customer_status_code": "sample string 7",
  "customer_type_code": "sample string 8",
  "customer_group_name": "sample string 9",
  "fileds": [
    {
      "field_key": "sample string 1",
      "field_value": "sample string 2"
    },
    {
      "field_key": "sample string 1",
      "field_value": "sample string 2"
    }
  ]
}

Response

Tham sốKiểuMô tả
statusIntMã trạng thái (1: Thành công, 0: Thất bại)
errorIntMã lỗi
messageStringThông tin
dataStringDữ liệu trả về

Ví dụ response

json
{
  "status": 1,
  "error": 2,
  "message": "sample string 3",
  "data": "sample string 4"
}

Sửa khách hàng

POST[URL]/api/crm/customer/update

Header

Tham sốGiá trị
AuthorizationBearer access_token

Body

Tham sốKiểuMô tả
vbot_idStringVBotID khách hàng
project_codeStringMã nhóm
customer_nameStringTên khách hàng
customer_noStringMã khách hàng
customer_addressStringĐịa chỉ khách hàng
customer_emailStringEmail khách hàng
customer_phonesList[String]Danh sách số điện thoại
customer_status_codeStringMã trạng thái
customer_type_codeStringMã loại
customer_group_nameStringTên nhóm

Ví dụ request

json
{
  "vbot_id": "sample string 1",
  "project_code": "sample string 2",
  "customer_name": "sample string 3",
  "customer_no": "sample string 4",
  "customer_address": "sample string 5",
  "customer_email": "sample string 6",
  "customer_phones": [
    "sample string 1",
    "sample string 2"
  ],
  "customer_status_code": "sample string 7",
  "customer_type_code": "sample string 8",
  "customer_group_name": "sample string 9",
  "fileds": [
    {
      "field_key": "sample string 1",
      "field_value": "sample string 2"
    },
    {
      "field_key": "sample string 1",
      "field_value": "sample string 2"
    }
  ]
}

Response

Tham sốKiểuMô tả
statusIntMã trạng thái (1: Thành công, 0: Thất bại)
errorIntMã lỗi
messageStringThông tin
dataStringDữ liệu trả về

Ví dụ response

json
{
  "status": 1,
  "error": 2,
  "message": "sample string 3",
  "data": "sample string 4"
}

Xóa khách hàng

POST[URL]/api/crm/customer/delete

Header

Tham sốGiá trị
AuthorizationBearer access_token

Body

Tham sốKiểuMô tả
vbot_idStringVBotID khách hàng
project_codeStringMã nhóm
customer_noStringMã khách hàng

Ví dụ request

json
{
  "vbot_id": "sample string 1",
  "project_code": "sample string 2",
  "customer_no": "sample string 3"
}

Response

Tham sốKiểuMô tả
statusIntMã trạng thái (1: Thành công, 0: Thất bại)
errorIntMã lỗi
messageStringThông tin
dataBoolDữ liệu trả về

Ví dụ response

json
{
  "status": 1,
  "error": 2,
  "message": "sample string 3",
  "data": true
}

Xóa tất cả khách hàng

POST[URL]/api/crm/customer/deleteAll

Header

Tham sốGiá trị
AuthorizationBearer access_token

Response


Sửa mã khách hàng

POST[URL]/api/crm/customer/updateNo

Header

Tham sốGiá trị
AuthorizationBearer access_token

Body

Tham sốKiểuMô tả
vbot_idStringVBotID khách hàng
project_codeStringMã nhóm
customer_no_oldStringMã khách hàng cũ
customer_no_newStringMã khách hàng mới

Ví dụ request

json
{
  "vbot_id": "sample string 1",
  "project_code": "sample string 2",
  "customer_no_old": "sample string 3",
  "customer_no_new": "sample string 4"
}

Response

Tham sốKiểuMô tả
statusIntMã trạng thái (1: Thành công, 0: Thất bại)
errorIntMã lỗi
messageStringThông tin
dataStringDữ liệu trả về

Ví dụ response

json
{
  "status": 1,
  "error": 2,
  "message": "sample string 3",
  "data": "sample string 4"
}