我想使用v2 api添加协作 - 但它需要用户ID。如果我拥有的只是登录名,我如何获得用户ID?
答案 0 :(得分:2)
添加协作者时,您可以发送用户ID或用户的电子邮件地址:
即。两个
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帐户。
http://developers.box.com/docs/#collaborations-add-a-collaboration