获取文件转换的构件层次结构_文档_BIMFACE_BIM应用二次开发平台

API:获取文件转换的构件层次结构

GET https://api.bimface.com/data/hierarchy

获取单文件的所有构件类别、族和族类型树:1)获取1.0版本结果数据;2)获取2.0版本结果数据


请求(Request)

Header
key value 示例
Authorization bearer {accessToken} bearer xxxx-xxxx-xxxx-xxxx
Content-Type application/json
Url Parameter
字段 类型 必填 描述 示例
fileId Number Y 文件ID
v String N 结果数据版本:1.0(1.0版本结果数据)2.0(2.0版本结果数据) 1.0, 2.0, 默认为1.0数据
Request Body

curl -X GET 
-H "Content-Type: application/json" 
-H "Authorization: bearer <your accessToken>" 
"https://api.bimface.com/data/hierarchy?fileId=<your fileId> "

响应(Response)

HTTP STATUS

200

成功返回
v = 1.0(1.0版本结果数据)
{
    "code": "success",
    "message": null,
    "data": [
        {
            "categoryId": "-2000038",
            "categoryName": "天花板",
            "families": [
                {
                    "family": "复合天花板",
                    "familyTypes": [
                        "600 x 600mm Grid",
                        "Plain",
                        "Furred Ceiling"
                    ]
                }
            ]
        },
        {
            "categoryId": "-2001370",
            "categoryName": "环境",
            "families": [
                {
                    "family": "M_RPC Male",
                    "familyTypes": [
                        "Alex",
                        "Jay"
                    ]
                },
                {
                    "family": "M_RPC Female",
                    "familyTypes": [
                        "Florence"
                    ]
                }
            ]
        }
    ]
}
字段 类型 描述 示例
categoryId String 类别id -200001
categoryName String 类别名称
families families[] 族列表
family String 基本墙
familyTypes familyTypes[] 族类型列表

v = 2.0(2.0版本结果数据)
{
    "code": "success",
    "message": null,
    "data": [
        {
	"elementCount": 2,
	"id": "0",
	"items": [{
		"elementCount": 2,
		"id": "-2001340",
		"items": [{
			"elementCount": 2,
			"id": null,
			"items": [{
				"elementCount": 2,
				"id": "0",
				"items": [],
				"name": "-",
				"type": "familyType"
			}],
			"name": "None",
			"type": "family"
		}],
		"name": "地形",
		"type": "category"
	}],
	"name": "",
	"type": "floor"
	}
    ]
}
字段 类型 描述 示例
type String 节点类型 floor, specialty, category, family, familyType
id String 节点id,只有category节点类型有id -200001
name String 节点名称
elementCount Number 节点所包含的构件数量
items items[] 节点下的子节点列表
失败返回
{
    "code": "authentication.failed",
    "message": "Token was not recognized."
}
错误码
code 说明
system.error BIMFACE系统异常
authentication.failed API访问合法性校验失败
data.not.found 找不到数据