通过 JavaScript 中的 jQuery 邀请成员加入共享文件夹
$.ajax({
url: 'https://api.dropboxapi.com/2/sharing/add_folder_member',
type: 'POST',
processData: false,
data: JSON.stringify({"shared_folder_id": "84528192421","members": [{"member": {".tag": "email","email": "justin@example.com"},"access_level": {".tag": "editor"}},{"member": {".tag": "dropbox_id","dropbox_id": "dbid:AAEufNrMPSPe0dMQijRP0N_aZtBJRm26W4Q"},"access_level": {".tag": "viewer"}}],"quiet": false,"custom_message": "Documentation for launch day"}),
contentType: 'application/json',
headers: {
"Authorization": "Bearer <ACCESS_TOKEN>"
},
success: function(data) {
console.log(data);
},
error: function(data) {
console.error(data);
}
})
<ACCESS_TOKEN>
应替换为 OAuth 2 访问令牌。