Self hosted REST API file upload - Azure

Hi - we’re using self hosted on an Azure instance and I’m trying to create assets via the REST API.

I’m able to create a new asset and receive an endpoint to upload to however, I’m struggling via a POST request to upload a file. My request is along the lines of…

POST /v1/assets/480/files HTTP/1.1
Authorization: Bearer [API_KEY]
Content-Length: 622856
Content-Type: multipart/form-data
Host: ion.myCompany.com
User-Agent: HTTPie

--PieBoundary123456789012345678901234567
Content-Disposition: form-data; name="data"; filename="C:/TestUpload.gltf"
Content-Type: 


--PieBoundary123456789012345678901234567--

However I receive HTTP/1.1 204 No Content on when I post. Is there a specific key name needed for the filePath to upload in this instance?

Self hosted API just says “upload” - so some clarity on this would be most appreciated given it’s self hosted rather than SaaS and on Azure rather than AWS

Self Hosted API Link

Hey! so it looks like everything is working as expected. The 204 No Content message is expected when upload is complete. The last step you should need to do is to tell self-hosted that the file upload is complete. To do that just run a POST on …/v1/assets/{assetID}/uploadComplete. This should also return a 204 with No Content. Once that happens you should see that a tiling job for that asset ID has been kicked off in self-hosted.

The general flow should be.

  • POST to /v1/assets to get the upload URL
  • POST to the upload URL and wait for a 204 response
  • POST to the /uploadComplete URL to tell self-hosted that it is done

It should be pretty much the same process between self-hosted and SaaS, the only difference being the URL that you are uploading to will be a local URL and not an S3 bucket. The one thing to note is that each file within the form data upload object should be represented as 'relative/path/to/file':"file stream". The photo below shows that section of the docs with the drop down expanded.

Let me know if this resolves your issue, if not we can troubleshoot further.

1 Like