![]() |
API Documentation
|
POST - used to create a new collection, which involves specifying the following attributes/metadata on the resulting collection:This API endpoint creates a new collection, which can be used to organize Secure Objects and other collections.
A collection is analogous to an operating system's folders/directories on a file system. Collections are used for organizing Secure Objects and other collections logically in storage. The Covata Platform's Content Service uses collections for this purpose.
The Covata user whose account creates a new collection becomes the owner1 of this collection. When creating the new collection, apart from setting the required name and parent attributes/metadata for the collection (through the name and parentId parameters respectively), this Covata user can optionally add collaborators and their permission sets (specified through this endpoint's collaborators parameter) - where a permission set is specific to each individual collaborator. For each collaborator, one of the following four permission sets can be applied:
GET method on the <content-service>/api/v1/objects/{objectId}/contents endpoint).GET method on the <content-service>/api/v1/objects/{objectId}/view endpoint).DELETE method on the <content-service>/api/v1/objects/{objectId}/contents endpoint followed by the DELETE method on the <access-service>/api/v1/objects/{objectId} endpoint), through the Remove (File) permission. PUT method on the <access-service>/api/v1/objects/{objectId} endpoint). A common collection hierarchy is a collection hierarchy that contains either this new collection or the Secure Object (subsequently contained within this new collection), where the owner of this item has also added the same collaborator (with the Manage permission set) to the collection hierarchy's parent (i.e. the root-level) collection. PUT method on the <access-service>/api/v1/objects/{objectId} endpoint). POST method on the <access-service>/api/v1/organisations/{orgGroupId}/objects endpoint with the parentId parameter value being that of this parent collection and either with or without the Secure Object's SHA512 value.DELETE method on the <access-service>/api/v1/collections/{collectionId} endpoint with the parentId parameter value being that of this parent collection and the child collection specified in the {collectionId} part of the request's URL. 1 Be aware that the ownership of a collection can be changed to that of another Covata user.
2 If any of these Secure Objects are subsequently contained within a nested (i.e. child) collection to 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 collection and any other items contained within it. The exceptions are the Remove (File) and Remove (Folder) permissions, which are propagated down through a collection hierarchy, regardless of whether or not a more restrictive permission set has been applied to an item further down the hierarchy.
This API endpoint supports the following Covata user roles (as described in the Covata Platform Administrator's Guide), conditions and permissions (where applicable):
The Covata Platform's resources available to one of these Covata users (above) is determined by the access token passed in the header of requests to this endpoint.
Authorization: Bearer a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6 Bearer token is the appropriate access token.Content-Type: application/jsonThe following required parameters must be sent in the body of the POST request, as individual members of a JSON object:
parentId - The ID of an existing collection that will contain this new collection. Specifying a value of 0 results in the new collection being created at the logical root location in storage.
Example (creating a collection at the 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:
collaborators - A parameter containing the following optional sub-element parameters, relating to the collaborators being applied to this collection:
Tip: It is worthwhile your client application storing these set of collaborators and their respective permission sets (e.g. in an object) because any modifications to one or more collaborators on an existing collection requires all collaborators and their permission sets to be specified in the collection modification request.
Example (creating a collection within an existing collection, while adding new collaborators each with different sets of permissions to this new collection):
Note: The permission set with an ID of 5 is Upload and with an ID of 3 is Manage. See <access-service>/api/v1/permissions/sets for more information about permission sets.
A JSON-formatted response containing the following members:
createdAt above. Otherwise, if the collection has been modified (see <access-service>/api/v1/collections/{collectionId} for more information), this date and time should reflect when this collection was last modified. parentId - The ID of the collection that contains the Secure object. A value of 0 indicates that this collection is located at the default logical root storage location.
Example (response from creating a collection within an existing collection):