dingtalk.oapi.extcontact.create (添加企业外部联系人)

添加企业外部联系人

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
contact OpenExtContact 必须 外部联系人信息
  • └ title
  • String
  • 可选
  • 开发工程师
  • 职位
  • └ label_ids
  • Number []
  • 必须
  • [1,2,3]
  • 标签列表
  • └ share_dept_ids
  • Number []
  • 可选
  • [1,2,3]
  • 共享给的部门ID
  • └ address
  • String
  • 可选
  • 地址内容
  • 地址
  • └ remark
  • String
  • 可选
  • 备注内容
  • 备注
  • └ follower_user_id
  • String
  • 必须
  • 023420013645
  • 负责人userId
  • └ name
  • String
  • 必须
  • 张三
  • 名称
  • └ state_code
  • String
  • 必须
  • 86
  • 手机号国家码
  • └ company_name
  • String
  • 可选
  • 钉钉
  • 企业名
  • └ share_user_ids
  • String []
  • 可选
  • ["023420013644"]
  • 共享给的员工userId列表
  • └ mobile
  • String
  • 必须
  • 13088888888
  • 手机号

响应参数

名称 类型 示例值 描述
userid String 123420013632 新外部联系人的userId
errcode Number 0 errcode
errmsg String ok errmsg

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/extcontact/create");
OapiExtcontactCreateRequest req = new OapiExtcontactCreateRequest();
OpenExtContact obj1 = new OpenExtContact();
obj1.setTitle("开发工程师");
obj1.setLabelIds(new Long[] { 1,2,3 };
);
obj1.setShareDeptIds(new Long[] { 1,2,3 };
);
obj1.setAddress("地址内容");
obj1.setRemark("备注内容");
obj1.setFollowerUserId("023420013645");
obj1.setName("张三");
obj1.setStateCode("86");
obj1.setCompanyName("钉钉");
obj1.setShareUserIds(""023420013644"");
obj1.setMobile("13088888888");
req.setContact(obj1);
OapiExtcontactCreateResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
{
    "userid":"123420013632",
    "errcode":0,
    "errmsg":"ok"
}

异常示例

  • JSON示例
{
	"errcode":88,
	"errmsg":"ding talk error"
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部