23 Apr 2025

Invalid storage urn

Here is an error I did not see before - see also pic of the blog post:

{
  "jsonapi":{
    "version":"1.0"
  },
  "errors":[{
    "id":"17db51db-07ea-488f-a57b-bfd1b6851de5",
    "status":"400",
    "code":"ERR_INVALID_STORAGE_URN",
    "title":"Invalid storage urn",
    "detail":"N/A"
  }]
}

The error was returned for "POST /items" with this body:

{
  "jsonapi": {
    "version": "1.0"
  },
  "data": {
    "type": "items",
    "attributes": {
      "displayName": "acc-upload-test.txt",
      "extension": {
        "type": "items:autodesk.bim360:File",
        "version": "1.0"
      }
    },
    "relationships": {
      "tip": {
        "data": {
          "type": "versions",
          "id": "1"
        }
      },
      "parent": {
        "data": {
          "type": "folders",
          "id": "urn:adsk.wipprod:fs.folder:co.UsB53XBJRImqqduVL3GDKA"
        }
      }
    }
  },
  "included": [
    {
      "type": "versions",
      "id": "1",
      "attributes": {
        "name": "acc-upload-test.txt",
        "extension": {
          "type": "versions:autodesk.bim360:File",
          "version": "1.0"
        }
      },
      "relationships": {
        "storage": {
          "data": {
            "type": "objects",
            "id": "urn:adsk.objects:os.object:wip.dm.prod/46941889-a7ff-4409-a0a0-164129873501.txt"
          }
        }
      }
    }
  ]
}

When getting this error, it does not necessarily mean that the string you provided for "storage.data.id" is incorrect (e.g. there is a spelling mistake in it), but that the file referenced by the urn is not valid: e.g. you created the storage, you started uploading the file, but did not call "POST /signeds3upload" to complete the upload, i.e. missed this step: https://aps.autodesk.com/en/docs/data/v2/tutorials/upload-file/#step-6-complete-the-upload 

Related Article