Dingding development stepping pit: the requested department id is not within the authorized scope

[Note] Test environment:  ApiExplorer . It is recommended that you can use the official online API provided by DingTalk to test before writing the interface 切记 ApiExplorer 发起 API 调用将对当前登录企业的线上数据发起实际调用,请谨慎操作.

I recently launched a DingTalk small program backend, 部门列表接口and reminders of life and death when accessing :

{
    "errcode":50004,
    "errmsg":"请求的部门id不在授权范围内"
}

I thought it was because my developer and sub-administrator had insufficient permissions, so I contacted the customer to log in with the account of the main administrator, but the result still didn't work. The key is that the official didn't explain it clearly and it was difficult to understand.

Fill in the pit record : The problem is [ 请选择权限范围], I did not pay special attention to this inconspicuous button at first (well, I did not turn to the bottom to see it several times, ^_^^_^), when I first Seeing it was, I thought it was to give someone to call these permissions. After testing, I found out that this TM is the opposite.

 

[ Key points ] The scope of the selected permissions here refers to the above permissions that have been applied for for users. Without authorized employees, we cannot have access to any information about employees. If we want to read, we can only enable them for employees.

I think DingTalk should be set up for the protection of company employee information, but what I developed is a small program for internal management of the company, so I should be [All employees] here.

Guess you like

Origin blog.csdn.net/peng2hui1314/article/details/105122019