0
我目前正在建立一個例程,需要從一個特定的Dropbox文件夾下載文件,將它們發送到另一臺服務器,然後將它們移動到Dropbox上的另一個文件夾。Dropbox API - 錯誤:預計列表得到字典
我正在使用Dropbox的/files/move_batch
API端點來執行此操作。
這裏是發送到API的PARAMS移動倍數文件(以及我只是想現在移動一個文件,因爲它仍然沒有工作):
$params = array(
'headers' => array(
'method' => 'POST',
'content-type' => 'application/json; charset=utf-8',
),
'body' => json_encode(array(
'entries' => array(
'from_path' => self::$files[0],
'to_path' => '/Applications/Archives/' . substr(self::$files[0], strrpos(self::$files[0], '/') + 1),
),
'autorename' => true,
)),
);
但我不斷收到同樣的錯誤消息:
Error in call to API function "files/move_batch": request body: entries: expected list, got dict
我不知道什麼API意味着一個列表或它應該如何形成。
謝謝您的回答!現在我試圖找出如何構建條目參數與許多文件... – rak007