0

I want to send a PATCH request using Autodesk Construction Cloud (ACC) API using Workato to update an attribute of a file/document (E.g.: displayName) but keep encounter a 400 error:

One or more input values in the request were bad\",\"detail\":\"Request input is invalid for this operation.

to refer to the image below of the error:

Error 400: One or more input values in the request were bad

but referring to the ACC api documentation

I'm already doing it as per the documentation still encounter 400 error no matter what

Below is the screenshot of how I do the PATCH request in Postman which still also encounter the 400 error:

Sending a patch request but encounter 400 error

Headers for the request in Postman

curl -v
'https://developer.api.autodesk.com/data/v1/projects/:project_id/items/:item_id'  
-X 'PATCH'  
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'  
-H 'Content-Type: application/vnd.api+json'  
-d '{
        "jsonapi": {
          "version": "1.0"
        },
        "data": {
          "type": "items",
          "id": ":item_id",
          "attributes": {
            "displayName": "new name for drawing.dwg"
          }
        }
      }'

What is the correct way to do the PATCH request?

Eason Kang
  • 6,155
  • 1
  • 7
  • 24

1 Answers1

0

Unfortunately, renaming via the PATCH endpoint doesn't support BIM360 & ACC files. To do so, please use the POST version instead.

curl --location 'https://developer.api.autodesk.com/data/v1/projects/{{projectId}}/versions?copyFrom={{encodedVerionId}}' \
--header 'Authorization: Bearer ...' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
  "jsonapi": {
    "version": "1.0"
  },
  "data": {
    "type": "versions",
    "attributes": {
      "name": "newName"
    }
  }
}'

Note. Both name and displayName will be updated to the newName.

See also:

Eason Kang
  • 6,155
  • 1
  • 7
  • 24
  • It works. Yes I am able to update attributes using POST as per your answer. Although it still confuses me why in documentation itself said that it support ACC. Thank you! – devathome98 Aug 30 '23 at 01:27
  • This endpoint indeed works with ACC, but we just cannot use it to change the file names. It supports changing folder names with this endpoint. – Eason Kang Aug 30 '23 at 06:11