如需获取该部门及其子部门的所有家长,需先获取该部门下的子部门,然后再获取子部门下的家长,逐层递归获取。
curl --location -g --request GET 'https://qyapi.weixin.qq.com/cgi-bin/school/user/list_parent?access_token={{access_token}}&department_id={{department_id}}'
{
"errcode": 0,
"errmsg": "ok",
"parents": [
{
"parent_userid": "zhangsan_parent",
"mobile": "18900000000",
"is_subscribe": 1,
"external_userid": "xxx",
"children": [
{
"student_userid": "zhangsan",
"relation": "爸爸",
"name": "张三"
}
]
},
{
"parent_userid": "lisi_parent",
"mobile": "18900000001",
"is_subscribe": 0,
"children": [
{
"student_userid": "lisi",
"relation": "妈妈",
"name": "李四"
}
]
}
]
}