使用V2 Box API:如何获取用户ID [英] using the v2 box api: how do I get a user id
本文介绍了使用V2 Box API:如何获取用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用v2 api添加协作-但需要用户ID。如果我只有登录名,该如何获取用户ID?
I want to add a collaboration using the v2 api - but it requires a user id. How do I get the user id if all I have is the login name?
推荐答案
添加协作者时,您可以发送任何一个用户ID或用户的电子邮件地址:
When adding a collaborator, you can send either the user id or the user's email address:
ie两者
curl https://api.box.com/2.0/collaborations \-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{"item": { "id": "FOLDER_ID", "type": "folder"}, "accessible_by": { "id": "USER_ID"}, "role": "editor"}' \
-X POST
和
curl https://api.box.com/2.0/collaborations \-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{"item": { "id": "FOLDER_ID", "type": "folder"}, "accessible_by": { "login": "USER_EMAIL"}, "role": "editor"}' \
-X POST
将起作用。在第二个示例中,用户不必具有Box帐户。
will work. In the case of the second example, the user doesn't have to have a Box account.
http://developers.box.com/docs/#collaborations-add-a-collaboration
这篇关于使用V2 Box API:如何获取用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文