API to delete AND Transfer files
Answered[sorry for the cross posting; put it in the wrong forum initially]
I can delete users with the API, as long as they have no content or I force the content to be deleted. But is there a way in the API to delete the user and transfer to content to another user?
-
Hi,
You have to use this API: https://developer.box.com/v2.0/reference#move-folder-into-another-users-folder
curl https://api.box.com/2.0/users/USER_ID/folders/FOLDER_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"owned_by": {"id": "USER_ID"}}' \ -X PUT
Basically FOLDER_ID must be 0. Only supports rootfolder. This will move contents to another user ID, you can have user notified as well if you want.
And after that you can use delete API with "force" option.
force booleanWhether the user should be deleted even if this user still own files
Hope this helps.
thanks,
Bibek
Please sign in to leave a comment.
Comments
1 comment