Webhook

Version 1.3

CareSoft cung cấp tính năng hỗ trợ các webhook để nhận thông tin cập nhật người dùng, tổ chức, phiếu ghi, các sự kiện realtime cho cuộc gọi vào, sự kiện kết thúc cuộc gọi trên smartdialer.

I. Chuẩn bị thông tin

Khách hàng gửi thông tin server webhook cho support hỗ trợ cấu hình bao gồm:

  • Callback Url (VD: http://sample.com/api/webHook)

  • SecretKey (option)

  • Các sự kiện hỗ trợ đăng ký: Người dùng:user Tổ chức: organization Phiếu ghi: ticket.voice, ticket.voice_out, ticket.ivr, ticket.voicemail, ticket.voice_campaign, ticket.email, ticket.email_out, ticket.web, ticket.api, ticket.sms_out, ticket.ticket_form, ticket.ticket_sharing, ticket.chat, ticket.facebook, ticket.inbox_facebook, ticket.inbox_facebook_out, ticket.facebook_rating, ticket.facebook_lead_ads, ticket.instagram, ticket.chat_instagram, ticket.inbox_zalo, ticket.inbox_zalo_out, ticket.inbox_zalo_zns, ticket.zalo_lead_form Lead: lead Deal: deal SmartDialer: smart_dialer Cuộc gọi vào: call_in

LƯU Ý: Event sẽ được trả về theo method POST. Request body dạng application/json. Header bao gồm X-Hub-Signature được mã hoá body theo chuẩn HmacSHA1 với secret key đã được cấu hình (Kết quả mã hoá ở dạng uppercase)

Link test mã hoá Signature: https://tools.onecompiler.com/hmac-sha1

VD:

Request Body: {"ticket_id":1} SecretKey: CS123

Signature: 420A69CE7D3C36559E9828D6361530DF30065D37

II. Các sự kiện webhook

1. Sự kiện trên người dùng

Sự kiện người dùng
// Sự kiện người dùng được tạo
{
  "object": "user",
  "action": "create",
  "user": {
       "id": 0,
       "username": "",
       "account_id": 0,
       "email": "",
       "email2": "",
       "phone_no": "",
       "phone_no2": "",
       "phone_no3": "",
       "role_id": 3,
       "facebook": "",
       "note": "",
       "gender": 0,
       "organization_id": 0,
       "detail": "",
       "avatar": "",
       "user_info1": "", //facebook name
       "user_info5": "", //address
       "user_info10": "", //instagram name
       "user_info12": "", //instagram link
       "user_info16": "", //zalo name
       "follower_id": 0,
       "updated_at": 0, //Time in millis
       "created_at": 0, //Time in millis
       "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       }
     ]
   }
}
Sự kiện người dùng
// Sự kiện cập nhật người dùng
{
  "object": "user",
  "action": "update",
  "user": {
       "id": 0,
       "username": "",
       "account_id": 0,
       "email": "",
       "email2": "",
       "phone_no": "",
       "phone_no2": "",
       "phone_no3": "",
       "role_id": 3,
       "facebook": "",
       "note": "",
       "gender": 0,
       "organization_id": 0,
       "detail": "",
       "avatar": "",
       "user_info1": "", //facebook name
       "user_info5": "", //address
       "user_info10": "", //instagram name
       "user_info12": "", //instagram link
       "user_info16": "", //zalo name
       "follower_id": 0,
       "updated_at": 0, //Time in millis
       "created_at": 0, //Time in millis
       "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       }
     ]
   }
}

2. Sự kiện trên tổ chức

Tổ chức
// Sự kiện tổ chức được tạo
{
  "object": "organization",
  "action": "create",
  "organization": {
    "organization_id": 0,
    "account_id": 0,
    "organization_name": "",
    "organization_domain": "",
    "details": "",
    "note": "",
    "created_at": 0, //Time in millis
    "updated_at": 0, //Time in millis,
    "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       }
     ]
  }
}
Tổ chức
// Sự kiện tổ chức được cập nhật
{
  "object": "organization",
  "action": "update",
  "organization": {
    "organization_id": 0,
    "account_id": 0,
    "organization_name": "",
    "organization_domain": "",
    "details": "",
    "note": "",
    "created_at": 0, //Time in millis
    "updated_at": 0, //Time in millis,
    "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       }
     ]
  }
}

3. Sự kiện trên phiếu ghi

Khi có sự kiện xảy ra trên phiếu ghi, nguồn của sự kiện này sẽ phân biệt bằng giá trị của thuộc tính source trong ticket_comment.

Ví dụ để phân biệt sự kiện là cuộc gọi vào hay cuộc gọi ra:

Các giá trị source cuộc gọi vào: Voice, IVR, ZCC In, MissCall, VoiceMail, Voicemail

Các giá trị source cho gọi ra: Voice Out, ZCC Out, Voice Campaign

Xem đầy đủ danh sách các giá trị của nguồn tại Danh sách nguồn.

Phiếu ghi
// Phiếu ghi được tạo
{
 "object": "ticket",
 "action": "create",
 "ticket": {
   "ticket_id": 0,
   "ticket_no": 0,
   "assignee_id": 0,
   "service_id": 0,
   "ticket_priority": "normal",
   "ticket_source": "web",
   "ticket_source_end_status": 0,
   "ticket_status": "open",
   "ticket_subject": "",
   "created_at": 0, //Time in millis
   "updated_at": 0, //Time in millis,
   "last_change_status_at": 0, //Time in millis
   "campaignId": 0,
   "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       }
     ]
   "ticket_comment": 
     {
       "ticket_id": 0,
       "comment": "",
       "addition_details": "",
       "commentator_id": 0,
       "source": "web",
       "is_public": 0,
       "type": 0,
       "created_at": 0, //Time in millis
       "updated_at": 0, //Time in millis,
     }
  }
}
Phiếu ghi
// Phiếu ghi được cập nhật
{
 "object": "ticket",
 "action": "update",
 "ticket": {
   "ticket_id": 0,
   "ticket_no": 0,
   "assignee_id": 0,
   "service_id": 0,
   "ticket_priority": "normal",
   "ticket_source": "web",
   "ticket_source_end_status": 0,
   "ticket_status": "open",
   "ticket_subject": "",
   "created_at": 0, //Time in millis
   "updated_at": 0, //Time in millis,
   "last_change_status_at": 0, //Time in millis
   "campaignId": 0,
   "addition_fields":
     [
       {
         "id": 0, //id trường động
         "field": "addition_field1", //Mã trường động
         "label": "", //Tên trường động
         "type": 0|1|2|3|4|6|7, //String|Number|DateTime|SingleSelect|MultiSelect|TextArea|Stage
         "value": "", //value in string
         "value_id": 0 //value id
       },
       {
       }
     ]
   "ticket_comment": 
     {
       "ticket_id": 0,
       "comment": "",
       "addition_details": "",
       "commentator_id": 0,
       "source": "web",
       "is_public": 0,
       "type": 0,
       "created_at": 0, //Time in millis
       "updated_at": 0, //Time in millis,
     }
  },
  "call_info":  //Thông tin cuộc gọi nếu có
  {    
    "call_id": "",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "status_code": "200",
    "start_time": 000 //Time in millis
    "answer_time": 000 //Time in millis
    "end_time": 000 //Time in millis
  }
}
// Phiếu bị bị xoá
{
 "object": "ticket",
 "action": "delete",
 "ticket": {
    "ticket_id": 0
  }
}
Phiếu ghi
// Phiếu ghi bị ghép
{
 "object": "ticket",
 "action": "merge",
  "mergeOption":
  {
    "primaryTicket": 0,
    "secondaryTickets": 1,
    "primaryComment": "",
    "primaryIsPublic": 0,
    "secondaryComment": "",
    "secondaryIsPublic": 0,
    "addCC": 0,
    "addFollow": 0,
    "copyComments": 0,
  }
}

4. Sự kiện trên SmartDialer

SmartDialer
// Cuộc gọi kết thúc từ chiến dịch auto call
{
  "object": "smart_dialer",
  "action": "ad_end_call",
  "call_info": {
    "call_id": "",
    "line": "",
    "phone_number": "",
    "call_attempt_index": 0,
    "max_attempt": 1,
    "campaign_id": 0,
    "customer_id": 0,
    "customer_name": "",
    "campaign_data_id": 0,
    "start_time": 0, //Time in millis
    "connect_time": 0, //Time in millis
    "end_time": 0, //Time in millis
    "ring_customer_duration": 0, //seconds
    "call_duration": 0, //seconds
    "status_code": "",
    "customer_input_dtmf": "", //dữ liệu bấm phím ivr nếu có
  }
}
SmartDialer
//Cuộc gọi kết thúc từ chiến dịch predictive call
{
  "object": "smart_dialer",
  "action": "pd_end_call",
  "call_info": {
    "call_id": "",
    "line": "",
    "phone_number": "",
    "call_attempt_index": 0,
    "max_attempt": 1,
    "campaign_id": 0,
    "customer_id": 0,
    "customer_name": "",
    "campaign_data_id": 0,
    "start_time": 0, //Time in millis
    "connect_time": 0, //Time in millis
    "end_time": 0, //Time in millis
    "ring_customer_duration": 0, //seconds
    "call_duration": 0, //seconds
    "agent_user_id": 0,
    "agent_id": 0, 
    "agent_ring_time": 0, //Time in millis
    "agent_connect_time": 0, //Time in millis
    "ring_agent_duration": 0, //seconds
    "status_code": ""
  }
}

5. Sự kiện cập nhật trạng thái cuộc gọi vào

Đăng ký nhận sự kiện này nếu bạn muốn tích hợp chi tiết tất cả các sự kiện xảy ra trong quá trình gọi vào từ lúc cuộc gọi bắt đầu, tới lúc đổ chuông chuyên viên và kết thúc cuộc gọi.

Cuộc gọi vào
//1. Sự kiện bắt đầu cuộc gọi
{
  "object": "call_in",
  "action": "call_in_start",
  "call_info": 
  {
    "event_name": "call_in_start",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//2. Sự kiện đổ chuông tới Agent
{
  "object": "call_in",
  "action": "call_in_agent_ring",
  "call_info": 
  {
    "event_name": "call_in_agent_ring",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//3. Sự kiện trượt qua Agent
{
  "object": "call_in",
  "action": "call_in_agent_miss",
  "call_info": 
  {
    "event_name": "call_in_agent_miss",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//4. Sự kiện Agent bắt máy
{
  "object": "call_in",
  "action": "call_in_agent_answer",
  "call_info": 
  {
    "event_name": "call_in_agent_answer",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//5. Sự kiện Agent kết thúc cuộc gọi
{
  "object": "call_in",
  "action": "call_in_agent_end",
  "call_info": 
  {
    "event_name": "call_in_agent_end",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//6. Sự kiện Khách hàng kết thúc cuộc gọi
{
  "object": "call_in",
  "action": "call_in_customer_end",
  "call_info": 
  {
    "event_name": "call_in_customer_end",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
  }
}
Cuộc gọi vào
//7. Sự kiện cuộc gọi kết thúc
{
  "object": "call_in",
  "action": "call_in_end",
  "call_info": 
  {
    "event_name": "call_in_end",
    "call_id": "",
    "account_id": 0,
    "direction": "inbound",
    "caller": "", //SĐT khách hàng
    "called": "", //Đầu số
    "agent_id": "",
    "event_time": 000 //Time in millis
    "call_start_time": 0, //Time in millis
    "call_answer_time": 0, //Time in millis
    "call_end_time": 0, //Time in millis
    "call_end_time": 0, //Time in millis
    "call_duration": 0, //Time in seconds
    "status": "answered|miss", //Trạng thái gặp agent hay không
    "answer_duration": 0, //Time in seconds - status answered
    "record_url": "" //Link file ghi âm - status answered
  }
}

6. Sự kiện trên Lead

6.1. Lead được tạo

// lead created event payload
{
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "create",
  "lead": {
    "lead_id": 414856712,
    "name": "Lead name",
    "last_change_status_at": 1713150362091,
    "lead_status_id": 525,
    "estimated_closed_date": 1713200399000,
    "addition_fields": [
      {
        "field": "addition_field6",
        "id": 4373,
        "label": "Reasons Unqualified",
        "value_id": "",
        "type": 3,
        "value": ""
      }
    ],
    "source": "Web",
    "created_at": 1713150362013,
    "updated_at": 1713150362091,
    "activity": {
      "updated_at": 1713150362124,
      "commentator_id": 63216138,
      "is_public": 0,
      "created_at": 1713150362124,
      "comment": "first comment",
      "ticket_id": 414856712,
      "type": 0
    },
    "requester_id": 63216138,
    "assignee_id": 1
  },
  "object": "lead"
}

6.2. Lead được convert từ đối tượng khác

// Lead converted from Ticket payload
{
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "convert",
  "updated_properties": [
    {
      "field": "lead_status_id",
      "value": 525
    }
  ],
  "convert_from_object": "ticket",
  "lead": {
    "lead_id": 414856714,
    "name": "Lead name sample",
    "last_change_status_at": 1713153062000,
    "lead_status_id": 525,    
    "addition_fields": [
      {
        "field": "addition_field9",
        "id": 4376,
        "label": "Custom field abc",
        "type": 2,
        "value": ""
      }
    ],
    "source": "Web",
    "created_at": 1713153062000,
    "updated_at": 1713153076734,
    "activity": {
      "updated_at": 1713153076732,
      "commentator_id": 1,
      "is_public": 0,
      "created_at": 1713153076732,
      "comment": "Chuyển đổi dữ liệu thành dạng Lead",
      "source": "Web",
      "lead_id": 414856714,
      "type": 1
    },
    "requester_id": 1,
    "assignee_id": 1
  },
  "object": "lead"
}

6.3. Lead được cập nhật

// lead updated event payload
{
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "update",
  "updated_properties": [
    {
      "field": "addition_field19",
      "value": "value sample"
    }
  ],
  "lead": {
    "lead_id": 414856712,
    "name": "Lead name",
    "last_change_status_at": 1713150362000,
    "lead_status_id": 525,
    "estimated_closed_date": 1713200399000,    
    "addition_fields": [
      {
        "field": "addition_field6",
        "id": 4373,
        "label": "Reasons  Unqualified",
        "value_id": "",
        "type": 3,
        "value": ""
      },
      {
        "field": "addition_field19",
        "id": 4406,
        "label": "Kí tự nhỏ hơn 20",
        "type": 0,
        "value": "value sample"
      }
    ],
    "source": "Web",
    "created_at": 1713150362000,
    "updated_at": 1713152406418,
    "activity": {
      "updated_at": 1713152406442,
      "commentator_id": 1,
      "is_public": 0,
      "created_at": 1713152406442,
      "comment": "update",
      "ticket_id": 414856712,
      "type": 1
    },
    "requester_id": 63216138,
    "assignee_id": 1
  },
  "object": "lead"
}

Sự kiện Lead chuyển đổi thành Deal xem tại Sự kiện 7.2. Deal được convert từ đối tượng khác

7. Sự kiện trên Deal

7.1. Deal được tạo mới

// Deal created event payload
{
  "deal": {
    "deal_id": 414856715,
    "name": "New sample deal",
    "last_change_status_at": 1713153881216,   
    "probability": 5,
    "addition_fields": [
      {
        "field": "addition_field1",
        "id": 4380,
        "label": "Sample custom field",
        "value_id": "",
        "type": 7,
        "value": ""
      }
    ],
    "source": "Web",
    "created_at": 1713153881152,
    "updated_at": 1713153881216,
    "activity": {
      "updated_at": 1713153881253,
      "commentator_id": 1,
      "is_public": 0,
      "created_at": 1713153881253,
      "comment": "first comment",
      "deal_id": 414856715,
      "type": 0
    },
    "pipeline_id": 56,    
    "value": 0,
    "last_change_stage_at": 1713153881216,
    "requester_id": 1,
    "assignee_id": 1,
    "pipeline_stage_id": 376
  },
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "create",
  "object": "deal"
}

7.2. Deal được chuyển đổi từ đối tượng khác

// Deal converted from object (Lead) event payload
{
  "deal": {
    "deal_id": 414856712,
    "name": "Deal name",
    "last_change_status_at": 1713150362000,
    "estimated_closed_date": 1713200399000,    
    "closed_type": 1,
    "addition_fields": [
      {
        "field": "addition_field1",
        "id": 4380,
        "label": "sample custom field",
        "value_id": "",
        "type": 7,
        "value": ""
      }
    ],
    "source": "Web",
    "created_at": 1713150362000,
    "updated_at": 1713154107391,
    "activity": {
      "updated_at": 1713154107417,
      "commentator_id": 1,
      "is_public": 0,
      "created_at": 1713154107417,
      "comment": "Chuyển đổi Lead thành Deal",
      "deal_id": 414856712,
      "type": 1
    },
    "pipeline_id": 56,
    "value": 0,
    "last_change_stage_at": 1713154107391,
    "requester_id": 63216138,
    "assignee_id": 1,
    "pipeline_stage_id": 376
  },
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "convert",
  "convert_from_object": "lead"
  "updated_properties": [
    {
      "field": "value",
      "value": 0
    },
    {
      "field": "converted_at",
      "value": 1713154107391
    },
    {
      "field": "converted_by",
      "value": 1
    },
    {
      "field": "converted_type",
      "value": 1
    }
  ],
  "agent_submit": {
    "from_object": "lead"
  },
  "object": "deal"
}

7.3. Deal được cập nhật

// Deal updated event payload
{
  "deal": {
    "deal_id": 414856712,
    "name": "Deal name",
    "last_change_status_at": 1713150362000,
    "estimated_closed_date": 1713200399000,    
    "closed_type": 1,
    "addition_fields": [
      {
        "field": "addition_field1",
        "id": 4380,
        "label": "Sample custom field",
        "value_id": "",
        "type": 7,
        "value": ""
      },
      {
        "field": "addition_field22",
        "id": 6999,
        "label": "Custom field single select",
        "value_id": "92942",
        "type": 3,
        "value": "123a"
      },
      {
        "field": "addition_field16",
        "id": 4385,
        "label": "invoice_field",
        "type": 0,
        "value": "sample text custom field"
      }
    ],
    "source": "Web",
    "created_at": 1713150362000,
    "updated_at": 1713154405236,
    "activity": {
      "updated_at": 1713154405251,
      "commentator_id": 1,
      "is_public": 0,
      "created_at": 1713154405251,
      "comment": "update deal value",
      "ticket_id": 414856712,
      "type": 1
    },
    "pipeline_id": 56,
    "value": 1000000,
    "last_change_stage_at": 1713154107000,
    "requester_id": 63216138,
    "assignee_id": 1,
    "pipeline_stage_id": 376
  },
  "account_id": 1,
  "activity_source": "AGENT",
  "action": "update",
  "updated_properties": [
    {
      "field": "value",
      "value": 1000000
    },
    {
      "field": "addition_field16",
      "value": "sample text custom field"
    },
    {
      "field": "addition_field22",
      "value": "92942"
    }
  ],
  "object": "deal"
}

III. Mô tả tham số

1. Tham số phân loại sự kiện

2. Tham số phiếu ghi ticket

3. Tham số comment phiếu ghi ticket.ticket_comment

4. Tham số cuộc gọi call_info

Đối với cuộc gọi thông thường object cuộc gọi sẽ là ticket

5. Tham số người dùng user

6. Tham số tổ chức organization

7. Tham số cuộc gọi SmartDialer call_info

Đối với cuộc gọi smart dialer. Khi object trả về "smart_dialer" thì dữ liệu đối tượng call_info theo thông tin mô tả dưới đây.

IV. Mẫu sự kiện

1. Ticket Cuộc gọi vào nhỡ

{
   "account_id": 9999,
   "ticket": {
       "ticket_status": "new",
       "ticket_subject": "Cuộc gọi nhỡ từ 0889999999",
       "ticket_priority": "Normal",
       "ticket_source": "Voice",
       "created_at": 1633489861000,
       "ticket_id": 9999,
       "updated_at": 1633489912859,
       "ticket_comment": {
           "updated_at": 1633489912859,
           "commentator_id": 666,
           "is_public": 1,
           "created_at": 1633489861017,
           "comment": "<b>Cuộc gọi vào<\/b><br/>ID cuộc gọi: 20211006101009-HRFZNHMV-9999<br/>Số điện thoại gọi tới: 0889999999<br/>Đầu số gọi: 1019002267<br/>Dịch vụ: Gọi vào 1999999- Gặp NV hỗ trợ<br/>Thời gian bắt đầu: 2021-10-06 10:11:00<br/>Thời gian kết thúc: 2021-10-06 10:11:52<br/>Thời gian gọi: 00:00:51<br/>Cuộc gọi bị nhỡ",
           "source": "MissCall",
           "ticket_id": 9999,
           "type": 0
       },
       "ticket_no": 888,
       "ticket_source_end_status": 1,
       "service_id": 9999,
       "requester_id": 999,
       "assignee_id": -1
   },
   "action": "update",
   "call_info": {
       "answer_time": 0,
       "start_time": 1633489860000,
       "caller": "0889999999",
       "status_code": 0,
       "called": "1999999",
       "end_time": 1633489912861,
       "call_id": "20211006101009-HRFZNHMV-9999"
   },
   "object": "ticket"
}

2. Cuộc gọi vào IVR (Không chuyển ACD):

{
   "account_id": 9999,
   "ticket": {
       "ticket_status": "new",
       "updated_at": 1633488353675,
       "ticket_comment": {
           "updated_at": "Wed Oct 06 09:45:53 ICT 2021",
           "commentator_id": 123391762,
           "created_at": "Wed Oct 06 09:45:53 ICT 2021",
           "comment": "Cuộc gọi vào IVR <\/br>Số gọi đến: 0889999999<\/br>Đầu số: 19009999<\/br>Id cuộc gọi: 20211006094514-HRFZNHMV-9999<\/br>Thời gian bắt đầu: 2021-10-06 09:45:14<\/br>Thời gian kết thúc: 2021-10-06 09:45:53<\/br>NodeName: Gọi vào<\/br>Dtmf: -2-#",
           "source": "IVR",
           "ticket_id": 259312810,
           "type": 0
       },
       "ticket_subject": "Cuộc gọi vào IVR từ : 0889999999",
       "ticket_no": 45028,
       "service_id": 0,
       "ticket_priority": "Normal",
       "ticket_source": "IVR",
       "created_at": 1633488353675,
       "ticket_id": 259312810,
       "requester_id": 123391762
   },
   "action": "update",
   "call_info": {
       "start_time": 1633488314064,
       "caller": "0889999999",
       "called": "19009999",
       "dtmf": "-2-#",
       "end_time": 1633488353669,
       "node_name": "Gọi vào",
       "call_id": "20211006094514-HRFZNHMV-9999"
   },
   "object": "ticket"
}

3. Ticket Cuộc gọi ra

{   
   "account_id": 9999,
   "ticket": {
       "ticket_status": "solved",
       "ticket_subject": "Cuộc gọi ra gặp khách hàng tới 0889999999",
       "ticket_priority": "Normal",
       "ticket_source": "Voice Out",
       "created_at": 1633489494000,
       "ticket_id": 9999,
       "updated_at": 1633489530561,
       "ticket_comment": {
           "updated_at": 1633489530561,
           "commentator_id": 4444,
           "is_public": 1,
           "created_at": 1633489494488,
           "comment": "<b>Cuộc gọi ra<\/b><br/>Người gọi ra:  (admin@caresoft.vn)<br/>ID cuộc gọi: 20211006100454-EXGPSDDQ-9999<br/>Số điện thoại gọi tới: 0889999999<br/>Đầu số gọi ra: 1999999<br/>Thời gian bắt đầu: 2021-10-06 10:04:54<br/>Khách hàng trả lời cuộc gọi<br/>Thời gian trả lời: 2021-10-06 10:05:01<br/>Agent kết thúc cuộc gọi<br/>Thời gian kết thúc: 2021-10-06 10:05:30<br/>Thời lượng cuộc gọi: 00:00:29",
           "source": "Voice Out",
           "ticket_id": 9999,
           "type": 0
       },
       "ticket_no": 9999,
       "ticket_source_end_status": 0,
       "service_id": 8888,
       "requester_id": 113245755,
       "assignee_id": 3333
   },
   "action": "update",
   "call_info": {
       "answer_time": 1633489501551,
       "start_time": 1633489494000,
       "caller": "0889999999",
       "status_code": 200,
       "called": "1999999",
       "end_time": 1633489530561,
       "call_id": "20211006100454-EXGPSDDQ-9999"
   },
   "object": "ticket"
}

4. Tạo mới người dùng

{
   "account_id": 1,
   "action": "create",
   "user": {
       "phone_no": "0889999999",
       "account_id": 1,
       "updated_at": 1633511901679,
       "role_id": 3,
       "created_at": 1633511901679,
       "id": 63203837,
       "username": "Tan Le"
   },
   "object": "user"
}

5. Cập nhật người dùng

{
   "account_id": 1,
   "action": "update",
   "user": {
       "updated_at": 1633510473715,
       "changes": [
           {
               "field": "addition_field13",
               "value": "x123x"
           }
       ],
       "id": 63203835,
       "username": "Tan9999"
   },
   "object": "user"
}

6. Tạo mới tổ chức

{
   "account_id": 1,
   "organization": {
       "note": "",
       "account_id": 1,
       "updated_at": 1633590006206,
       "organization_domain": "dev.caresoft.vn",
       "organization_id": 126,
       "created_at": 1633590006206,
       "details": "",
       "organization_name": "Công ty bột giặt"
   },
   "action": "create",
   "object": "organization"
}

7. Cập nhật tổ chức

{
   "account_id": 1,
   "organization": {
       "updated_at": 1633589854414,
       "organization_id": 10,
       "changes": [
           {
               "field": "organization_name",
               "value": "Công ty cổ phần CareSoft"
           }
       ]
   },
   "action": "update",
   "object": "organization"
}

8. Tạo mới phiếu ghi

{
  "account_id": 171,
  "ticket": {
    "ticket_comment": {
      "updated_at": 1684384652149,
      "commentator_id": 63215882,
      "is_public": 0,
      "created_at": 1684384652149,
      "comment": "Sample Internal note",
      "ticket_id": 322677,
      "type": 0
    },
    "ticket_no": 5,
    "ticket_status": "new",
    "last_change_status_at": 1684384652133,
    "addition_fields": [
      {
        "field": "addition_field1",
        "id": 6956,
        "label": "Abc",
        "value": "b",
         "value_id":"1242",
        "type":3
      },
      {
        "field": "addition_field2",
        "id": 6957,
        "label": "Phân loại phiếu ghi",
        "value": "Chưa phân loại",
        "value_id":"1222",
        "type":3
        
      },
      {
        "field": "addition_field3",
        "id": 6958,
        "label": "Ghi chú",
        "value": "",
        "type":"0"
      }
    ],
    "requester_id": 63215882,
    "ticket_subject": "Sample Ticket",
    "ticket_priority": "Normal",
    "ticket_source": "Web",
    "created_at": 1684384615500,
    "updated_at": 1684384652133,
    "ticket_id": 322677
  },
  "action": "create",
  "object": "ticket"
}

9. Cập nhật phiếu ghi

{
  "account_id": 171,
  "ticket": { 
    "ticket_comment": {
      "updated_at": 1684385486529,
      "commentator_id": 63215882,
      "is_public": 0,
      "created_at": 1684385486529,
      "comment": "UpdateTicket",
      "ticket_id": 322677,
      "type": 1
    },
    "addition_field42": "",
    "ticket_no": 5,
    "ticket_status": "new",
    "last_change_status_at": 1684384652000,
    "addition_fields": [
      {
        "field": "addition_field1",
        "id": 6956,
        "label": "Abc",
        "value": "b",
         "value_id":"1242",
        "type":3
      },
      {
        "field": "addition_field2",
        "id": 6957,
        "label": "Phân loại phiếu ghi",
        "value": "Chưa phân loại",
        "value_id":"1222",
        "type":3
        
      },
      {
        "field": "addition_field3",
        "id": 6958,
        "label": "Ghi chú",
        "value": "",
        "type":"0"
      }
    ],
    "requester_id": 63215882,
    "ticket_subject": "Sample Ticket",
    "ticket_priority": "Normal",
    "ticket_source": "Web",
    "created_at": 1684384616000,
    "updated_at": 1684385486519,
    "assignee_id": 63215882,
    "ticket_id": 322677
  },
  "action": "update",
  "object": "ticket"
}

10. Xóa phiếu ghi

{
   "account_id": 1,
   "ticket": {"ticket_id":316702},
   "action": "delete",
   "object": "ticket"
}

11. Ghép phiếu ghi

{
   "account_id": 1,
   "mergeOption": {"copyComments":0,"secondaryTickets":[316708],"addCC":1,"primaryComment":"Phiếu ghi #220760 đã được đóng và hợp nhất vào phiếu ghi này","addFollow":1,"primaryIsPublic":0,"primaryTicket":316707,"secondaryComment":"Phiếu ghi này đã được đóng và hợp nhất vào phiếu ghi #220759","secondaryIsPublic":0},
   "action": "merge",
   "object": "ticket"
}

12. Phiếu ghi được gán

{
    "object": "ticket",
    "action": "acd_assign",
    "data": {
        "assignee_id": 0,
        "ticket_id":316702,
        "assign_at": 1704961720473
    }
}

Last updated