- Getting Started
- Swagger Definition
- Orchestrator APIs
- Alerts Requests
- Assets Requests
- Calendars Requests
- Environments Requests
- Folders Requests
- Generic Tasks Requests
- Jobs Requests
- Libraries Requests
- License Requests
- Packages Requests
- Permissions Requests
- Personal Workspaces Requests
- Processes Requests
- Process Data Retention Policy Requests
- Queue Items Requests
- Queue Retention Policy Requests
- Robots Requests
- Roles Requests
- Schedules Requests
- Settings Requests
- Storage Bucket Requests
- Tasks Requests
- Task Catalogs Requests
- Task Forms Requests
- Tenants Requests
- Transactions Requests
- Users Requests
- Webhooks Requests
Storage Bucket Requests
Uploading files to an existing storage bucket using Orchestrator APIs is a two-part process:
- First you need to call the GET
/odata/Buckets({key})/UiPath.Server.Configuration.OData.GetWriteUri
endpoint, that returns an URI and the HTTP method as a response. -
Then you need to use the HTTP method from the GET response to call the
{URI}
endpoint, attach the file you want to upload in binary format, and send it to the URI obtained from the GET request.
https://govcloud.uipath.us/{organizationName}/{tenantName}/orchestrator_/odata/Buckets({key})/UiPath.Server.Configuration.OData.GetWriteUri
/odata/Buckets({key})/UiPath.Server.Configuration.OData.GetWriteUri
.
Provide the following parameters and headers:
Path param |
Data type |
Description |
---|---|---|
(required) |
String |
The ID of the storage bucket where you want to upload your file. |
Param |
Data type |
Description |
---|---|---|
(required) |
String |
The name of the file you want to upload, together with its extension. For example, "my_file.txt". |
(required) |
String |
The content type for the file extension. For example, the content type of
.txt extensions is text/plain .
|
--header 'Authorization: Bearer {access_token}'\
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_storage_bucket}' \
--header 'Authorization: Bearer {access_token}'\
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_storage_bucket}' \
X-UIPATH-OrganizationUnitId
is the ID of the folder that contains the storage bucket.
curl --location --request GET 'https://govcloud.uipath.us/{organizationName}/{tenantName}/orchestrator_/odata/Buckets(28053)/UiPath.Server.Configuration.OData.GetWriteUri?path=my_file.txt&contentType=text/plain' \
--header 'x-uipath-organizationunitid: 3991326' \
--header 'Authorization: Bearer 1234'
curl --location --request GET 'https://govcloud.uipath.us/{organizationName}/{tenantName}/orchestrator_/odata/Buckets(28053)/UiPath.Server.Configuration.OData.GetWriteUri?path=my_file.txt&contentType=text/plain' \
--header 'x-uipath-organizationunitid: 3991326' \
--header 'Authorization: Bearer 1234'
1234
for length considerations.
The response body contains the URI and the HTTP verb required to upload the file to the storage bucket in binary format.
{
"@odata.context": "https://govcloud.uipath.us/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto",
"Uri": "https://cr.blob.core.windows.net/orchestrator-4871-905f/BlobFilePersistence/2760e0fe-0fa7/my_file.txt?sv=2021-08-06&st=2023-01-13T16%3A32%3A12Z&se=2023-01-13T17%3A32%3A42Z&sr=b&sp=cw&sig=xB3W02xGYHfw%3D",
"Verb": "PUT",
"Headers": {
"Keys": [
"x-ms-blob-type"
],
"Values": [
"BlockBlob"
]
}
}
{
"@odata.context": "https://govcloud.uipath.us/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto",
"Uri": "https://cr.blob.core.windows.net/orchestrator-4871-905f/BlobFilePersistence/2760e0fe-0fa7/my_file.txt?sv=2021-08-06&st=2023-01-13T16%3A32%3A12Z&se=2023-01-13T17%3A32%3A42Z&sr=b&sp=cw&sig=xB3W02xGYHfw%3D",
"Verb": "PUT",
"Headers": {
"Keys": [
"x-ms-blob-type"
],
"Values": [
"BlockBlob"
]
}
}
{URI}
The URI is the value of the "Uri" key from the response body.
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain'
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain'
- Make sure to include the headers you receive in the GET response body, and assign values to them. For example, for Azure Blob
Storage, the returned header is
x-ms-blob-type-header
, which uses theBlockBlob
value. - Do not use an authorization header with this request.
Upload the file in binary format. You must use the same file you used as a query parameter in the GET request. In this case, "my_file.txt".
--data-binary '@/C:/Users/adam.eve/OneDrive/Documents/my_file.txt'
--data-binary '@/C:/Users/adam.eve/OneDrive/Documents/my_file.txt'
Let's say you gathered all the information needed to build the API call.
curl --location --request PUT 'https://cr.blob.core.windows.net/orchestrator-4871-905f/BlobFilePersistence/2760e0fe-0fa7/my_file.txt?sv=2021-08-06&st=2023-01-13T16%3A32%3A12Z&se=2023-01-13T17%3A32%3A42Z&sr=b&sp=cw&sig=xB3W02xGYHfw%3D' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain' \
--data-binary '@/C:/Users/adam.eve/OneDrive/Documents/my_file.txt'
curl --location --request PUT 'https://cr.blob.core.windows.net/orchestrator-4871-905f/BlobFilePersistence/2760e0fe-0fa7/my_file.txt?sv=2021-08-06&st=2023-01-13T16%3A32%3A12Z&se=2023-01-13T17%3A32%3A42Z&sr=b&sp=cw&sig=xB3W02xGYHfw%3D' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain' \
--data-binary '@/C:/Users/adam.eve/OneDrive/Documents/my_file.txt'
In the Orchestrator UI, the file is visible in your storage bucket.