Skip to content

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.

  • A space should be created. To know more about creating a space, refer here
POST {baseUrl}/spaces/{spaceId}/uploads
  • HEADER:

    • Authorization: Bearer {tid token}
  • BODY:

    • name - Name of the file
    • parentId - Parent id for the file where it needs to be created
    • restrictedAccess - Boolean value to indicate if the file needs to be created as a restricted file

After the upload operation is completed, the JSON response includes the id value for the file and URLs for file upload.

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).

PUT {UPLOAD URL}
  • BODY: {File Content}

Run a GET upload API call to check the job status. The value should be COMPLETED.

GET {baseUrl}/spaces/{spaceId}/uploads/{uploadId}
  • HEADER:

    • Authorization: Bearer {tid token}

To know more about the Create restricted file API refer here.