API:生成分享链接
POST https://api.bimface.com/share
文件发起转换以后,可以根据fileId生成该文件的分享链接;
或者发起集成模型以后,可以根据integrateId生成集成模型的分享链接。
请求(Request)
Header
key |
value |
示例 |
Authorization |
bearer {accessToken} |
bearer xxxx-xxxx-xxxx-xxxx |
Content-Type |
application/json |
… |
Url Parameter
字段 |
类型 |
必填 |
描述 |
示例 |
fileId |
Number |
N (集成ID二选一) |
文件ID |
939399696195776 |
integrateId |
Number |
N (文件ID二选一) |
集成ID |
987520519940704 |
activeHours |
Number |
N |
有效时长,单位:小时,如果不设置表示永久有效 |
12 |
Request Body
无
curl -X POST
-H "Authorization: bearer <your accessToken>"
-H "Content-Type: application/json"
"https://api.bimface.com/share?fileId=<your fileId>&activeHours=<set your activeHours>"
curl -X POST
-H "Authorization: bearer <your accessToken>"
-H "Content-Type: application/json"
"https://api.bimface.com/share?integrateId=<your integrateId>&activeHours=<set your activeHours>"
响应(Response)
HTTP STATUS
200
成功返回
{
"code": "success",
"message": null,
"data": {
"url":"https://api.bimface.com/preview/3ae4edc9",
"expireTime":"2016-05-01 01:11:11"
}
}
失败返回
{
"code": "authentication.failed",
"message": "Token was not recognized."
}
错误码
code |
说明 |
system.error |
BIMFACE系统异常 |
authentication.failed |
API访问合法性校验失败 |
file.not.found |
文件不存在 |
file.has.not.translated |
文件未发起转换,不能被分享 |
integration.not.found |
集成未找到,不能分享 |