Files
Last updated
Was this helpful?
Last updated
Was this helpful?
Files are the heart of the Onehub service and are organized via . You can create, read, download, update, and delete files. You can also list all items in a folder.
All files are versioned. Creating a file in the same location of an identically named file will automatically create a new version of the previously existing file.
POST
https://ws-api.onehub.com/folders/:id/files
Uploads a file to the folder specified via :id
.
:id
integer
The unique identifier of the folder you would like to upload the file to.
content-type
string
Onehub requires file uploads to be sent with the content-type
header of multipart/form-data
rather than application/json
.
boundary
string
Required by the content-type header, this parameter indicates the file contents in the post body. See your particular library's documentation on how to achieve this.
file
object
The file you want to upload. Your file needs to be encoded as multipart/form-data
before being uploaded. We recommend using an existing multipart library in your language of choice.
If a filename has characters that would render it invalid, the name will automatically be changed to one that is valid. For example, file/name.txt
would be changed to file-name.txt
.
GET
https://ws-api.onehub.com/files/:id
Retrieves the metadata for the file specified by :id
.
:id
integer
The unique identifier of the file you would like to retrieve.
GET
https://ws-api.onehub.com/download/:id
Downloads the file specified via :id
.
:id
integer
The unique identifier of the file you would like to download.
PUT
https://ws-api.onehub.com/files/:id
Renames the file object specified via :id
.
:id
integer
The unique identifier of the file you would like to rename.
filename
string
The new name for the file.
DELETE
https://ws-api.onehub.com/files/:id
Deletes the file specified via :id
.
:id
integer
The unique identifier of the file you would like to delete.