Create folder
A folder is a container for files and sub folders.
Limitations
Section titled “Limitations”The name of folder has the following restrictions
- Name cannot begin with
/ - Length should be less than 255 characters
- Name should not be reserved keywords like
com,lpt,con,nul,prn,aux,?,<,>,*,|
Name of the folder under the parent should be unique. Folder with same name cannot be created under the parent.
To create a folder, the identifier of the folder’s parent folder must be provided.
Prerequisites
Section titled “Prerequisites”- A space should be created. To know more about creating a space refer here
Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/folders-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
name- Name of the folderparentId- Parent id where folder needs to be createdpermissionsLocal- List of actors and their roles for the folder. (Optional)
{ "name": "folder1", "parentId": "b93c5919-e3e8-47f9-bf26-d99c8864a19f", "permissionsLocal": { "acl": [ { "actor": "trn:tid:user:6529d0b3-5856-41ab-88b3-86f7955cddf1", "role": "contentManager" }, { "actor": "trn:tid:user:f85bc802-5481-4581-b972-c4652d595ec7", "role": "contentContributor" } ] }}After the folder creation operation is completed, the JSON response includes the id value for the folder.
Response
Section titled “Response”{ "id": "1d50bf0e-ede2-4ea9-9646-bfa3bb374812", "resourceTrn": "trn:2:fileservice:<region>:folder:1d50bf0e-ede2-4ea9-9646-bfa3bb374812", "name": "folder1", "parentId": "b93c5919-e3e8-47f9-bf26-d99c8864a19f", "permissionsLocal": { "acl": [ { "actor": "trn:tid:user:6529d0b3-5856-41ab-88b3-86f7955cddf1", "role": "contentManager" }, { "actor": "trn:tid:user:f85bc802-5481-4581-b972-c4652d595ec7", "role": "contentContributor" } ] }, "createdAt": "2024-06-25T06:37:31Z", "createdByTrn": "trn:tid:application:<applicationId>", "updatedAt": "2024-06-25T06:37:31Z", "updatedByTrn": "trn:tid:application:<applicationId>", "path": "/folder1", "spaceId": "1edd3cf2-226c-42a0-b0d8-8fa828ed5d2b", "type": "FOLDER", "version": "1"}To know more about the Create folder API refer here.