dingtalk.oapi.impaas.otoconversation.create (创建单聊二级会话)

部分新零售场景需要支持二级会话,也就是把部分同类会话聚合在一起 本接口给二方提供了创建二级单聊会话的能力

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
request CreateO2OSubConversationRequest 可选 请求
  • account_info_list
  • AccountInfo []
  • 可选
  • 账号列表,size=2。第一个表示自己,第二个表示对方
  • └ channel
  • String
  • 可选
  • taobao
  • channel名称
  • └ id
  • String
  • 可选
  • 1234
  • id
  • └ type
  • String
  • 可选
  • staff
  • id类型
  • └ entrance_id_list
  • Number []
  • 可选
  • [1,23]
  • 入口id列表,size=2。普通会话填0,二级会话填entrnaceid
  • └ uuid
  • String
  • 可选
  • 86d1606a-8ea1-4858-bf07-3956a26f225e
  • 用于去重和追踪
  • └ channel
  • String
  • 可选
  • taobao
  • channel名称
  • └ extension
  • String
  • 可选
  • {}
  • 扩展信息

响应参数

名称 类型 示例值 描述
result String 12345:234 会话id
errcode Number -1 dingOpenErrcode
errmsg String service error errmsg

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/impaas/otoconversation/create");
OapiImpaasOtoconversationCreateRequest req = new OapiImpaasOtoconversationCreateRequest();
CreateO2OSubConversationRequest obj1 = new CreateO2OSubConversationRequest();
List<AccountInfo> list3 = new ArrayList<AccountInfo>();
AccountInfo obj4 = new AccountInfo();
list3.add(obj4);
obj4.setChannel("taobao");
obj4.setId("1234");
obj4.setType("staff");
obj1.setAccountInfoList(list3);
obj1.setEntranceIdList(new Long[] { 1,23 };
);
obj1.setUuid("86d1606a-8ea1-4858-bf07-3956a26f225e");
obj1.setChannel("taobao");
obj1.setExtension("{}");
req.setRequest(obj1);
OapiImpaasOtoconversationCreateResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
1
2
3
4
5
{
    "result":"12345:234",
    "errcode":-1,
    "errmsg":"service error"
}

异常示例

  • JSON示例
1
2
3
4
{
    "errcode":88,
    "errmsg":"ding talk error"
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部