Creating collaboration for user's email alias (or new user for that matter)
The documentation for Create Collaboration indicates that an error will be thrown if the user ID is invalid.
What about the case where we are collaborating a new user, who is not in Box yet? We ran into this recently with a demo application, our new collaboration failed because we were using a user's email alias rather than their official email address. Presumably, aliases should work, so there must be some mistake with their corporate settings. But the bigger question came up of how should we build apps that might collaborate in brand new users? This would be quite common for external facing applications.
-
Hi there,
I believe you could use "login" instead of "id" if the user doesn't exist in box as it says in doc:
Child of accessible_by. An email address (does not need to be a Box user). Omit if this is a group, or if you include the userID above
e.g request:
curl https://api.box.com/2.0/collaborations \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"item": { "id": "FOLDER_ID", "type": "folder"}, "accessible_by": { "login": "***@example.com", "type": "user" }, "role": "editor"}' \ -X POST
When you do that it sends collaboration invite instead.
Let me know if that helps.
Thanks,
Bibek
サインインしてコメントを残してください。
コメント
1件のコメント