简体   繁体   中英

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

I'm using Forge DesignAutomation API to update Revit models on BIM360. All goes well, until I wish to create a new version on BIM360 for the Revit model that was returned by the DesignAutomation app. For many Revit files (but not all: seemingly the items that have an included.attributes.mimeType attribute listed when calling GET item ), the Forge server returns the following 400 BadRequest error:

{
    "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."
        }
    ]
}

To create the new item version, I follow the example as shown here . This sends a request with the following body to the versions end point as explained 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"
                }
            }
        }
    }
}

How can I fix this issue? Should I change something in the POST request when creating the new Item Version, or does the problem lie with how the new Revit model is created by the DesignAutomation app?

Thanks for any help!

Edit: I had the impression myself that in the past I did not have this issue. This has been confirmed by someone else for a different app as well now. Could it be that there has been an update to the Forge API that lies at the source of this issue? Nevertheless, I did find another person mentioning it in February , unfortunately unresolved...

Edit: Here is part of the json response (from GET item ) for a Revit model producing the error, showing the 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"
                    }
                }
            },
    [...]
]

Here is the same json block for the item produced by the DesignAutomation app from the item above, and which I want to add as a new version:

"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"
                    }
                }
            },
      [...]
]

The version you created without mimeType is ok since you cannot create this type of item/version.

The item with mimeType application/vnd.autodesk.r360 means that this model is a published model of your Revit cloud worksharing model . Unfortunately, there is no way to create/append version to such kind of item/version via Forge API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM