![]() |
API Documentation
|
This page describes how to use Covata's API to:
Notes:
- Before creating either 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 and/or permissions within their organization to create either:
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.
- their own items or
- items within another Covata user's collection.
- The Supported roles (and conditions) sections of each API endpoint page (linked to from the procedures below) contain details about the roles and permissions that a Covata user requires for a successful request to the endpoint (along with a valid access token representing this user).
A Secure Object (in its Created or 'completed' state) represents a file and its data/content which has been encrypted (according to the Covata Platform's encryption requirements), along with the Secure Object's associated properties (which are recorded by the Covata Platform's Access Service) and define details such as the file's name, location, which people (i.e. collaborators) can access the file's data and the level of access these people have to the file's data.
A Secure Object's content is only handled either by the Covata Platform's Content Service or externally by your application. While a Secure Object's content is not handled by the Access Service, a Secure Object's associated properties are retrieved from the Access Service, which in turn can assist in:
Tip: Conceptually, within the scope of Covata's Safe Share applications, a Secure Object represents a file and throughout Covata's product documentation, is referred to as a 'file object' (or when the context is unambiguous, simply just a 'file').
Notes:
- A file object in an Incomplete state is one that has been initialized (and associated with a key), although is not yet associated with any encrypted data (which would change the file object's state to Created).
- When using Covata Safe Share applications, an incomplete file object could also result from a failure in either encrypting the file's data or uploading this content to storage.
- In Organization Administration, a file object's current state can be seen through the Files page. For more information, see the Organization Administrator's Guide.
A collection:
Collections are:
Tip: Conceptually, within the scope of Covata's Safe Share applications, a collection represents an operating system's folder or directory and throughout Covata's product documentation, is referred to as simply just a 'folder'.
An item (in the context of Secure Objects and collections) is a generic term that refers to either a file (object) or a folder.
Every item, regardless of whether it is a file or a folder has a unique identifier (or ID).
All items on the Covata Platform are managed and handled within the scope of a self-contained unit called an organization.
An organization is self-contained meaning that the creation, sharing and manipulation of items is handled solely within the scope of an organization itself. Organizations provide the Covata Platform with multitenancy capabilities, whereby each organization represents an individual 'tenant'.
Be aware, however, that a Covata user can:
Therefore, a Covata user's ownership of content (or permissions to access this content) as well as the roles they have been granted to access Safe Share features are specific to each organization.
However, if a Covata user is a member of an organization and this user shares content with another Covata user (who is not a member of the organization), then that 2nd user automatically becomes a member of this organization.
A cryptographic key is required to encrypt data into a complete file object.
To obtain a cryptographic key from the Covata Platform's Access Service (which is the first step before creating a new file object), make a POST method request to this API endpoint:
with a JSON object in the body of the request that either:
128, 192 or 256. 256.Example request: Initiating a request to obtain a cryptographic key:
Note: As indicated in this example, the access token obtained after authentication and authorization to the Covata Platform, must be included in the header of this request (as the bearer token) for the request to succeed.
If your request (above) was sent successfully, the Covata Platform responds by sending back a JSON object containing the key's ID value (required to associate a cryptographic key with a file object), other information about the key's characteristics and a date and time stamp of when the key was created.
Example response: Response from the Covata Platform upon successfully processing a client application's request for a cryptographic key:
Next step: Now that you have a cryptographic key, you can begin the process of creating a new file object. This involves either:
Initializing a new file object (whose state is Incomplete):
To do this, make a POST request to the <access-service>/api/v1/organisations/{orgGroupId}/objects API endpoint with a JSON object in the body of the request that contains the keyId parameter (as a name/value pair) whose value is the ID of the key (obtained above).
The ID of the incomplete Secure Object is returned in the response to this request.
Tip: Your application may wish to temporarily store this ID value as it is used for completing a Secure Object, either by locally encrypting its data and then uploading it for storage, or by uploading its unencrypted data for encryption and storage.
Next step: Now that you have initialized your Secure Object, you can begin encrypting its data. Depending on your application's requirements, this involves either:
Creating a completed Secure Object from locally-encrypted data involves the following steps:
Requirements for encrypting data locally
When encrypting your data using the cryptographic key (obtained above), then ensure that this data is encrypted using:
If you do not follow these requirements, then either your attempt to upload your encrypted data may fail or if successful, any attempt to download the Secure Object's data in its decrypted form will result in the retrieval of garbled data.
Completing the Secure Object
To complete a Secure Object (whose state is Created) from its locally encrypted data, make either a:
PUT request to the <access-service>/api/v1/objects/{objectId} endpoint with: POST request to the <access-service>/api/v1/organisations/{orgGroupId}/objects API endpoint with a JSON object in the body of the request that contains: In both of these cases, a SHA-512 value must be associated with the Secure Object to set its state to Created.
Next step: Depending on your application's requirements, follow one of these procedures:
Once a Secure Object's data has been encrypted locally (above) and the Secure Object's state has changed to Created, your application can send this encrypted data to remote storage via the Covata Platform's Content Service.
To upload a completed Secure Object's encrypted data to the Content Service, make a POST request to the <content-service>/api/v1/objects/{objectId}/contents API endpoint, along with the actual encrypted data to be uploaded.
When making this request, the value of the format URL parameter must be encrypted. See Required parameters on POST of <content-service>/api/v1/objects/{objectId}/contents for more information.
Note: If the data being uploaded is larger than the upload chunk size permitted by the Covata Platform (whose default value is 10 mebibytes), then the data must be uploaded in multiple requests to this endpoint. For more information, see Required parameters for multi-chunk uploads of <content-service>/api/v1/objects/{objectId}/contents.
Next step: Depending on your application's requirements, follow one of these procedures:
Creating a completed Secure Object from unencrypted data stored locally involves the following steps:
To upload an incomplete Secure Object's unencrypted data to the Content Service, make a POST request to the <content-service>/api/v1/objects/{objectId}/contents API endpoint, along with the actual unencrypted data to be uploaded.
However, when making this request, the value of the format URL parameter must be plaintext. See Required parameters on POST of <content-service>/api/v1/objects/{objectId}/contents for more information.
Note: If the data being uploaded is larger than the upload chunk size permitted by the Covata Platform (whose default value is 10 mebibytes), then the data must be uploaded in multiple requests to this endpoint. For more information, see Required parameters for multi-chunk uploads of <content-service>/api/v1/objects/{objectId}/contents.
After completing all required requests to upload the unencrypted data, the Content Service automatically:
Note: For a multi-chunk upload, steps 1 to 3 above are conducted for each chunk and after the last chunk has been uploaded, the final SHA-512 value (for the entire encrypted data) is calculated and associated with the Secure Object.
Next step: Depending on your application's requirements, follow one of these procedures:
Collections are used for logically organizing Secure Objects and other collections, which the Covata Platform's Content Service utilizes for organise files and folders for Covata users.
To create a collection, make a POST request to the <access-service>/api/v1/collections API endpoint with the name of the collection and the parentId value, both of which are parameters (each specified as name/value pairs) within a JSON object in the body of the request. The parentId value should be:
0 to specify that the new collection will be created at the logical root level, orTip: A new Secure Object can be created within an existing collection by specifying the parentId value when making the appropriate API endpoint call to either:
- Initialize the Secure Object or
- Complete the Secure Object by encrypting its data locally.
If a Secure Object's unencrypted data is to be uploaded to the Covata Platform's Content Service, specify the parentId value when initializing the Secure Object.