試圖使用新API下載文件。但是,我得到一個錯誤(NOTFOUND)Box API 2.0下載文件
隨着舊的API,我下載罰款:
wcGetFile.DownloadStringAsync(new Uri("https://www.box.net/api/1.0/download/" + auth_token + "/2111821875"));
有了新的API,這是我的代碼:
wcGetFile.Headers[HttpRequestHeader.Authorization] = "BoxAuth api_key=" + api_key + "&auth_token=" + auth_token;
wcGetFile.DownloadStringAsync(new Uri("https://api.box.com/2.0/files/2111821875/data"));
該文件不存在,因爲如果我從我的電話結束時刪除「數據」我得到的文件信息沒有錯誤。
wcGetFile.Headers[HttpRequestHeader.Authorization] = "BoxAuth api_key=" + api_key + "&auth_token=" + auth_token;
wcGetFile.DownloadStringAsync(new Uri("https://api.box.com/2.0/files/2111821875"));
根據文檔,信息和實際文件的唯一區別是url的'data'部分。但這似乎並不適用於我。
我已嘗試改變,但我得到了同樣的錯誤。 – zawisza