chat_connect
curl --request POST \
--url https://sg.sobot.io/api/5/user/chat_connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partnerid": "<string>",
"source": 123,
"channel_flag": 123,
"user_nick": "<string>",
"user_name": "<string>",
"user_tels": "<string>",
"user_emails": "<string>",
"user_img": "<string>",
"params": "<string>",
"agentid": "<string>",
"tran_flag": 123,
"groupid": "<string>",
"channel_id": 123
}
'import requests
url = "https://sg.sobot.io/api/5/user/chat_connect"
payload = {
"partnerid": "<string>",
"source": 123,
"channel_flag": 123,
"user_nick": "<string>",
"user_name": "<string>",
"user_tels": "<string>",
"user_emails": "<string>",
"user_img": "<string>",
"params": "<string>",
"agentid": "<string>",
"tran_flag": 123,
"groupid": "<string>",
"channel_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partnerid: '<string>',
source: 123,
channel_flag: 123,
user_nick: '<string>',
user_name: '<string>',
user_tels: '<string>',
user_emails: '<string>',
user_img: '<string>',
params: '<string>',
agentid: '<string>',
tran_flag: 123,
groupid: '<string>',
channel_id: 123
})
};
fetch('https://sg.sobot.io/api/5/user/chat_connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sg.sobot.io/api/5/user/chat_connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partnerid' => '<string>',
'source' => 123,
'channel_flag' => 123,
'user_nick' => '<string>',
'user_name' => '<string>',
'user_tels' => '<string>',
'user_emails' => '<string>',
'user_img' => '<string>',
'params' => '<string>',
'agentid' => '<string>',
'tran_flag' => 123,
'groupid' => '<string>',
'channel_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sg.sobot.io/api/5/user/chat_connect"
payload := strings.NewReader("{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sg.sobot.io/api/5/user/chat_connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sg.sobot.io/api/5/user/chat_connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
chat_connect
chat_connect
POST
/
api
/
5
/
user
/
chat_connect
chat_connect
curl --request POST \
--url https://sg.sobot.io/api/5/user/chat_connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partnerid": "<string>",
"source": 123,
"channel_flag": 123,
"user_nick": "<string>",
"user_name": "<string>",
"user_tels": "<string>",
"user_emails": "<string>",
"user_img": "<string>",
"params": "<string>",
"agentid": "<string>",
"tran_flag": 123,
"groupid": "<string>",
"channel_id": 123
}
'import requests
url = "https://sg.sobot.io/api/5/user/chat_connect"
payload = {
"partnerid": "<string>",
"source": 123,
"channel_flag": 123,
"user_nick": "<string>",
"user_name": "<string>",
"user_tels": "<string>",
"user_emails": "<string>",
"user_img": "<string>",
"params": "<string>",
"agentid": "<string>",
"tran_flag": 123,
"groupid": "<string>",
"channel_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partnerid: '<string>',
source: 123,
channel_flag: 123,
user_nick: '<string>',
user_name: '<string>',
user_tels: '<string>',
user_emails: '<string>',
user_img: '<string>',
params: '<string>',
agentid: '<string>',
tran_flag: 123,
groupid: '<string>',
channel_id: 123
})
};
fetch('https://sg.sobot.io/api/5/user/chat_connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sg.sobot.io/api/5/user/chat_connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partnerid' => '<string>',
'source' => 123,
'channel_flag' => 123,
'user_nick' => '<string>',
'user_name' => '<string>',
'user_tels' => '<string>',
'user_emails' => '<string>',
'user_img' => '<string>',
'params' => '<string>',
'agentid' => '<string>',
'tran_flag' => 123,
'groupid' => '<string>',
'channel_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sg.sobot.io/api/5/user/chat_connect"
payload := strings.NewReader("{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sg.sobot.io/api/5/user/chat_connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sg.sobot.io/api/5/user/chat_connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partnerid\": \"<string>\",\n \"source\": 123,\n \"channel_flag\": 123,\n \"user_nick\": \"<string>\",\n \"user_name\": \"<string>\",\n \"user_tels\": \"<string>\",\n \"user_emails\": \"<string>\",\n \"user_img\": \"<string>\",\n \"params\": \"<string>\",\n \"agentid\": \"<string>\",\n \"tran_flag\": 123,\n \"groupid\": \"<string>\",\n \"channel_id\": 123\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
对接ID,需要保证唯一性
渠道来源:用户来源:0 桌面网站、1 微信、2 App、3 微博、4 移动网站、6 呼叫、7 工单中心、8 客户中心、9 企业微信、10 小程序、12 百度营销、13 今日头条、14 奇虎360、15 阿里汇川、16 搜狗、17 微信客服、20 广点通、21 知乎、22 facebook、23 whatsApp、24 instagram、25 line、26 discord、33 telegram
子渠道编码
用户昵称
用户姓名
电话,多个以逗号分隔
邮箱,多个以逗号分隔
用户头像
自定义字段,json格式
指定客服id
指定客服转接方式:1-不能转出,0-可转出
指定技能组id
子渠道编码
Response
200
No Content
⌘I