我需要将文件从我的帐户上传到 Dropbox 团队帐户。我做不到。我从中获得了 ACCESS_TOKEN
,我需要调用该 API 才能在团队帐户中上传文件。
我正在使用以下方法:
var dbxTeam = new DropboxTeam({ accessToken: ACCESS_TOKEN });
但我无法在 JSON 中找到团队用户详细信息。
我不知道如何在 UI5 中使用 Dropbox 文档中列出的 API。
https://www.dropbox.com/developers/documentation/http/teams
我引用上面的链接。
但是我无法理解获取团队成员列表的 URL 结构,
/设备/list_member_devices。将它与 ACCESS_TOKEN
组合传递到哪里?
我无法理解上面 URL 中的以下代码。
curl -X POST https://api.dropboxapi.com/2/team/devices/list_member_devices \
--header "Authorization: Bearer <get access token>" \
--header "Content-Type: application/json" \
--data "{\"team_member_id\": \"dbmid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I\",\"include_web_sessions\": true,\"include_desktop_clients\": true,\"include_mobile_clients\": true}"
我拥有我的 ID、UID 和团队 ID 的 ACCESS_TOKEN,如何从中获得团队成员列表?
提前致谢。
最佳答案
curl 是一个发送 http 请求的命令行工具。在 UI5 中,jQuery 将为您完成这项工作。我将尝试为您翻译下面的请求,但未经测试。
var token = "Your access token";
var requestJSON = {
"team_member_id": "your team Id",
"include_web_sessions": true,
"include_desktop_clients": true,
"include_mobile_clients": true
};
var successCallbackFunction = function(data, textStatus, jqXHR) {
// process team list member data here
// results stored in data
}
jQuery.ajax( "https://api.dropboxapi.com/2/team/devices/list_member_devices", {
method: "POST",
contentType: "application/json",
headers: {
Authorization: "Bearer " + token
},
data: requestJSON,
success: successCallbackFunction
} )
关于javascript - Dropbox 与 UI5 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39481701/