API Documentation
|
where {orgId}
is the ID of an organisation.
POST
- creates a new folder (i.e. collection) within an organisation (specified by orgId
), which involves specifying the following properties on the resulting folder:This API endpoint creates a new folder, which can be used to organize file objects/Secure Objects and other folders.
A folder/collection is analogous to an operating system's folders/directories on a file system. The Cocoon Data Platform's folders are used for organizing files and other folders logically in storage managed by the Content Service.
The Cocoon Data user whose account creates a new folder through this endpoint becomes the owner 1 of this folder. When creating this new folder, other than setting its required name and parent properties (through the name and parentId parameters respectively), collaborators and their permission sets (specified through this endpoint's collaborators parameter) can also be set - where a permission set is specific to each individual collaborator. For each collaborator, one of the following five permission sets can be applied:
GET
method on the <content-service>/api/v1/objects/{objectId}/view endpoint).GET
method on the <content-service>/api/v1/objects/{objectId}/contents endpoint).POST
method on the <access-service>/api/v1/organisations/{orgGroupId}/objects endpoint), through the Upload File permission.POST
method on the <content-service>/api/v1/objects/{objectId}/contents endpoint), again through the Upload File permission.POST
method on the <content-service>/api/v1/objects/{objectId}/versions endpoint), through the Upload File permission.PUT
method on either the <access-service>/api/v1/objects/{objectId} or <access-service>/api/v1/collections/{collectionId} endpoints). The Rename permission also provides access to a file's other versions, which includes the ability to perform any of the following actions:GET
method on the <access-service>/api/v1/objects/{itemId}/versions endpoint).GET
method on the <content-service>/api/v1/versions/{versionId}/view endpoint).GET
method on the <content-service>/api/v1/versions/{versionId}/contents endpoint).PUT
method on the <access-service>/api/v1/objects/{itemId}/versions/{versionId} endpoint).DELETE
method on the <access-service>/api/v1/objects/{itemId}/versions/{versionId} endpoint).DELETE
method on the <access-service>/api/v1/objects/{objectId} endpoint (through the Remove (File) permission) or <access-service>/api/v1/collections/{collectionId} endpoint (through the Remove (Folder) permission), respectively. PUT
method on either the <access-service>/api/v1/objects/{objectId} or this endpoint's parentId parameter). A common folder hierarchy is a folder hierarchy that contains this new folder (including items subsequently contained within it), in which the same collaborator has also been added (with either the Modify or Manage permission set) to a higher level (i.e. a common) folder, such that this higher level folder forms the top of the folder's hierarchy.POST
method on the <access-service>/api/v1/organisations/{orgGroupId}/objects endpoint or PUT
method on the <access-service>/api/v1/objects/{objectId} endpoint, orPUT
method on the <access-service>/api/v1/collections/{collectionId} endpoint.1 Be aware that the ownership of a folder can be changed to that of another Cocoon Data user.
2 If any of these items are subsequently moved to a child folder on which a more restrictive permission set (listed above) has been applied for a given collaborator, then that collaborator will only possess the relevant permissions (granted by this more restrictive permission set) on this child folder and any other items contained within it. The exceptions are the Remove (File) and Remove (Folder) permissions, which are propagated down through a folder hierarchy, regardless of whether or not a more restrictive permission set has been applied to an item further down the hierarchy.
3 Relates to the active version of the file.
This API endpoint supports requests utilizing Cocoon Data user accounts with the following roles (as described in the Organisation Administrator's Guide) and conditions:
{orgId}
in the request's URL and{orgId}
) on which this user is a collaborator with the Create Folder permission. The Cocoon Data Platform's resources available to one of these Cocoon Data users (above) is determined by the access token submitted in the header of requests to this endpoint.
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...
Bearer
token is the appropriate access token.Content-Type: application/json
The following required parameters must be sent in the body of the POST request, as individual members of a JSON object:
{orgId}
) that will contain this new folder. Specifying a value of 0
results in the new folder being created at the logical root location in storage. The following optional parameters can also be sent in the body of the POST request, each as individual members of the JSON object that includes the Required parameters above:
If the request succeeded, then an HTTP response status 200 OK
is returned.
For successful requests only, a JSON-formatted response containing the following members is also returned:
createdAt
above. 0
indicates that this new folder is located at the default logical root storage location.