alibaba.dc.uc.user.create (创建用户)

创建用户

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
req CreateDdUserReq 必须 用户信息
  • └ title
  • String
  • 可选
  • 经理
  • 职位
  • └ job_number
  • String
  • 可选
  • GH123
  • 工号
  • └ union_id
  • String
  • 可选
  • uabc123
  • unionid
  • └ dept_id_list
  • Number []
  • 可选
  • [1,2,3]
  • 用户所属部门Id列表
  • └ avatar
  • String
  • 必须
  • http://www.pic.com/xxx.jpg
  • 头像url
  • └ name
  • String
  • 必须
  • 张三
  • 昵称
  • └ target_id
  • String
  • 必须
  • 10123
  • 外部平台账号Id
  • └ corp_id
  • String
  • 必须
  • ding123abc
  • 钉钉组织Id

响应参数

名称 类型 示例值 描述
data Data 1234 用户信息
  • └ dept_id_list
  • Number []
  • [1,2,3]
  • 用户所属部门id
  • └ account_name
  • String
  • jiaoyuuser001
  • 账号名称
  • └ type
  • String
  • C
  • 用户类型,C普通用户,G政府人员
  • extra
  • Extra
  • extra
  • 扩展信息
  • dd
  • Dd
  • dd
  • 钉钉扩展信息
  • └ unionid
  • String
  • uabc123
  • unionid
  • └ jobnumber
  • String
  • GH123
  • 工号
  • └ title
  • String
  • 经理
  • 职位
  • └ id
  • Number
  • 84050
  • 用户Id
  • └ corp_id
  • String
  • dingabc123
  • 钉钉组织Id
  • └ nick_name
  • String
  • 张三
  • 昵称
  • └ full_name
  • String
  • 张三
  • 名称
  • └ avatar
  • String
  • http://xxxx.xxx.com/xxx.jpg
  • 头像url
  • └ account_id
  • String
  • 100453461256432
  • 外部平台账号Id
  • └ namespace
  • String
  • dd
  • 名称空间
  • └ tenant_id
  • Number
  • 2
  • 租户Id
  • └ status
  • String
  • CREATED
  • 用户状态
has_error Boolean false 请求是否失败,false是,true是
msg_info String demo msgInfo
msg_code String demo msgCode

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaDcUcUserCreateRequest req = new AlibabaDcUcUserCreateRequest();
AlibabaDcUcUserCreateRequest.CreateDdUserReq obj1 = new AlibabaDcUcUserCreateRequest.CreateDdUserReq();
obj1.setTitle("经理");
obj1.setJobNumber("GH123");
obj1.setUnionId("uabc123");
obj1.setDeptIdList(new Long[] { 1,2,3 };
);
obj1.setAvatar("http://www.pic.com/xxx.jpg");
obj1.setName("张三");
obj1.setTargetId("10123");
obj1.setCorpId("ding123abc");
req.setReq(obj1);
AlibabaDcUcUserCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_dc_uc_user_create_response>
    <data>
        <dept_id_list>
            <number>[1</number>
            <number>2</number>
            <number>3]</number>
        </dept_id_list>
        <account_name>jiaoyuuser001</account_name>
        <type>C</type>
        <extra>
            <dd>
                <unionid>uabc123</unionid>
                <jobnumber>GH123</jobnumber>
                <title>经理</title>
            </dd>
        </extra>
        <id>84050</id>
        <corp_id>dingabc123</corp_id>
        <nick_name>张三</nick_name>
        <full_name>张三</full_name>
        <avatar>http://xxxx.xxx.com/xxx.jpg</avatar>
        <account_id>100453461256432</account_id>
        <namespace>dd</namespace>
        <tenant_id>2</tenant_id>
        <status>CREATED</status>
    </data>
    <has_error>false</has_error>
    <msg_info>demo</msg_info>
    <msg_code>demo</msg_code>
</alibaba_dc_uc_user_create_response>

异常示例

  • XML示例
  • JSON示例
<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

返回
顶部