Box API 2.0下载文件 [英] Box API 2.0 downloading file

查看:121
本文介绍了Box API 2.0下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用新的API下载文件。但是出现错误(NotFound)

Trying to use the new API to download a file. But am getting an error (NotFound)

使用旧API我下载得很好:

With the old API i downloaded fine:

wcGetFile.DownloadStringAsync(new Uri("https://www.box.net/api/1.0/download/" + auth_token + "/2111821875"));

使用新的API,这是我的代码:

With the new API this is my code:

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"));

文件确实存在,因为如果我从通话结束时删除数据,我会得到文件信息,没有错误。

The file does exist because if i remove the "data" from the end of my call i get the file info with no errors.

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"));

根据文档,信息和实际文件之间的唯一区别是网址。但这似乎对我不起作用。

According to the documentation the only difference between the info and the actual file is the 'data' part of the url. But that does not seem to work for me.

推荐答案

看来我们正在遇到一个小错误,它阻止了下载。如果您使用 https://www.box.com/而不是 https://api.box.com/,则下载应该可以进行。但是,我们正在努力修复该错误!

It looks like we're experiencing a minor bug on our end that's preventing downloads. If you use 'https://www.box.com/' instead of 'https://api.box.com/' the download should work. We're working on fixing the bug right now, however!

这篇关于Box API 2.0下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆