产品动态
关于云联络中心术语更新
https://console.tim.qq.com/v4/desk_http_svc/send_msg?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
参数 | 说明 |
v4/desk_http_svc/send_msg | 请求接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json。 |
{"SessionId": "fd8a2e30-54de-4e40-bcaf-02718409c5cf","MsgRandom": 8436874,"MsgBody": [{"MsgType": "TIMTextElem","MsgContent": {"Text": "欢迎使用智能客服,很高兴为您服务!"}}],"CloudCustomData": "your cloud custom data"}
{"FromAccount": "@customer_service_account","ToAccount": "user45","MsgRandom": 82139,"MsgBody": [{"MsgType": "TIMTextElem","MsgContent": {"Text": "欢迎注册xx商城,您可在此购买想要的商品,如有疑问请联系客服。"}}],"CloudCustomData": "your cloud custom data"}
{"FromAccount": "@customer_service_account","ToAccount": "user45","MsgRandom": 82139,"MsgBody": [{"MsgType": "TIMCustomElem","MsgContent": {"Data": "{\\"src\\": \\"22\\",\\"content\\": {\\"header\\": \\"卡片标题\\",\\"desc\\": \\"卡片描述\\",\\"pic\\": \\"https://static.cloudcachetci.com/qcloud/portal/kit/images/presale.a4955999.jpeg\\",\\"url\\": \\"https://www.qcloud.com/\\"},\\"customerServicePlugin\\": 0}"}}],"CloudCustomData": "your cloud custom data"}
字段 | 类型 | 属性 | 说明 |
SessionId | String | 选填 | 会话 ID。若填了该字段,则无需填 FromAccount 和 ToAccount 字段。 |
FromAccount | String | 选填 | 发送方 UserID,只适用于"应用/客户端"的用户端集成方式,且发送方必须为客服号。 |
ToAccount | String | 选填 | 接收方 UserID,只适用于"应用/客户端"的用户端集成方式,接收方为普通用户。 |
MsgRandom | Integer | 必填 | 消息随机数(32位无符号整数),用于去重。 |
MsgBody | Array | 必填 | 消息内容,具体格式请参见 消息格式描述。智能客服定义的自定义消息格式(如卡片消息、订单消息等)请参加 无 UI 用户端集成,将文档中定义好的 JSON 数据结构序列化后放到自定义消息的 Data 字段。 |
CloudCustomData | String | 选填 | |
ExcludeFromUserRespTimeout | Integer | 选填 | 用户与人工客服聊天时,控制该条消息是否计入“用户回复超时”的倒计时。0为计时,1为不计时,默认为0。 |
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0}
字段 | 类型 | 说明 |
ErrorCode | Integer | 错误码: 0表示成功。 非0表示失败。 |
ErrorInfo | String | 错误信息。 |
ActionStatus | String | 请求处理的结果。 |
错误码 | 描述 |
90001 | JSON 格式解析失败,请检查请求包是否符合 JSON 规范。 |
90002 | |
90005 | JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型。 |
90007 | JSON 格式请求包体中 MsgBody 类型不是 Array 类型,请将其修改为 Array 类型。 |
90009 | 请求需要 App 管理员权限。 |
90010 | |
93000 | JSON 数据包超长,消息包体请不要超过12K。 |
141002 | 内部错误,请重试。 |
141004 | 参数非法。 |
141005 | 会话不存在或已结束。 |
文档反馈