Đa kênh

API & Webhook đa kênh OMI được sử dụng khi khách hàng hoặc đối tác có sẵn hệ thống Chat (Live Chat) cần tích hợp thêm Chatbot OMI hoặc Nhân viên trực ở OMI

Khởi tạo cuộc trò chuyện

POST [URL]/api/social/{channel}/new_room

Khởi tạo cuộc trò chuyện

Path Variable

Name
Description

channel *

Nguồn chat của khách hàng : livetalk

Headers

Name
Value

Content-Type

application/json

X-API-KEY

<API KEY>

Body

Name
Type
Description

uuid

string

Id của cuộc trò chuyện bên đối tác . Trường hợp empty hệ thống tự khởi tạo

guest_info

object

Thông tin khách hàng chat

Response

{
    "instance_id": "stg",
    "payload": {
        "conversation": {
            "created_date": 1738723737112,
            "last_updated_date": 1738723737112,
            "_id": "67a2d199beda7563afac23c6",
            "guest_info": {
                "phone": "0395*****",
                "full_name": "Nguyen Van Hien",
                "email": null,
                "contact_id": null,
                "new_contact": false,
                "uuid": "000000000000-1",
                "domain": "support130",
                "browser": null,
                "ip": null,
                "address": null,
                "lat": null,
                "lon": null,
                "other_info": {
                    "full_name": "Nguyen Van Hien",
                    "mail": null,
                    "phone_number": "0395*****"
                }
            },
            "last_message": null,
            "web_navigate": null,
            "status": "active",
            "uuid": "000000000000-1",
            "name": "Nguyen Van Hien",
            "name_unsigned": "0395*****",
            "start_type": "script",
            "members": [
            ],
            "last_message_info": {
                "sender": "guest",
                "send_time": 1738723737036,
                "create_by": null,
                "last_agent_sent_time": null,
                "last_customer_sent_time": 1738723737036
            },
            "customer_project_id": null,
            "customer_app_id": null,
            "user_app_ids": null
        }
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}

Gửi tin nhắn

POST [URL]/api/social/{channel}/guest_send_message

Path Variable

Name
Description

channel *

Nguồn chat của khách hàng : livetalk

Headers

Name
Value

Content-Type

application/json

X-API-KEY

<API KEY>

Body

Name
Type
Description

uuid *

String

Id của cuộc trò chuyện đã khởi tạo trước đó

content *

String

Nội dung tin nhắn

multimedias

Array Object

[{"name":"",

"url:"",

"content_type":""

}]

Danh sách tập tin đính kèm

Response

Lấy danh sách tin nhắn

POST [URL]/api/social/message/list?page=1&size=15

Query Parameters

Name
Type
Description

page*

Number

Chỉ số trang, bắt đầu bằng 1

size*

Number

Kích thước trang, mặc định là 15

Headers

Name
Value

Content-Type

application/json

X-API-KEY

<API KEY>

Body

Name
Type
Description

conv_id*

String

Id của cuộc trò chuyện

Response

Webhook

  • Đối tác / Khách hàng cung cấp API để OMI callback tin nhắn trở lại khi ChatBot trả lời hoặc nhân viên trả lời từ OMI

  • API dạng POST

  • Body là thông tin nội dung tin nhắn

  • API Timeout tối đa 2(s)

Last updated

Was this helpful?