RESTAPI:Attaching Files to a Transfer Session: Unterschied zwischen den Versionen
imported>Frorathm Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
{{InfoBox|title=|content=Please note that the Cryptshare Server only allows this operation for verified sender | {{InfoBox|title=|content=Please note that the Cryptshare Server only allows this operation for a verified sender address (see [[{{NAMESPACE}}:About_Verifications|Verification]]). | ||
}} | |||
}}After [[RESTAPI:Starting and editing a Transfer Session|creating a Transfer Session]], you are able to attach files to it. This happens in two steps. | }}After [[RESTAPI:Starting and editing a Transfer Session|creating a Transfer Session]], you are able to attach files to it. This happens in two steps. | ||
Version vom 10. Juni 2024, 09:47 Uhr
}}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
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.