Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename items in BIM 360 using autodesk forge

We are upgrading our revit projects from 2020 to 2022 and our revit file names end with the version they belong to for easy identification ( xxxx_R20.rvt) and we'd like to rename all the items in the project to xxxx_R22.rvt. I have been able to gather all the items, their names and their URNs for a patch... but the patch item throws an error saying :

{
    "jsonapi": {
        "version": "1.0"
    },
    "errors": [
        {
            "id": "5f1b5519-3118-4c43-80f4-97c412419acf",
            "status": "403",
            "code": "USER_NOT_AUTHENTICATED",
            "detail": "The client_id is not whitelisted for schema 'items:autodesk.bim360:C4RModel' access."
        }
    ]
}

The forge client id does have access to the account and has been used to make many other changes... I did try using the patch from versions to make the change to the name with no luck ... ( I receive the same error)

like image 247
jash Avatar asked Dec 06 '25 10:12

jash


1 Answers

You can not rename the file by PATCH item API, actually, you need to create a new version with the new file name, but you don't have to upload file again. Please try the following api:

POST /versions?copyFrom={tip_version_urn}

{
    "jsonapi": {
        "version": "1.0"
    },
    "data": {
        "type": "versions",
        "attributes": {
            "name": "newName"
        }
    }
}

A new tip version will be created and its properties - including source file - depends on the copyFrom version you provide, usually it is the tip version.

like image 176
Zhong Wu Avatar answered Dec 09 '25 16:12

Zhong Wu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!