Đ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

{
"phone": "0395*****",
"full_name": "Nguyen Van Hien",
"domain": "" //Nguồn định danh
}

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

{
    "instance_id": "stg",
    "payload": {
        "created_date": 1738723776704,
        "last_updated_date": 1738723776704,
        "_id": "67a2d1c0beda7563afac23f4",
        "created_by": {},
        "last_updated_by": {},
        "tenant_id": "67064126273def645101f76c",
        "is_deleted": false,
        "room_id": "67a2d199beda7563afac23c6",
        "member_type": "guest",
        "type": "chat",
        "action": null,
        "content": "Tôi cần nâng cấp mở rộng số lượng đơn hàng 222",
        "multimedias": null,
        "kind": "normal",
        "receiving_group_id": "6706412f868af156014afa11",
        "change_group_info": null,
        "uuid": "f44ef584-fecf-4ecb-bcd8-c23bee387233",
        "conv_uuid": "000000000000-1",
        "activity": null,
        "new_members": null,
        "old_members": null,
        "guest_info": null,
        "template": null,
        "user_reactions": null,
        "reactions": [],
        "quote_id": null,
        "quote_message": null,
        "gpt_key": null,
        "total_token": null,
        "amount_chat_gpt": null,
        "first_message_gpt": null,
        "prompt_tokens": null,
        "completion_tokens": null,
        "chat_gpt_model": null,
        "omi_bot_node_id": null,
        "interactive_id": null,
        "interactive_start": null,
        "interactive_end": null,
        "meeting_member": null,
        "relative_message_id": null,
        "tp_response": null,
        "omi_ai_bot_info": null,
        "file_analyze_usage": null,
        "total_prompt_tokens": null,
        "total_completion_tokens": null,
        "total_total_token": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}

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?