在Box请求中使用按用户 [英] Using As-User in Box Request
问题描述
我试图使Box Enterprise API能够按用户使用。我有一个管理员帐户,我曾尝试尝试在子帐户中检索目录。
I was trying to make Box Enterprise API work using As-User. I have a admin account which i used to try to retrieve the Contents in a sub account.
我首先使用管理员帐户来检索子帐户的用户ID。并将用户ID添加为按用户:########字段。但是,我得到的答复是403。
I first used the admin account to retrieve the User ID of the sub account. And added the User ID as a field "As-User: ########". However, I was returned with a reply of 403.
错误消息:该请求需要比访问令牌提供的特权更高的特权。
The error message : "The request requires higher privileges than provided by the access token."
我正在使用我用来检索用户列表的访问令牌。我是否必须使用作为新用户来获得新的访问令牌?或管理员访问令牌可以吗?
I am using the access token i had used to retrieve the user list. Do I have to get a new access token using the as the new user? or is the admin access token fine?
GET /2.0/folders/0/items HTTP/1.1\r
Host: api.box.com\r
Authorization: Bearer #######################\r
As-User: ########\r
Connection: close\r
\r
访问代码与用于检索用户列表/ user的访问代码相同
The access code is the same access code used to retrieve the user list /user
已检查所有范围
推荐答案
您的申请必须由Box手动批准,用于按用户
的请求。文档内容,但是很容易错过。要开始批准过程,请发送框注释并包括您的API密钥。
Your application must be manually approved by Box for As-User
requests. The documentation mentions this but it's easy to miss. To start the approval process send Box a note and include your API Key.
这篇关于在Box请求中使用按用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!