发起模型集成_文档_BIMFACE_BIM应用二次开发平台

API:发起模型集成

PUT https://api.bimface.com/integrate

对于revit文件来说,当单个文件转换成功以后,可以将多个revit文件集成,生成一个全专业/楼层模型。由于集成不能立即完成,BIMFACE支持在模型集成完成以后,通过Callback机制通知调用方;另外,调用方也可以通过接口查询集成状态。


请求(Request)

Header
key value 示例
Authorization bearer {accessToken} bearer xxxx-xxxx-xxxx-xxxx
Content-Type application/json
Url Parameter

Request Body
{
    "sources": [
        {
            "fileId": 9220020202001,
            "specialty": "AR",
            "specialtySort": 0.1,
            "floor": "F01",
            "floorSort": 0.1
        },
        {
            "fileId": 9220020202002,
            "specialty": "AR",
            "specialtySort": 0.1,
            "floor": "F02",
            "floorSort": 0.2
        }
    ],
    "sourceId":"123456",
    "name":"我的合并模型",
    "priority": 2,
    "callback": "http://www.app.com/receive"
}
字段 类型 必填 描述 示例
sources Source[] Y 待集成的文件列表
source.fileId Number Y 待集成的源文件ID,必须是 rvt 文件 9220020202001
source.specialty String N 待集成源文件对应的专业名称 AR
source.specialtySort Number N 显示专业层次结构时,排序数值越小,排序越前 0.1
source.floor String N 待集成源文件对应的楼层名称 F01
source.floorSort Number N 显示楼层层次结构时,排序数值越小,排序越前 0.1
sourceId String N 调用方的源ID 857482189666208
name String N 调用方设置的名称 我的合并模型
priority Number 优先级,数字越大,优先级越低 1, 2, 3
callback String N Callback地址,待集成完毕以后,BIMFACE会回调该地址 http://www.app.com/receive
curl -X PUT
-H "Authorization: bearer <your accessToken>" 
-H "Content-Type: application/json" 
-d '{
    "sources": [
        {
            "fileId": 9220020202001,
            "specialty": "AR",
            "specialtySort": 0.1,
            "floor": "F01",
            "floorSort": 0.1
        },
        {
            "fileId": 9220020202002,
            "specialty": "AR",
            "specialtySort": 0.1,
            "floor": "F02",
            "floorSort": 0.2
        }
    ],
    "sourceId":"123456",
    "name":"我的合并模型",
    "priority": 2,
    "callback": "http://www.app.com/receive"
}'
"https://api.bimface.com/integrate"

响应(Response)

HTTP STATUS

200

成功返回
{
    "code": "success",
    "message": null,
    "data": {
        "integrateId": 85929027838566,
        "name": "我的合并模型",
        "status": "processing",
        "priority":2,
        "thumbnail":null,
        "reason": null,
        "createTime": "2015-08-08 12:23:11"
    }
}

字段 类型 描述 示例
integrateId Number 集成Id 85929027838566
name String 调用方设置的名称 我的合并模型
status String 集成状态 processing(集成中)、success(集成成功)、failed(集成失败)
priority Number 优先级,数字越大,优先级越低 1, 2, 3
thumbnail String[] 缩略图地址
reason String 若集成失败,返回失败原因
createTime String 集成开始时间,格式:yyyy-MM-dd hh:mm:ss 2015-08-08 12:23:11
失败返回
{
    "code": "authentication.failed",
    "message": "Token was not recognized."
}
错误码
code 说明
system.error BIMFACE系统异常
authentication.failed API访问合法性校验失败
input.parameter.error 输入的参数有误
priority.not.support 不支持输入的优先级
url.invalid 回调地址不是正确的URL
file.not.found 文件不存在
file.type.not.support 不支持当前文件发起集成,目前仅支持revit文件
file.has.not.translated 文件没有发起转换,不能集成
file.is.translating 文件正在转换中,不能集成
file.translate.failed 文件转换失败,不能集成

回调(Callback)

待集成完毕后,根据调用方传入的回调地址,BIMFACE会通知结果。

Method

GET

Header
key value 示例
Content-Type application/json
Url Parameter
字段 类型 描述 示例
integrateId Number 集成Id 85929027838566
status String 集成的结果 success(集成成功)、failed(集成失败)
reason String 若集成失败,则返回失败原因
thumbnail String 缩略图地址
nonce String 回调随机数
signature String 签名

signature(签名):为了确保回调消息是由BIMFACE发出的,调用方在收到回调消息后,须验证签名。签名的计算方式:MD5(“appKey:appSecret:integrateId:status:nonce”),如果调用方计算的签名与BIMFACE返回的签名一致,则证明该消息是安全可靠的。

消息回执

调用方收到回调后,须向BIMFACE发送回执,回执消息:HTTP STATUS 200