dingtalk.corp.chatbot.install (ISV给企业安装机器人)

企业安装微应用后,ISV可通过本接口给企业上架一个企业机器人。目前灰度几个ISV,机器人应用会白名单处理

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
chatbot_vo ChatbotVo 必须 安装的机器人信息
  • └ icon
  • String
  • 必须
  • @dsa8d87y7c8d8c
  • 机器人头像mediaId
  • └ name_modify
  • Number
  • 必须
  • 0
  • 向群添加机器人时是否可改名字:0-不可必,1-可改
  • └ chatbot_id
  • String
  • 必须
  • gitLab
  • 机器人id(钉钉分配)
  • └ breif
  • String
  • 必须
  • 基于ROR的开源代码托管软件
  • 机器人简介
  • └ function
  • Number
  • 必须
  • 3
  • INCOMING = 1,OUTGOING = 2,INOUT = 3
  • └ outgoing_url
  • String
  • 必须
  • http:xxx
  • 机器人回调URL
  • └ authority
  • Number
  • 必须
  • 0
  • 0-正常,1-只服务端可管理
  • └ preview_media_id
  • String
  • 必须
  • @dsa8d87y7c8d8c
  • 机器人预览图
  • └ bot_type
  • Number
  • 必须
  • 2
  • 2-企业对内机器人,3-企业对外机器人
  • └ mobile_switch
  • Number
  • 必须
  • 1
  • 手机端是否能添加机器人:0-移动端不能加,1-移动端能添加
  • └ description
  • String
  • 必须
  • 优秀的代码托管服务,将接收到项目变更实时通知
  • 机器详细介绍
  • └ name
  • String
  • 必须
  • 项目通知
  • 机器人的名字
  • └ icon_mdify
  • Number
  • 必须
  • 0
  • 向群添加机器人时是否可改头像:0-不可必,1-可改
  • └ outgoing_token
  • String
  • 必须
  • 1220ba9606120714e5eb2285e992680a6
  • 机器人消息回调时在header中添加的token,用于对钉钉鉴权
  • └ oto_support
  • Number
  • 可选
  • 0
  • 是否支持单聊:0-不要单聊,1需要单聊

响应参数

名称 类型 示例值 描述
result DingOpenResult result
  • └ result
  • Json
  • null
  • result
  • └ ding_open_errcode
  • Number
  • -1
  • dingOpenErrcode
  • └ error_msg
  • String
  • 系统繁忙
  • errorMsg
  • └ success
  • Boolean
  • true
  • success

请求示例

  • 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
19
20
21
DingTalkClient client = new DefaultDingTalkClient("https://eco.taobao.com/router/rest");
CorpChatbotInstallRequest req = new CorpChatbotInstallRequest();
ChatbotVo obj1 = new ChatbotVo();
obj1.setIcon("@dsa8d87y7c8d8c");
obj1.setNameModify(0L);
obj1.setChatbotId("gitLab");
obj1.setBreif("基于ROR的开源代码托管软件");
obj1.setFunction(3L);
obj1.setOutgoingUrl("http:xxx");
obj1.setAuthority(0L);
obj1.setPreviewMediaId("@dsa8d87y7c8d8c");
obj1.setBotType(2L);
obj1.setMobileSwitch(1L);
obj1.setDescription("优秀的代码托管服务,将接收到项目变更实时通知");
obj1.setName("项目通知");
obj1.setIconMdify(0L);
obj1.setOutgoingToken("1220ba9606120714e5eb2285e992680a6");
obj1.setOtoSupport(0L);
req.setChatbotVo(obj1);
CorpChatbotInstallResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
7
8
<dingtalk_corp_chatbot_install_response>
    <result>
        <result>null</result>
        <ding_open_errcode>-1</ding_open_errcode>
        <error_msg>系统繁忙</error_msg>
        <success>true</success>
    </result>
</dingtalk_corp_chatbot_install_response>

异常示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部