http://www.kuaipan.cn/developers/document_apidocview.htm
/fileops/documentView
接口说明
文档转换
接口协议
HTTP GET
接口URL
http://conv.kuaipan.cn/1/fileops/documentView
接口参数
Name | Required | Type and Limit | Description |
---|---|---|---|
<oauth 参数> | Y | - | 参考<表-oauth参数> |
type | Y | enum() | 文档的类型,支持格式如下:'pdf', 'doc', 'wps', 'csv', 'prn', 'xls', 'et', 'ppt', 'dps', 'txt', 'rtf' |
view | Y | enum() | 视图格式,下面的参数会影响在浏览器显示的效果(页面大小和排版):'normal' - 假如是PC浏览器的话请选择这个;'android' - android客户端请选择这个;'iPad' - iPad客户端的请选择这个;'iphone' - iphone客户端。 |
zip | N | enum(0,1) | 默认 0 - 不压缩,返回的是一个html页面;1 - 返回一个zip的压缩包,里面包含文档转换后的html页面。 |
root | Y | string | kuaipan或者app_folder |
path | Y | string | 相对于root的路径,要转换的文档的位置 |
支持格式
('pdf', 'doc', 'wps', 'csv', 'prn', 'xls', 'et', 'ppt', 'dps', 'txt', 'rtf')
请求示例
http://conv.kuaipan.cn/1/fileops/documentView?<其他oauth参数>&root=kuaipan&path=1.wps&type=wps&view=android&zip=1
接口返回
若HTTP状态码为200,消息体即文件内容。
Name | Required | Type and Limit | Description |
---|---|---|---|
file | Y | binary | 文件内容 |
若HTTP状态码不是200,HTTP status code 和 msg的可能值(JSON格式)
status | msg | Description |
---|---|---|
302 | - | 文件在另外的服务器上,请处理好跳转 |
401 | - | 授权失败,参考附录-MSG定义-401类 |
403 | - | 授权失败 |
404 | file not exist | 文件不存在 |
5XX | 服务器暂时不可用 |