Is it possible to use API calls to communicate with Orchestrator Storage Buckets? Specifically adding files to a existing bucket or creation of new buckets?
There are no documentation regarding bucket requests in the API documentation.
Thanks. Swagger helped a bit, but I’m still struggling with finding out how to upload a file into a existing bucket. Specifically the path parameter of the GetWriteUri request. I can make the request if I fx type “Test” in the path parameter and then I get a blob URI, but I dont know what to do with this.
After calling UiPath.Server.Configuration.OData.GetWriteUri you get a Response containing a URI and Verb to make your second request. The File is then attached to the PUT Request as a Binary and sent to the Uri obtained from the first GET request.
A good way to determine what the API calls are if it is not well documented in the Support Docs or Swagger is to Inspect your Network Traffic while taking the actions in your Browser with the Orchestrator Web UI.
Thanks a lot! I got a lot further, but I am still missing something.
I get that it is two separate API calls now, and I managed to figure out how to upload the file into a storage bucket.
However I think I need something in relation to the path param in the GET request. I can successfully upload a .xlsx file to the bucket, but it is just a blank file. I need to refer to a file locally on my desktop as you can in the Orchestrator Web UI. So right now I am basically just creating a blank file on the blob instead of uploading a local file to the blob.
Can you see what I am missing here? I guess it maybe has something to do with the “track” line in the network traffic inspector, which is making a POST to dc.services.visualstudio.com/v2/track?
Is the header needed? In my limited testing my Text and EXE file uploads I did not require any special headers. Downloading the files again the files were intact.
Found this other topic on the same, in their solution they are also not passing any headers in the PUT.
When I try it is needed, otherwise a get a response like this:
<?xml version="1.0" encoding="utf-8"?>
<Error>
<Code>MissingRequiredHeader</Code>
<Message>An HTTP header that's mandatory for this request is not specified.
RequestId:ad410e3f-a01e-0061-3c29-037209000000
Time:2022-01-06T18:13:41.5818119Z</Message>
<HeaderName>x-ms-blob-type</HeaderName>
</Error>
Nevertheless, I tried the binary PUT request and I was able to upload the file successfully - so thanks for your help