- a collaborator was removed from the sub-item, or
- a collaborator’s permission set on this sub-item was changed,
- Any implicit sharing this collaborator had to this sub-item (inherited implicitly from the closest ancestral folder) is overridden by this explicit modification.
- If the sub-item is a folder, then the explicit modification on this subfolder is implicitly propagated down through this subfolder’s item hierarchy.
- Share a file with collaborators,
- Share a folder with collaborators,
- Determine existing collaborators on an item and
- Modify existing collaborators on an item
- Before sharing a file or a folder, your application must have a valid access token obtained by authenticating and authorizing a Covata user to the Covata Platform, where this user has the appropriate role to create items and/or permissions to share them.
For more information about authenticating and authorizing Covata users to the Covata Platform, see Initiating authentication and authorization on the Authentication and authorization page of this guide and the Configuring client applications page of the Safe Share Administrator’s Guide. - The Supported roles (and conditions) section of each API endpoint page (accessible from the relevant procedures throughout this Developer’s Guide) contains details about the roles a Covata user requires and the conditions they must meet, for requests to these endpoints (which would include a valid access token representing the user’s authenticated session) to succeed.
Sharing a file with collaborators
A file can be shared with collaborators when the file object is either initialized or subsequently modified (the latter approach being the recommended one * ). To share a file object with collaborators, do one of the following:-
If sharing a file object at the time of its creation/initialization, make a
POSTrequest to the API endpoint for creating a new file object: with a JSON object in the body of the request that contains the collaborators parameter, which in turn contains a list array whose elements each relate to a collaborator and the collaborator’s permission set that will be applied to the new file object. See Optional POST-request parameters (of <access-service>/api/v1/organisations/{orgGroupId}/objects) for more information.
The keyId parameter (name/value pair) whose value is the ID of the key (obtained earlier) must also be specified in this request.
The value of{orgGroupId}in the URL path of the request is the ID of the organization in which the file object will be created and shared.
If the request was successful, a JSON object is returned in the response containing information about the newly initialized file object. -
( Recommended * ) If sharing an existing file object (i.e. after its creation), make a
PUTrequest to this API endpoint: with a JSON object in the body of the request that contains the collaborators parameter, which in turn contains a list array whose elements each relate to a collaborator and the collaborator’s permission set that will be applied to the file object. See Optional PUT-request parameters (of <access-service>/api/v1/objects/{objectId}) for more information.
The value of{objectId}in the URL path of the request is the ID of the file object being shared.
If the request was successful, a JSON object is returned in the response containing an extensive set of information about the updated file object.
Sharing a folder with collaborators
A folder can be shared with collaborators when the folder is either first created or subsequently modified. To share a folder with collaborators, do one of the following:-
If sharing a folder at the time of its creation, make a
POSTrequest to the API endpoint for creating a new folder: with a JSON object in the body of the request that contains the collaborators parameter, which in turn contains a list array whose elements each relate to a collaborator and the collaborator’s permission set that will be applied to the new folder. See Optional parameters (of <access-service>/api/v1/organisations/{orgId}/collections) for more information.
The name and parentId parameters (name/value pairs) whose values are described earlier for creating a folder must also be specified in this request.
The value of{orgId}in the URL path of the request is the ID of the organization in which the folder will be created and shared.
If the request was successful, a JSON object is returned in the response containing information about the new folder. -
If sharing an existing folder (i.e. after its creation), make a
PUTrequest to this API endpoint: with a JSON object in the body of the request that contains the collaborators parameter, which in turn contains a list array whose elements each relate to a collaborator and the collaborator’s permission set that will be applied to the folder. See Optional parameters (of <access-service>/api/v1/collections/{collectionId}) for more information.
The value of{collectionId}in the URL path of the request is the ID of the folder being shared.
If the request was successful, a JSON object is returned in the response, containing information about the updated folder (including the organization in which the folder belongs).
Determining existing collaborators on an item
To determine the existing collaborators (and their respective permission sets) on a file object or folder, simply retrieve information about a subset of items from a specific organization on the Covata Platform. If the request was successful, a JSON object is returned in the response containing information about all collaborators on each item retrieved, as well as each collaborator’s respective permission set on an item (and the individual permissions that constitute the permission set).This JSON response only reveals information about collaborators on an item if the valid access token (submitted in the request) was obtained from a successfully authenticated Covata user that either owns this item or is a collaborator on the item with the View Other permission.
Modifying existing collaborators on an item
Collaborators can be modified on a file or folder by:- removing existing collaborators from the item,
- changing the permission sets of existing collaborators on the item, or
- adding new collaborators to the item (which is already shared with existing collaborators).
PUT request, if you intend to:
- Remove existing collaborators from the item, omit these collaborators from the
PUTrequest. - Change the permission sets of existing collaborators on the item, re-apply these collaborators in the
PUTrequest but modify their permission sets accordingly (i.e. specify the appropriate permissionSet / id sub-element parameter for each of these collaborators with their updated permission set ID). - Add new collaborators to the item, add these new collaborators in the
PUTrequest along with their permission sets (i.e. specify the appropriate permissionSet / id sub-element parameter for each of these collaborators with the appropriate permission set ID).
PUT request, ensure that all existing collaborators which are not being altered are re-applied in the request (along with their existing respective permission sets).
