wxCpService.getUserService().update(wxCpUser);调用改服务时,返回码是正确的
但是通过 后台查看信息并没有更新
通过PostMan进行接口测https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=试的时候,报错:
{
"errcode": 60111,
"errmsg": "userid not found, hint: [1604306229_54_b8195ef4614253bb19f630e55cfaa8f8], from ip: 119.137.54.50, more info at https://open.work.weixin.qq.com/devtool/query?e=60111"
}
测试数据:
{
"userid": "TangYe",
"name": "李四",
"department": [1],
"order": [10],
"position": "后台工程师",
"mobile": "13800000000",
"gender": "1",
"email": "zhangsan@gzdev.com",
"is_leader_in_dept": [1],
"enable": 1,
"avatar_mediaid": "2-G6nrLmr5EC3MNb_-zL1dDdzkd0p7cNliYu9V5w7o8K0",
"telephone": "020-123456",
"alias": "jackzhang",
"address": "广州市海珠区新港中路",
"main_department": 1,
"extattr": {
"attrs": [
{
"type": 0,
"name": "文本名称",
"text": {
"value": "文本"
}
},
{
"type": 1,
"name": "网页名称",
"web": {
"url": "http://www.test.com",
"title": "标题"
}
}
]
},
"external_position": "工程师",
"external_profile": {
"external_corp_name": "企业简称",
"external_attr": [
{
"type": 0,
"name": "文本名称",
"text": {
"value": "文本"
}
},
{
"type": 1,
"name": "网页名称",
"web": {
"url": "http://www.test.com",
"title": "标题"
}
},
{
"type": 2,
"name": "测试app",
"miniprogram": {
"appid": "wx8bd80126147dFAKE",
"pagepath": "/index",
"title": "my miniprogram"
}
}
]
}
}
使用的是https://github.com/Wechat-Group/WxJava的SDK进行的开发,调用接口的时候将wxCpUser转为json的时候将Attr对象的name字段删除掉了,导致额外字段没有更新