RESTAPI:Attaching Files to a Transfer Session

Aus Cryptshare Documentation
Version vom 11. Oktober 2023, 12:10 Uhr von imported>Frorathm
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu:Navigation, Suche
Please note that the Cryptshare Server only allows this operation for verified sender addresses or verified email addresses (see Verification).

After creating a Transfer Session, you are able to attach files to it. This happens in two steps.

Register a file to a Transfer Session

Before uploading a file, they have to be registered first and assigned to a Transfer Session by providing some information about them:

Description Property Required
The file name under which the file can be downloaded by the recipient (unique per transfer) fileName Yes
The file size in bytes size Yes
The checksum of the file to check after the transfer finalization if the files were uploaded correctly checksum No

After registering the file, the fileId is returned in order to identify this file in other requests. Additionally, in the response's Location header the basic URL is returned where file-related actions can be executed (deletion with this URL or uploading the file contents by adding /content to the basic URL).

POST https://<your-url>/api/users/{email-address}/transfer-sessions/{tracking-id}/files

Upload the registered file

After registering a file, the location header of the registration can be used to send the file to.

PUT https://<your-url>/api/users/{email-address}/transfer-sessions/{tracking-id}/files/{file-id}/content

Content-Type header
In order to successfully upload a file, the Content-Type header has to be set to application/octet-stream.

Check state of registered files

To check the state of the registered files, if they just have been registered or have been uploaded completely, the endpoint to get current transfer session state can be used.

Optionally mark file as confidential message

Cryptshare offers the possibility to mark a file as a confidential message. For this, the file-id of the respective file has to be sent via the Edit parameters inside the transfer session endpoint.