Skip to main content

getEncryptionAccess

EncryptionKeyArrayWrapper getEncryptionAccess(fileId)

GET /api/2.0/files/file/{fileId}/publickeys

Get file encryption keys

Answers with the encryption keys that open one file kept in a private room: one entry per member who holds rights on the file and has published keys, each carrying that member's public key, and the caller's own entry carrying the encrypted private half as well. The private half of another member is never handed out. A member who has not published keys yet is left out of the answer altogether, which is how a client tells that this member cannot open the file until keys are published through POST api/2.0/privacyroom/keys; a member who holds the file only through a group is not reported either, because group entries are skipped. The file has to lie in a private room or in the encrypted section - a file kept anywhere else carries no keys and is rejected as an unsupported request. The caller needs read access to the file and is answered with 403 otherwise, and a file that does not exist is answered as missing. The call is read-only, and the answer changes as soon as a member publishes or rotates keys, so read it again rather than caching it for a later session.

Parameters​

NameInTypeDescriptionNotes
fileIdpathInteger (int32)The file the operation addresses. Take the identifier from a listing such as GET api/2.0/files/{folderId}: a file stored on the portal is numbered, while a file in a connected third-party account is named by an opaque string.[required] [example: 10]

Responses​

Status codeDescriptionTypeResponse headers
200The keys of the members who can open the file, the private half only for the callerEncryptionKeyArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The caller may not read the file--
404The file does not exist--
415The file lies neither in a private room nor in the encrypted section--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

EncryptionKeyArrayWrapper

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:

NameInTypeDescriptionNotes
fileIdpathStringThe file the operation addresses. Take the identifier from a listing such as `GET api/2.0/files/{folderId}`: a file stored on the portal is numbered, while a file in a connected third-party account is named by an opaque string.[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