VER_MISMATCH_MIMETYPE 使用 Forge Data Management 在 BIM 360 中创建新项目版本时出错 API

VER_MISMATCH_MIMETYPE error when creating new item version in BIM360 with Forge DataManagement API

我正在使用 Forge DesignAutomation API 在 BIM360 上更新 Revit 模型。一切顺利,直到我希望在 BIM360 上为 DesignAutomation 应用程序返回的 Revit 模型创建一个新版本。对于许多 Revit 文件(但不是全部:调用 GET item 时似乎列出了具有 included.attributes.mimeType 属性的项目),Forge 服务器 returns 以下 400 BadRequest 错误:

{
    "jsonapi": {
        "version": "1.0"
    },
    "errors": [
        {
            "id": "37a8316e-661f-4ef0-9efd-121836bf27f1",
            "status": "400",
            "code": "ERR_WIP_ERROR",
            "title": "VER_MISMATCH_MIMETYPE",
            "detail": "The new version's MIME type must match the previous version's MIME type."
        }
    ]
}

要创建新的项目版本,我按照 here 所示的示例进行操作。 这会将带有以下正文的请求发送到版本端点,如 here:

所述
{
    "jsonapi": {
        "version": "1.0"
    },
    "data": {
        "type": "versions",
        "attributes": {
            "name": "SomeModelName.rvt",
            "extension": {
                "type": "versions:autodesk.bim360:File",
                "version": "1.0"
            }
        },
        "relationships": {
            "item": {
                "data": {
                    "type": "items",
                    "id": "urn:adsk.wipprod:dm.lineage:FPh4mXHCTluhI-xxxxxxxx"
                }
            },
            "storage": {
                "data": {
                    "type": "objects",
                    "id": "urn:adsk.objects:os.object:wip.dm.prod/3db6fe47-xxxx-xxxx-xxxx-xxxxxxxxx.rvt"
                }
            }
        }
    }
}

我该如何解决这个问题?在创建新项目版本时,我是否应该更改 POST 请求中的某些内容,或者问题是否在于 DesignAutomation 应用程序如何创建新 Revit 模型?

感谢您的帮助!

编辑:我自己的印象是,过去我没有遇到过这个问题。现在,其他人也已针对其他应用程序确认了这一点。难道是这个问题的根源是 Forge API 的更新?尽管如此,我确实找到了another person mentioning it in February,不幸的是未解决...

编辑:这是产生错误的 Revit 模型的 json 响应(来自 GET item)的一部分,显示 mimeType“application/vnd.autodesk.r360”:

"included": [
        {
            "type": "versions",
            "id": "urn:adsk.wipprod:fs.file:vf.FPh4mXHCTluhI-xyzxyzxyz?version=1",
            "attributes": {
                "name": "RevitModel.rvt",
                "displayName": "RevitModel.rvt",
                "createTime": "2021-07-09T12:18:24.0000000Z",
                "createUserId": "xyz",
                "createUserName": "xyz",
                "lastModifiedTime": "2021-07-09T12:18:25.0000000Z",
                "lastModifiedUserId": "xyz",
                "lastModifiedUserName": "xyz",
                "versionNumber": 1,
                "mimeType": "application/vnd.autodesk.r360",
                "storageSize": 491300637,
                "fileType": "rvt",
                "extension": {
                    "type": "versions:autodesk.bim360:C4RModel",
                    "version": "1.1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:C4RModel-1.1.0"
                    },
                    "data": {
                        "modelVersion": 1475,
                        "isCompositeDesign": true,
                        "mimeType": "application/vnd.autodesk.r360",
                        "compositeParentFile": "RevitModel.rvt",
                        "projectGuid": "some-guid",
                        "originalItemUrn": "urn:adsk.wipprod:dm.lineage:xyzxyzxyzxyz",
                        "modelType": "multiuser",
                        "latestEpisodeGuid": "some-guid",
                        "modelGuid": "some-guid",
                        "processState": "PROCESSING_COMPLETE",
                        "extractionState": "SUCCESS",
                        "splittingState": "NOT_SPLIT",
                        "reviewState": "NOT_IN_REVIEW",
                        "revisionDisplayLabel": "1",
                        "sourceFileName": "RevitModel.rvt"
                    }
                }
            },
    [...]
]

这是 DesignAutomation 应用程序从上面的项目生成的项目的相同 json 块,我想将其添加为新版本:

"included": [
        {
            "type": "versions",
            "id": "urn:adsk.wipprod:fs.file:vf.X5m1BYxDRw-xyzxyzxyz?version=1",
            "attributes": {
                "name": "RevitModel.rvt",
                "displayName": "RevitModel.rvt",
                "createTime": "2021-08-06T12:25:13.0000000Z",
                "createUserId": "xyz",
                "createUserName": "xyz",
                "lastModifiedTime": "2021-08-06T12:34:10.0000000Z",
                "lastModifiedUserId": "xyz",
                "lastModifiedUserName": "xyz",
                "versionNumber": 1,
                "storageSize": 198492160,
                "fileType": "rvt",
                "extension": {
                    "type": "versions:autodesk.bim360:File",
                    "version": "1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:File-1.0"
                    },
                    "data": {
                        "processState": "PROCESSING_COMPLETE",
                        "extractionState": "SUCCESS",
                        "splittingState": "NOT_SPLIT",
                        "reviewState": "NOT_IN_REVIEW",
                        "revisionDisplayLabel": "1",
                        "sourceFileName": "RevitModel.rvt"
                    }
                }
            },
      [...]
]

你创建的没有mimeType的版本是可以的,因为你不能创建这种类型的item/version。

mimeType 为 application/vnd.autodesk.r360 的项目表示此模型是 published model of your Revit cloud worksharing model。不幸的是,无法通过 Forge API.

将 create/append 版本转换为此类 item/version