添加在线咨询渠道
添加并配置在线咨询渠道。
请求 URL
POST {base_url}/{api_path}/message_channel/createlivechat?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| name | 是 | String | 消息渠道名称。 注: 长度不可超过 63
个字符。 |
| website_domain | 是 | String | 要嵌入在线咨询渠道的网站的域名。 注: 长度不可超过 1023
个字符。 |
| communication_method | 是 | Integer | 在线咨询渠道支持的咨询方式。 取值范围:
|
| destination_type | 是 | String | 消息接收目的地的类型。 取值范围:
|
| destination_id | 否 | Integer | 消息接收目的地的 ID。 |
| enable_webrtc_inbound_call | 否 | Integer | 是否启用 WebRTC 呼入功能,以允许访客通过在线咨询渠道发起通话。 取值范围:
|
| webrtc_trunk_id | 否 | Integer | WebRTC 中继的唯一 ID。 注:
|
| webrtc_inbound_route_id | 否 | Integer | WebRTC 中继呼入路由的唯一 ID。 注:
|
| max_concurrent_call | 是 | Integer | 设置在线咨询渠道支持的最大通话并发数。 取值范围:1 - 10。 |
| message_type | 是 | Integer | 访客可发送的消息类型。 取值范围:
|
| auto_close_session | 否 | Integer | 是否自动关闭在指定时间内无任何互动的消息会话。 取值范围:
|
| session_expired_time | 否 | Integer | 会话超时时间。消息会话在超过此指定时间未有任何互动后将自动关闭。 |
| session_expired_unit | 否 | String | 会话超时时间的单位。 注: 此参数在
取值范围:auto_close_session 设为
1 时必填。
|
| theme_mode | 是 | String | 在线咨询插件的主题模式。 取值范围::
|
| theme_color | 是 | String | 在线咨询插件的主题颜色。 取值范围:6 位十六进制的 RGB
颜色值。例如: |
| minimize_style | 是 | String | 最小化窗口类型。 取值范围:
|
| chat_icon | 是 | String | 在线咨询插件的聊天图标。 取值范围:
|
| default_avatar | 否 | String | 客服头像的文件名 (ID)。 |
| default_agent_name | 是 | String | 客服名称。 注: 长度不可超过 63
个字符。
|
| show_agent_info | 否 | Integer | 是否展示客服信息。 取值范围:
|
| hide_provider_info | 否 | Integer | 是否在插件中展示服务提供商信息 由星纵数字提供软件支持。取值范围:
|
| language | 是 | String | 指定在线咨询插件的显示语言。 取值范围:
|
| enable_prechat_form | 否 | Integer | 是否启用预聊天表单。 取值范围:
|
| prechat_form_title | 否 | String | 预聊天表单的标题。 注: 此参数在
enable_prechat_form 设为
1 时必填。 |
| prechat_form_subtitle | 否 | String | 预聊天表单的子标题。 注: 此参数在
enable_prechat_form 设为
1 时必填。 |
| show_name | 否 | Integer | 是否在预聊天表单中显示姓名字段。 注: 当
enable_prechat_form 设为
1
时,show_name、show_email
和 show_phone 三个字段中至少有一个必须设为
1。取值范围:
|
| show_email | 否 | Integer | 是否在预聊天表单中显示邮箱地址字段。 注: 当
enable_prechat_form 设为
1
时,show_name、show_email
和 show_phone 三个字段中至少有一个必须设为
1。取值范围:
|
| show_phone | 否 | Integer | 是否在预聊天表单中显示电话号码字段。 注: 当
enable_prechat_form 设为
1
时,show_name、show_email
和 show_phone 三个字段中至少有一个必须设为
1。取值范围
|
| require_name | 否 | Integer | 预聊天表单中的姓名字段是否必填。 取值范围:
|
| require_email | 否 | Integer | 预聊天表单中的邮箱地址字段是否必填。 取值范围:
|
| require_phone | 否 | Integer | 预聊天表单中的电话号码字段是否必填。 取值范围:
|
| enable_data_privacy | 否 | Integer | 是否启用数据隐私与同意。 取值范围:
|
| data_privacy_content | 否 | String | 数据隐私与同意的文本内容。 注:
|
| require_data_privacy_consent | 否 | Integer | 是否要求用户明确同意数据隐私与同意的声明。 取值范围:
|
| online_welcome_message | 是 | String | 在系统处于工作时间且消息目的地可达时,访客进入聊天窗口后自动发送的欢迎消息。 注: 长度不可超过 255 个字符。 |
| offline_welcome_message | 是 | String | 在系统处于非工作时间或消息目的地不可用时,访客进入聊天窗口后自动发送的欢迎消息。 注: 长度不可超过 255 个字符。 |
| first_reply_message | 否 | String | 访客发送第一条消息后自动发送的回复消息。 注: 长度不可超过 255 个字符。 |
| session_closed_message | 是 | String | 当消息会话结束时 (无论是由坐席或访客手动关闭会话,或因超时自动关闭会话) 自动发送的文本消息。 注: 长度不可超过 255 个字符。 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| id | Integer | 消息渠道的唯一 ID。 |
示例
请求示例
POST /openapi/v1.0/message_channel/createlivechat?access_token=EX8zZM5hdq3krlPcNmBbDSqfKF1ovibL HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"name": "Docs-LiveChat Channel",
"website_domain": "www.yeastar.com",
"type": "livechat",
"channel": "livechat",
"communication_method": 2,
"destination_type": "extension",
"destination_id": 137,
"enable_webrtc_inbound_call": 1,
"webrtc_trunk_id": 3,
"webrtc_inbound_route_id": 3,
"max_concurrent_call": 5,
"message_type": 2,
"auto_close_session": 1,
"session_expired_unit": "day",
"session_expired_time": 1,
"theme_mode": "light",
"theme_color": "#00DDB3",
"minimize_style": "bar",
"chat_icon": "6",
"default_avatar": "",
"default_agent_name": "Support",
"show_agent_info": 0,
"hide_provider_info": 0,
"language": "BROWSER_LANGUAGE",
"enable_prechat_form": 1,
"prechat_form_title": "Hello 👋",
"prechat_form_subtitle": "Please fill in the form below before starting the chat.",
"show_email": 1,
"show_name": 1,
"show_phone": 1,
"require_name": 1,
"require_phone": 0,
"require_email": 0,
"enable_data_privacy": 1,
"data_privacy_content": "<p>We need to store and process your personal data to provide you with the requested content. For detailed information about our privacy practices and our commitment to protecting your privacy, please check our Privacy Policy.</p>",
"require_data_privacy_consent": 1,
"online_welcome_message": "Hello! How can we help you?",
"offline_welcome_message": "We are away, leave us a message!",
"first_reply_message": "Hello, thank you for contacting us. We have received your message.",
"session_closed_message": "This chat session has ended. Please feel free to contact us if you have any further questions."
}
响应示例
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"id": 219
}