0

I am attempting to write some additional functionality to support an already-working application that uses the Data Management, Model Derivative, and Viewer APIs. It does not create versions of files in a Project, because that functionality did not exist when it was written.

Right now we support uploading a file which uploads it to Forge. We store the response from Forge and use that again to get the Viewer working.

The PUT buckets/:bucketKey/objects/:objectName API takes an Object Name for an "upload new version" functionality.

However, the API returns ObjectId, ObjectKey, and ObjectUrn, none of which work for ObjectName in a round trip (I always get 412), and I cannot seem to get anything but 404's from the Get Object API.

I'm using the C# Library in NuGet.

What am I missing?

Broam
  • 4,602
  • 1
  • 23
  • 38

1 Answers1

1

It seems that the file was deleted automatically due to the bucket policy. Please check OSS Retention Policy here. If your bucket policy is either Transient or Temporary, your uploaded files will be removed by the preconfigured time.

In addition, to download an object via forge-api-dotnet-client#GetObject, the object name is the same value as you passed to UploadObject. In the response payload, you can see it here:

{
  "bucketKey" : "mybucket",
  "objectId" : "urn:adsk.objects:os.object:mybucket/example.txt",
  "objectKey" : "example.txt",                                   //!<<<< The object name
  "sha1" : "cc2071e3c3a0e95ec68c599ccac6f8caa012677e",
  "size" : 525,
  "contentType" : "text/plain; charset=UTF-8",
  "location" : "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/example.txt"
}
Eason Kang
  • 6,155
  • 1
  • 7
  • 24
  • Bucket was almost certainly set to persistent. How do I check? It's a very old bucket – Broam Mar 23 '20 at 12:15
  • Call https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-details-GET/ to check bucket details – Eason Kang Mar 23 '20 at 13:57