Webhook
CareSoft cung cấp tính năng hỗ trợ các webhook để nhận thông tin cập nhật cuộc gọi, phiếu ghi, hay các cuộc gọi tự động trên smartdialer.
- Callback Url (VD: http://sample.com/api/webHook)
- SecretKey (option)
- Các sự kiện cần đăng ký:
[user, organization, ticket.voice, ticket.voice_out, ticket.ivr, ticket.chat, ticket.facebook, ticket.api, ticket.inbox_facebook, ticket.inbox_facebook_out, ticket.inbox_zalo, ticket.facebook_lead_ads, ticket.ticket_form, smart_dialer]
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
Định dạng chung
{
"object": "ticket|user|organization|smart_dialer",
"action": "create|update|delete|ad_end_call|pd_end_call|delete|merge",
"ticket": {
"ticket_comment": {}
},
"user": {},
"organization": {},
"call_info": {},
"mergeOption": {}
}
Tham số | Mô tả | Giá trị |
---|---|---|
object | Lo ại đối tượng | ticket : Phiếu ghi
user : Khách hàng
organization : Tổ chức
smart_dialer : Smartdialer |
action | Hành động | create : Tạo mớiupdate : Cập nhật delete : Xóaad_end_call : Kết thúc cuộc gọi AutoCall c ủa SmartDialer
pd_end_call : Kết thúc cuộc gọi PredictiveCall của SmartDialer |
Tham số | Mô tả | Giá trị |
---|---|---|
ticket_id | ID phiếu ghi | |
ticket_no | Số phiếu ghi | |
requester_id | ID người yêu cầu | |
assignee_id | ID người xử lý | |
service_id | ID dịch vụ | |
ticket_priority | Độ ưu tiên | High, Low, Normal |
ticket_source | Nguồn phiếu ghi | |
ticket_source_end_status | Trạng thái kết thúc phiếu | |
ticket_status | Trạng thái phiếu ghi | new, open, pending, closed, solved |
ticket_subject | Tiêu đề phiếu ghi | |
addition_fields | Trường động phiếu ghi. | Định dạng json array. VD: [{id:1234, field:addition_field1", label: "Tên trường động", value: "Giá trị dạng text"},...] |
created_at | Thời điểm tạo phiếu ghi | |
updated_at | Thời điểm cập nhật phiếu ghi | |
Tham số | Mô tả |
---|---|
ticket_id | ID phiếu ghi |
commentator_id | ID người comment |
source | Nguồn comment |
is_public | Loại comment: Công khai (1) hoặc ghi chú nội bộ (0). |
created_at | Thời điểm comment |
updated_at | Thời điểm update comment |
Đối với cuộc gọi thông thường object cuộc gọi sẽ là
ticket
Tham số | Mô tả |
---|---|
caller | SĐT khách hàng |
called | Hotline tổng đài |
call_id | ID cuộc gọi |
start_time | Thời điểm bắt đầu cuộc gọi |
answer_time | Thời điểm bắt máy |
end_time | Thời điểm kết thúc |
status_code | Mã trạng thái cuộc gọi |
Tham số người dùng | Mô tả | Giá trị |
---|---|---|
username | Tên người dùng | |
email | Email chính | |
email2 | Email phụ | |
phone_no | SĐT chính | |
phone_no2 | SĐT phụ 2 | |
phone_no3 | SĐT phụ 3 | |
note | Ghi chú | |
gender | Giới tính (0 - Nam, 1 - Nữ, 2 - Khác) | |
organization_id | ID tổ chức | |
detail | Mô tả | |
avatar | Đường dẫn ảnh đại diện | |
user_info5 | Địa chỉ | |
addition_fields | Trường động người dùng | Định dạng json array. VD: [{id:1234, field:addition_field1", label: "Tên trường động", value: "Giá trị dạng text"},...] |
follower_id | ID nhân viên xử lý | |
created_from | Nguồn tạo KH | |
city_id | ID tỉnh / thành phố | |
district_id | ID quận / huyện | |
Tham số tổ chức (organization) | Mô tả | Ghi chú |
---|---|---|
organization_id | ID tổ chức | |
organization_name | Tên tổ chức | |
organization_domain | Website | |
details | Chi tiết | |
note | Ghi chú | |
addition_fields | Trường động tổ chức | Định dạng json array. VD: [{id:1234, field:addition_field1", label: "Tên trường động", value: "Giá trị dạng text"},...] |
Đố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. Tham số | Mô tả |
---|---|
campaign_id | ID chiến dịch |
customer_id | ID khách hàng |
customer_name | Tên khách hàng |
campaign_data_id | ID Data |
call_id | Mã cuộc gọi |
line | Đầu số gọi ra |
phone_number | SĐT nhận cuộc gọi |
call_attempt_index | Số lần retry hiện tại |
max_attempt | Số lần retry tối đa |
start_time | Thời điểm bắt đầu cuộc gọi (millis) |
connect_time | Thời điểm bắt máy |
end_time | Thời điểm kết thúc |
ring_customer_duration | Thời gian đổ chuông (giây) |
call_duration | Thời lượng cuộc gọi (giây) |
status_code | Mã lỗi cuộc gọi (Thành công = 200) |
customer_input_dtmf | Dữ liệu bấm phím (nếu cuộc gọi là IVR) |
agent_user_id | ID chuyên viên (Cuộc gọi predictive call - object = pd_end_call) |
agent_id | IP Phone chuyên viên (Cuộc gọi predictive call) |
agent_ring_time | Thời điểm đổ chuông tới chuyên viên (Preditive call) |
agent_connect_time | Thời điểm kết nối tới chuyên viên (Predictive call) |
ring_agent_duration | Thời lượng chuông tới chuyên viên (Predictive call) |
{
"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"
}
{
"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"
}
{
"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: ([email protected])<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"
}
{
"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"
}
{
"account_id": 1,
"action": "update",
"user": {
"updated_at": 1633510473715,
"changes": [
{
"field": "addition_field13",
"value": "x123x"
}
],
"id": 63203835,
"username": "Tan9999"
},
"object": "user"
}
{
"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"
}
{
"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"
}
{
"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"
}
{
"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"
}
{
"account_id": 1,
"ticket": {"ticket_id":316702},
"action": "delete",
"object": "ticket"
}
{
"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"
}