1、https://qyapi.weixin.qq.com/cgi-bin/service/get_corp_token?suite_access_token=SUITE_ACCESS_TOKEN,用永久授权码获取到的access_token调用部门列表接口:
{
"errcode": 0,
"errmsg": "ok",
"department": [
{
"id": 1,
"name": "1",
"parentid": 0,
"order": 100000000
},
{
"id": 2,
"name": "2",
"parentid": 1,
"order": 100000000
},
{
"id": 3,
"name": "3",
"parentid": 1,
"order": 99999000
},
{
"id": 4,
"name": "4",
"parentid": 1,
"order": 99998000
},
{
"id": 5,
"name": "5",
"parentid": 1,
"order": 99997000
},
{
"id": 6,
"name": "6",
"parentid": 1,
"order": 99996000
}
]
}
2、https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRECT通过secrect码获取的access_token调用部门列表接口:
{
"errcode": 0,
"errmsg": "ok",
"department": [
{
"id": 1,
"name": "海狼星",
"parentid": 0,
"order": 100000000
},
{
"id": 2,
"name": "技术部",
"parentid": 1,
"order": 100000000
},
{
"id": 3,
"name": "财务部",
"parentid": 1,
"order": 99999000
},
{
"id": 4,
"name": "产品部",
"parentid": 1,
"order": 99998000
},
{
"id": 5,
"name": "设计部",
"parentid": 1,
"order": 99997000
},
{
"id": 6,
"name": "运营部",
"parentid": 1,
"order": 99996000
}
]
}
第一种的name是不显示的?是权限问题嘛?
部门名称,此字段从2019年12月30日起,对新创建第三方应用不再返回,2020年6月30日起,对所有历史第三方应用不再返回,后续第三方仅通讯录应用可获取,第三方页面需要通过通讯录展示组件来展示部门名称