创建追加文件_文档_BIMFACE_BIM应用二次开发平台

API:创建追加文件

POST  https://file.bimface.com/appendFiles

进行断点续传前,先创建追加文件。


请求(Request)

Header
key value 示例
Authorization bearer {accessToken} bearer xxxx-xxxx-xxxx-xxxx
Content-Type application/json
Url Parameter
字段 类型 必填 描述 示例
name String Y 文件的全名,使用URL编码(UTF-8),最多256个字符 testA.rvt
sourceId String N 调用方的文件源ID,不能重复 988971984749344
length Number Y 上传文件长度 1024
Request Body

curl -X POST 
-H "Authorization: bearer <your accessToken>" 
-H "Content-Type: application/json" 
"https://file.bimface.com/appendFiles?name={name}&sourceId={sourceId}&length={length}"

响应(Response)

HTTP STATUS

200

成功返回
{
    "code": "success",
    "message": null,
    "data": [{
        "appendFileId": 1199714943746080,
        "length": 295,
        "name": "testA.rvt",
        "position": 0,
        "status": "notstart",
        "createTime": "2017-10-17 09:21:59"
	}]
}
字段 类型 描述 示例
appendFileId Long append file id
length Long 文件长度
name String 文件名
position Long 追加上传位置
status String 追加文件状态 notstart、uploading、pause、complete
createTime String 追加文件创建时间
失败返回
{
    "code": "authentication.failed",
    "message": "Token was not recognized."
}
错误码
code 说明
system.error BIMFACE系统异常
authentication.failed API访问合法性校验失败
file.name.invalid 文件名称不合法
file.type.not.support 文件类型不支持
file.length.invalid 文件长度不合法
sourceid.invalid source id不合法