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 created
{ "name":"folder1", "parentId":"b93c5919-e3e8-47f9-bf26-d99c8864a19f", "acl": { "contentManager": [ "trn:tid:application:<applicationId>" ] } }After the folder creation operation is completed, the JSON response includes the id value for the folder.
Response
Section titled “Response”{ "acl": { "contentManager": [ "trn:tid:application:<applicationId>" ] }, "createdAt": "2024-06-25T06:37:31Z", "createdByTrn": "trn:tid:application:<applicationId>", "deleted": false, "id": "1d50bf0e-ede2-4ea9-9646-bfa3bb374812", "metadata": { "test": "123" }, "name": "test125", "parentId": "b93c5919-e3e8-47f9-bf26-d99c8864a19f", "path": "/test125", "spaceId": "1edd3cf2-226c-42a0-b0d8-8fa828ed5d2b", "type": "FOLDER", "updatedAt": "2024-06-25T06:37:31Z", "updatedByTrn": "trn:tid:application:<applicationId>" "version": "1"}To know more about the Create folder API refer here.