Domo Bricks
Domo Bricks do not support the Files API.
Upload a file
Uploading a new file can be accomplished through the following request. You will pass in the file to upload, and Domo will store it and generate a unique identifier for the file, which is returned to you.Default Permissions
The App Framework will automatically secure the file permissions so it can only be accessed by the same user who uploaded it, unless the
public param is set to true. In that case, all users in the Domo instance will be able to access the file. File permissions can be updated to give access to specific users and groups, if needed. You can find out how to do that by reviewing the Update file permissions API.
HTTP Request
FormData() object that supports a multipart upload. The name given to the file to be appended to the FormData object is file.
HTTP Response
Returns the ID of the created file.
Upload a file revision
The Files API provides versioning support for files that have been uploaded. You may add another version of a file by sending aPUT request to the files endpoint referencing the dataFileId of the file you wish to revise.
Code Example
HTTP Request
FormData() object which supports a multipart upload. The name given to the File that is to be appended to the FormData object is ‘file’.
HTTP Response
Returns the revision id of the uploaded revision file.
Get all files metadata
Each file that you upload has corresponding metadata. This endpoint allows you to list all the metadata for each file you have access to. If you want to limit the files to just those that you uploaded you can provide alimitToOwned boolean flag as a query parameter.
Code Example
HTTP Request
Get file metadata by ID
Given a known file ID, this endpoint allows you to list the metadata for that specific file. Code Example
HTTP Request
Download a file
Below is the basic request for downloading a file. Depending on the type of file, this endpoint can be referenced inline in your application or called via an HTTP request. In this example, theresponseType of the XHR request is being set to blob so that our code can reference it as a binary large object when passing the response to the Download method.
Code Example
HTTP Request
To download the current file version:
Delete a file
Permanently deletes a File from your instance. Code Example
HTTP Request
Get file permissions
Code Example
HTTP Request
Update file permissions
Code Example
HTTP Request
Multi-part Files API
The Multi-part Files API allows for efficient upload, update, and management of large files in parts. It uses Domo’s Data File Service, supporting session-based file chunking for fault tolerance and enhanced control.Creating a Multi-part Upload Session
To begin a multi-part file upload, create an upload session by callingcreateSession. This will return a session ID that is essential for uploading file parts.
Code Example
- name (String): The name of the file.
- description (String): A description of the file.
- contentType (String): The MIME type of the file.
HTTP Request
Creating a Multi-part Upload Update Session
To update a multi-part file, create an update session by callingcreateUpdateSession and passing in the fileId. This will return a session ID that is essential for uploading file parts.
Code Example
- name (String): The name of the file.
- description (String): A description of the file.
- contentType (String): The MIME type of the file.
HTTP Request
Uploading File Parts
After creating a session, upload the file in chunks. Each chunk is sent with a uniqueindex and can optionally include a checksum for verification. The checkSum is used to verify the integrity of the uploaded chunk.
You can determine the chunk size manually, but a good recommended size is between 10MB and 100MB.
- sessionId (String): The session ID from
createSessionorcreateUpdateSession. - index (Number): Part number for ordering (1–10,000).
- part (ArrayBuffer | String): File data chunk.
- contentType (String): The content type of the chunk.
- checkSum (String, optional): SHA-256 checksum for the chunk.
createSession or createUpdateSession |
| index | Number | Required | Part number for ordering (1–10,000) |
| part | ArrayBuffer | String | Required | File data chunk |
| contentType | String | Required | The content type of the chunk |
| checkSum | String | Optional | SHA-256 checksum for the chunk |
HTTP Request
Completing a Multi-part Upload
Once all parts are uploaded, finalize the process withcomplete:
- sessionId (String): The session ID to commit.
HTTP Request
Error Handling and Retry Mechanism
If a part upload fails, a retry mechanism limits the attempts per chunk, aborting the session after a specified count.
HTTP Request