Create restricted file
A file with restricted access would be signed each time the file is accessed and only available based on the URL Expiration. The urlDuration is set to 5 minutes by default. The urlDuration can be set to a maximum of 7 days.
However, if restrictedAccess is set to false, the file becomes publicly available. The download URL will not be expired for public files. By default, the restrictedAccess is set to true.
Prerequisites
Section titled “Prerequisites”- A space should be created. To know more about creating a space, refer here
1. Create a new upload fileset object
Section titled “1. Create a new upload fileset object”Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/uploads-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
name- Name of the fileparentId- Parent id for the file where it needs to be createdrestrictedAccess- Boolean value to indicate if the file needs to be created as a restricted file
Response
Section titled “Response”After the upload operation is completed, the JSON response includes the id value for the file and URLs for file upload.
2. Upload file content
Section titled “2. Upload file content”Perform a PUT operation with the upload URL from the POST call in the previous step. Use the upload URL provided in the response to upload compressed fileset (.zip, .tar, or .tar.gz).
Request
Section titled “Request”PUT {UPLOAD URL}- BODY:
{File Content}
3. Validate the upload
Section titled “3. Validate the upload”Run a GET upload API call to check the job status. The value should be COMPLETED.
Request
Section titled “Request”GET {baseUrl}/spaces/{spaceId}/uploads/{uploadId}-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
Response
Section titled “Response”To know more about the Create restricted file API refer here.