1

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)

Any and all help is appreciated, Thank you!

jash
  • 21
  • 2

2 Answers2

1

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.

Zhong Wu
  • 1,721
  • 1
  • 8
  • 9
  • I seem to be getting the same error... It initially said the folder was not found and after I input the "parent" data into the json (including the folder id) I got the same error as before... – jash May 27 '22 at 17:37
  • 1
    Ok, now I saw the issue, the API I suggested only works for normal file under BIM 360 or ACC, like "items:autodesk.bim360:File", "items:autodesk.core:File", but does not work for "'items:autodesk.bim360:C4RModel" unfortunately. – Zhong Wu May 29 '22 at 02:03
  • Sad............ – jash May 31 '22 at 16:03
0

I tried Zhong Wu's answer and it works for C4RModels (I would post a comment, but I don't have enough reputation). These are the steps I took:

rchen
  • 9
  • 2