Create a Sharebox
POST {{api-server}}/{{token}}/v5/shares
This endpoint allows you to create a new Sharebox - a secured space where you can share selected files and folders with others for a limited period of time.
To create a Sharebox, provide the necessary details like title, items to share, and validity period. Once created, the API will return a unique Sharebox URL you can share with others.
Request Body
title
(string, required): The title of the Sharebox.description
(string, optional): Add a brief description of the Sharebox to help recipients understand its contents.starts_at
(string, optional): Start date and time of the Sharebox validity in ISO 8601 format (e.g., 2024-08-18T18:29:00Z).expires_at
(string, optional): Expiry date and time of the Sharebox in ISO 8601 format (e.g., 2025-08-18T18:29:00Z).starts_tz
(string, optional): Timezone for the start date and time.expires_tz
(string, optional): Timezone for the expiry date and time.items
(array of objects, required): An array of items to be shared (files and folders), each object containing thetype
(string) andidentifiers
(array of file/folders UUIDs).options
is a parameter applicable only in case a folder object needs to be sharedtype
(string, required): Type of the item. Possible values:file_uuid
,folder_uuid
identifiers
(array, required): Array of UUIDs that are to be shared.options
(object, applicable for folder's sharing only) : its parameters contain information about the scope of the shared folder:recursive
(boolean, required): Iftrue
, includes all sub-folders within the shared folder. Use this option to share entire directory trees. Iffalse
, only the contents directly within the selected folder will be shared.visibility
(string, required): Possible values -PUB
,ORG
,PUB,ORG.
In case this folder contains assets with different visibility, the param specifies which of them to be added to the Sharebox.
auth
(object, optional): Authentication is optional but recommended when sharing sensitive data. Use theauth
object to add a password to the Sharebox for additional security.pass
(string): Password for authentication.
Response (200 - OK)
{
"status": "string",
"msg": "string",
"share": {
"uuid": "string",
"title": "string",
"description": "string",
"items": [
{
"identifiers": ["string"],
"type": "string"
}
],
"starts_at": "string",
"expires_at": "string",
"starts_tz": "string",
"expires_tz": "string",
"auth": [
{
"pass": "string",
"user": "string"
}
],
"share_uri": "string",
"puid": "string"
},
"info": {
"duration": 0,
"api_version": 0
},
"api_version": {
"hash": "string",
"datetime": "string",
"module": "string"
}
}
The response for a successful request (status code 200) returns a JSON object with the status, message, share details including:
uuid
(string)- the unique identifier of the new Shareboxtitle
(string) - title of the Shareboxdescription
(string)- description of the Sharebox contentitems
(array of objects) - UUID identifiers of the shared assetsstart and expiry dates - in ISO 8601 format
timezones
authentication details
share URI (string)- The URL where the Sharebox can be accessed.
Once your Sharebox is created, share the generated URL with your recipients. If you need to update or delete the Sharebox, refer to the Update or Delete endpoints.
Request Body
{"title"=>"My share link 08/17/2024 06:48 PM", "description"=>"Short description", "starts_at"=>"2024-08-18T18:29", "expires_at"=>"2024-08-24T18:29", "starts_tz"=>"Europe/Sofia", "expires_tz"=>"Europe/Sofia", "items"=>[{"type"=>"file_uuid", "identifiers"=>["59aac4eb-ccf1-56b3-a4d6-634e77750000", "f2ebf6f6-39f2-56e6-ba74-d9b956c50000"]}], "auth"=>{"pass"=>"123"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Filerobot-Key | string | ||
Content-Type | string |
RESPONSES
status: OK
{"status":"success","msg":"Successfully added a new share","share":{"uuid":"fc650800-7501-4423-a5b3-01661d71266c","title":"My share link 08/17/2024 06:48 PM","description":"Short description","items":[{"identifiers":["59aac4eb-ccf1-56b3-a4d6-634e77750000","f2ebf6f6-39f2-56e6-ba74-d9b956c50000"],"type":"file_uuid"}],"starts_at":"2024-08-18T18:29:00Z","expires_at":"2024-08-24T18:29:00Z","starts_tz":"Europe/Sofia","expires_tz":"Europe/Sofia","auth":[{"pass":"123","user":""}],"share_uri":"https://share.filerobot.com/token/v3/s/s2nTJoyufe2oRYl9wktl7AkcqI/my-share-link-08-17-2024-06:48-pm","puid":"s2nTJoyufe2oRYl9wktl7AkcqI"},"info":{"duration":0.022522449493408203,"api_version":5},"api_version":{"hash":"1ce24f12ff9f3205395f34065a5b87bbfa619e25","datetime":"2024-08-13T12:13:54+07:00","module":"elastic_v2"}}