getEncryptionInfo
FileEncryptionInfoWrapper getEncryptionInfo(fileId)
GET /api/2.0/files/{fileId}/access
Get file encryption information
Returns what the caller needs in order to decrypt one file of an end-to-end encrypted private room: userKeys holds the key pairs of the calling account, the private half of each of them encrypted with that person's own password, and fileKeys holds the file keys that were issued to this account for this file, each naming the public key it was encrypted for. Only the keys of the calling account are ever returned, never those of the other people in the room. An account that holds no key pair yet, and a file no key was issued for, answer with empty lists rather than with an error, so an empty fileKeys means the caller cannot open that file rather than that the file is unencrypted. The caller needs read access to the file; a caller without it, and a file that does not exist, are both refused with 403. The operation is read-only. Keys are issued by PUT api/2.0/files/{fileId}/access, and the personal key pairs are managed under api/2.0/privacyroom/keys.
Parameters
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| fileId | path | Integer (int32) | The file whose encryption keys are read. Only a file in an end-to-end encrypted private room has any. | [required] |
Responses
| Status code | Description | Type | Response headers |
|---|---|---|---|
| 200 | The key pairs of the caller and the file keys issued to them | FileEncryptionInfoWrapper | X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
| 400 | The file cannot carry encryption keys | - | - |
| 403 | The file does not exist, or the caller has no read access to it | - | - |
| 404 | The file does not exist | - | - |
| 401 | Unauthorized | ErrorApiResponse | - |
| 429 | Too Many Requests. | ErrorApiResponse | Retry-After |
| 500 | Internal Server Error. | ErrorApiResponse | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - | - |
Return type
Third-party storage
For a file or folder in a connected third-party storage the identifier is a string such as sbox-42, and the call differs in these parts only:
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| fileId | path | String | The file whose encryption keys are read. Only a file in an end-to-end encrypted private room has any. | [required] [example: sbox-42-L1JlcG9ydC5kb2N4] |
Authorization
Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId
HTTP request headers
- Content-Type: Not defined
- Accept: application/json