创建成员
POST
/cgi-bin/user/create
服务端API企业内部开发第三方应用开发智慧硬件开发
注意,每个部门下的部门、成员总数不能超过3万个。建议保证创建department对应的部门和创建成员是串行化处理。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://qyapi.weixin.qq.com/cgi-bin/user/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"userid": "zhangsan",
"name": "张三",
"alias": "jackzhang",
"mobile": "+86 13800000000",
"department": [1, 2],
"order":[10,40],
"position": "产品经理",
"gender": "1",
"email": "zhangsan@gzdev.com",
"biz_mail":"zhangsan@qyycs2.wecom.work",
"is_leader_in_dept": [1, 0],
"direct_leader":["lisi","wangwu"],
"enable":1,
"avatar_mediaid": "2-G6nrLmr5EC3MNb_-zL1dDdzkd0p7cNliYu9V5w7o8K0",
"telephone": "020-123456",
"address": "广州市海珠区新港中路",
"main_department": 1,
"extattr": {
"attrs": [
{
"type": 0,
"name": "文本名称",
"text": {
"value": "文本"
}
},
{
"type": 1,
"name": "网页名称",
"web": {
"url": "http://www.test.com",
"title": "标题"
}
}
]
},
"to_invite": true,
"external_position": "高级产品经理",
"external_profile": {
"external_corp_name": "企业简称",
"wechat_channels": {
"nickname": "视频号名称"
},
"external_attr": [
{
"type": 0,
"name": "文本名称",
"text": {
"value": "文本"
}
},
{
"type": 1,
"name": "网页名称",
"web": {
"url": "http://www.test.com",
"title": "标题"
}
},
{
"type": 2,
"name": "测试app",
"miniprogram": {
"appid": "wx8bd8012614784fake",
"pagepath": "/index",
"title": "my miniprogram"
}
}
]
}
}'
响应示例响应示例
{
"errcode": 0,
"errmsg": "created"
}
请求参数
Query 参数
access_token
可选
示例值:
{{accesstoken}}
Body 参数application/json
返回响应
修改于 2022-11-30 06:57:19