简体   繁体   中英

How to PATCH a version of an item in BIM360 on Postman

https://forge.autodesk.com/blog/how-patch-apis-work-and-some-tips-using-patch-apis

https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-version_id-PATCH/

I have followed the two links above explaining how to PATCH a version of an item and update the name of it but I am getting errors. Below is what I inputted into Postman ( version_id inside the URI has been already encoded):

URI: https://developer.api.autodesk.com/data/v1/projects/:project_id/versions/:version_id

Authorization: Bearer *****************************

Content-Type: application/vnd.api+json

Body:

{
    "jsonapi": { 
        "version": "1.0" 
    }, 
    "data": { 
        "type": "versions",
        "id": *********************************************,
        "attributes": {
            "name": "AAA - My PDF file.pdf",
            "displayName": "AAA - My PDF file.pdf"
        }
    }
}

The item version I am trying to update is already named AAA - My PDF file.pdf so nothing should be updated. But when I send the request I get the following error.

Error:

{
    "jsonapi": {
        "version": "1.0"
    },
    "errors": [
        {
            "id": "30043cce-cfbe-4766-933c-fd9d888e574d",
            "status": "400",
            "code": "BAD_INPUT",
            "title": "One or more input values in the request were bad",
            "detail": "Request input is invalid for this operation."
        }
    ]
}

Are there any ideas why I am getting this error and how can I fix it?

Unfortunately at the moment PATCHing for BIM360 Doc items is unsupported and hence the error. The error message could have been more specific rather than a general validation failure message and I will let Engineering know to update accordingly.

Try PATCHing with A360 hub and it should work as expected.

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