# 第三方业务系统对接服务

# 接收第三方发送的数据API

开始使用前,请先创建应用,申请“thirdparty-customer-service” scope,并成功完成审批

接口描述

  • 第三方系统异步发送数据给机器人,数据类型包括文本,图片,文件,用于第三方发送给用户数据的展示;数据类型为开始结束事件,用来标识机器人对接第三方系统开始;数据类型为评价消息,用来展示给用户评价链接

请求

POST https://apigate.glodon.com/chatbot/servlet/third/msg/receive

1
2

请求的header参数

参数 参数类型 是否必传 示例值 描述
Authorization 字符串 Bearer cn-236f6e4f-6db5-46c2-97ec-19b4f5d499d3 从用户中心获取的ACCESS_TOKEN

请求的param参数

参数 参数类型 是否必传 示例值 描述
source 整数 1 1为佳信,不传默认为1

请求的body参数

	说明:touser为chatid,fromuser在连接客服之前为固定的【系统消息】,连接成功后为客服名字

	事件begin
    {
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"fromuser": "系统消息",
		"msgtype":"event",
		"eventType":"begin"
	}
	
	事件end
	{
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"msgtype":"event",
		"eventType":"end"
	}
	
	评价
	{
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"msgtype":"evaluate",
		"url":"http://gkf-test.glodon.com:22601/prod/satisfysPage.html?orgName=czc0zjf1ewvyzw&appName=gld600&suborgId=czc0zjf1ewvyzw&sessionID=wroogj2470&username=698d51a19d8a121ce581499d7b701668&env=prod&workgroupId=gxetest"
	}
	
	
	文本
	{
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"fromuser": "客服A",
		"msgtype":"text",
		"text":{
			"content":"内容A"
		}
	}
	
	图片
	{
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"fromuser": "客服A",
		"msgtype":"image",
		"image":{
			"image_url":"http://gkf-test.glodon.com:21501/oss/download/czc0zjf1ewvyzw/mcs/2020/5/20/99521780-1a6b-457b-96e6-33d330b44708.png?bucket=jxfiles&name=0%2Epng&type=1000&contentType=image/png"
		}
	}
	
	文件
	{
		"touser": "561f7439-9ace-4ba7-8121-bbbb3e1e96a",
		"fromuser": "客服A",
		"msgtype":"file",
		"file":{
			"file_name":"建文本文档.txt",
			"file_url":"http://gkf-test.glodon.com:21501/oss/download/czc0zjf1ewvyzw/mcs/2020/5/20/a62c3d84-06c1-4e34-9b29-f5dfadf731f8.txt?bucket=jxfiles&name=%E6%96%B0%E5%BB%BA%E6%96%87%E6%9C%AC%E6%96%87%E6%A1%A3%2Etxt&type=1001&contentType=application/octet-stream"
		}
	}
	
	
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

请求成功返回的数据示例

    {
        "status": 0,
		"message": "ok"
    }
1
2
3
4

请求失败返回的数据示例

	
	{
        "status": -1,
		"errcode": error,
		"message": "token is wrong"
    }
	
1
2
3
4
5
6
7

# 第三方系统获取聊天记录

开始使用前,请先创建应用,申请“thirdparty-customer-service” scope,并成功完成审批

接口描述

  • 第三方系统获取用户与机器人聊天记录

请求地址

GET https://apigate.glodon.com/chatbot/servlet/third/msg/chatlog/get

1
2

请求的header参数

参数 参数类型 是否必传 示例值 描述
Authorization 字符串 Bearer cn-236f6e4f-6db5-46c2-97ec-19b4f5d499d3 从用户中心获取的ACCESS_TOKEN

请求的param参数

参数 参数类型 是否必传 示例值 描述
openId 字符串 dc71a6ba-24b6-4ed9-b865-837f2a7e158f 会话ID
source 整数 1 1为佳信,不传默认为1

请求成功返回的数据示例

    {
        "status": 0,
		"message": "ok",
		"total":"2",
		"list":[
				{
					"Question": "我是问题1",
					"Reply": "我是答案1",
					"DateTime": "2020-05-12 08:30:00",
					"ReplyMode": ""
				},
				{
					"Question": "我是问题2",
					"Reply": "我是答案2",
					"DateTime": "2020-05-12 08:50:00",
					"ReplyMode": ""
				}
		]
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

请求失败返回的数据示例

	
	{
        "status": -1,
		"errcode": error,
		"message": "token is wrong"
    }
	
1
2
3
4
5
6
7

# 第三方系统获取用户详细信息

开始使用前,请先创建应用,申请“thirdparty-customer-service” scope,并成功完成审批

接口描述

  • 第三方系统获取用户详细信息

请求地址

GET https://apigate.glodon.com/chatbot/servlet/user/info/get
1

请求的header参数

参数 参数类型 是否必传 示例值 描述
Authorization 字符串 Bearer cn-236f6e4f-6db5-46c2-97ec-19b4f5d499d3 从用户中心获取的ACCESS_TOKEN

请求的param参数

参数 参数类型 是否必传 示例值 描述
clientId 字符串 12e12e1e12e12e 用户ID
source 整数 1 1为佳信,不传默认为1

请求成功返回的数据示例

    {
        "status": 0,
		"message": "ok",
		"total":"2",
		"chatUser":
			{
				"clientId": "ASDJQFJQEFQEGNQEG",
				"hostIp": "10.1.123.6",
				"broswer": "Crome",
				"sysInfo": "",
				"address":"北京",
				"city":"海淀",
				"lastLoginTime":"2020-05-12 08:30:00"
			},
		"channelConfig":
			{
				"name": "广旺财"
			}
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

请求失败返回的数据示例

	
	{
        "status": -1,
		"errcode": error,
		"message": "token is wrong"
    }
	
1
2
3
4
5
6
7

# 给特定用户发送消息

开始使用前,请先创建应用,申请“message-push-service” scope,并成功完成审批

接口描述

  • 通过问答平台给特定用户发送消息

请求地址

POST https://apigate.glodon.com/chatbot/api/front/thirdParty/message/push
1

请求的header参数

参数 参数类型 是否必传 示例值 描述
Authorization 字符串 Bearer cn-236f6e4f-6db5-46c2-97ec-19b4f5d499d3 从用户中心获取的ACCESS_TOKEN

请求的body参数

参数 参数类型 是否必传 示例值 描述
messageId 字符串 EQFEQ234TFQRFV54GHTE4HG4 消息内容对应的id
content 字符串 您好,您有一条新消息 消息内容,支持富文本
expireTime 整型 1 消息存储在服务端的时间,超过此时间,用户仍然没有登陆,将删除对应该用户的此条消息,不再推送
userIds 字符串 6557578274821898321,6557192726348112377 消息推送目标用户ID以英文逗号拼接而成

请求body示例

{
		"userIds": "6557578274821898321,6557192726348112377",
		"content": "您好,您有一条新消息",
		"messageId": "EQFEQ234TFQRFV54GHTE4HG4",
		"expireTime": 1
}
1
2
3
4
5
6

请求成功返回的数据示例

	{
		"code": 200,
		"message": "success"
	}
1
2
3
4

请求失败返回的数据示例

	
    {
		"code": 500,
		"message": "system error"
	}

	{
      	"code": 400,
		"message": "parse access_token from Authorization error"
    }

	{
        "code": 400,
		"message": "check access_token error"
    }

    {
        "code": 400,
		"message": "Required parameter 'userIds' is not present"
    }

    {
        "code": 400,
		"message": "Required parameter 'content' is not present"
    }

	{
        "code": 400,
		"message": "Required parameter 'expireTime' is not present"
    }

	{
        "code": 400,
		"message": "Required parameter 'messageId' is not present"
    }

	{
    	"code": 400,
    	"message": "messsagePush.userIds: size exceeds the max value [100]"
	}
	
	{
    	"code": 400,
    	"message": "messsagePush.userIds: element length exceeds the max value [60]"
	}


	{
    	"code": 400,
    	"message": "messsagePush.content: length exceeds the max value [32768]"
	}


	{
    	"code": 400,
    	"message": "messsagePush.expireTime: value must be between 1 and 168"
	}

	{
    	"code": 400,
    	"message": "messsagePush.messageId: Length exceeds the max value [64]"
	}

	
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  • 在线客服

  • 意见反馈