2016-09-14 1 views
1

내 계정에서 보관 용 계정으로 파일을 업로드해야합니다. 나는 그것을 할 수 없다. 나는 ACCESS_TOKEN에서 팀 계정으로 파일을 업로드하는 데 필요한 API가 필요합니다.Dropbox와 UI5의 통합

나는 다음과 같은 방법을 사용하고 있습니다 :

var dbxTeam = new DropboxTeam({ accessToken: ACCESS_TOKEN }); 

을하지만 JSON에서 팀 사용자 세부 정보를 찾기 위해 수 수 없습니다.

UI5의 Dropbox 설명서에 나열된 API를 사용하는 방법을 모르겠습니다.

https://www.dropbox.com/developers/documentation/http/teams

나는 위의 링크를 참조하십시오.

그러나 팀원 목록을 가져 오기위한 URL 구조를 이해할 수 없으므로, /devices/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을 (를) 가지고 있는데 팀 구성원 목록을 어떻게 가질 수 있습니까?

미리 감사드립니다.

답변

0

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 
}) 
+0

작은 수정 사항 중 하나 인'requestJSON'을 JSON.stringify()해야합니다. – Greg

관련 문제