CSSv5.0.0 en:Automatic Download of Transfers: Unterschied zwischen den Versionen

Aus Cryptshare Documentation
Wechseln zu:Navigation, Suche
(Imported from text file)
 
(Imported from text file)
Zeile 4: Zeile 4:


For automation processes it is possible to download a Cryptshare transfer directly without the need to operate the user interface manually. To do this, the additional GET parameter 'get' has to be appended to the link URL:
For automation processes it is possible to download a Cryptshare transfer directly without the need to operate the user interface manually. To do this, the additional GET parameter 'get' has to be appended to the link URL:
 
`https://<Cryptshare Server URL>/download?id=<transfer-id>&password=<password>&<get[=all|=checksums|allWithChecksums|=<file-id>]>`
`https://<Cryptshare Server URL>/download?id=<transfer-id>&password=<password>&<get[=all|=checksums|allWithChecksums|=<file-id|=eml]>
{{InfoBox|title=|content=The URL below can still be used for the automated download of transfers, but will be deactivated with one of the next Cryptshare versions.
`
`https://<Cryptshare Server URL>/download1.php?id=<transfer-id>&password=<passwort>&<get[=all|=checksums|allWithChecksums|=<file-id>]>`
 
{{InfoBox|title=|content=The URL below can still be used for the automated download of transfers, but will be deactivated with one of the next Cryptshare versions.https://<Cryptshare Server URL>/download1.php?id=<transfer-id>&password=<passwort>&<get[=all{{!}}=checksums{{!}}allWithChecksums{{!}}=<file-id{{!}}=eml]>
}}
}}


Retrieving Meta-Information about a transfer
Retrieving Meta-Information about a transfer
Attaching the 'get' parameter only results in an HTTP download offering a TXT document with information about the transfer. The information is offered in a JSON compatible manner.
Attaching the 'get' parameter only results in an HTTP download offering a TXT document with information about the transfer. The information is offered in a JSON compatible manner.
{{WarnBox|title=Update Cryptshare Version 4.0.0.0 to 4.1.0.0|content=With the update from Cryptshare to version 4.1.0.0, due to the conversion from SHA-1 to SHA-256, the property "sha1" of the transfer files is deprecated and will always have an empty value. The checksum of a transfer file is available with the property "checksum" now. The algorithm used to compute the checksums is available as "checksumAlgorithm".
}}
Structure JSON file (example data):
Structure JSON file (example data):
  {   
  {   
     "file\_1":\[   
     "file\_1":\[   
Zeile 64: Zeile 56:
     \]
     \]
  }
  }
`https://<Cryptshare Server URL>/download?id=234ds43re&password=23erwr2er&get
`https://<Cryptshare Server URL>/download?id=234ds43re&password=23erwr2er&get`
`
 
The file lists all files within this transfer together with their corresponding File-IDs. This provides the possibility to find a specific file and download this file with a separate call.
The file lists all files within this transfer together with their corresponding File-IDs. This provides the possibility to find a specific file and download this file with a separate call.
== Downloading specific files ==
== Downloading specific files ==
Attaching the 'get' parameter together with a specific file id results in an HTTP download offering the file which corresponds to this id.
Attaching the 'get' parameter together with a specific file id results in an HTTP download offering the file which corresponds to this id.
 
`https://cryptshare.yourdomain.com/download?id=234ds43re&password=23erwr2er&get=6ac31d4b8b`
`https://cryptshare.yourdomain.com/download?id=234ds43re&password=23erwr2er&get=6ac31d4b8b
`
 
Using our example from above this call will download the file 'transferFile\_1.txt'.
Using our example from above this call will download the file 'transferFile\_1.txt'.
== Downloading all the files of a transfer ==
== Downloading all the files of a transfer ==
Attaching the 'get' parameter together with the key word 'all', results in a HTTP download offering a zip file containing all the files of the transfer.
Attaching the 'get' parameter together with the key word 'all', results in a HTTP download offering a zip file containing all the files of the transfer.
 
`https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er&get=all`
`https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er&get=all
`
 
This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt' and 'transferFile\_2.txt'.
This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt' and 'transferFile\_2.txt'.
Downloading the confidential message with attached files
Attaching the 'get' parameter together with the key word 'eml', results in a HTTP download offering the confidential message with all other files of the transfer attached.
`[https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er]&get=eml
`
== Downloading the checksums of the files of a transfer ==
== Downloading the checksums of the files of a transfer ==
Attaching the 'get' parameter together with the key word 'checksums', results in a HTTP download offering a csv file containing information of the transfer. This information contains the notification subject of the transfer and the file names and their corresponding checksums.
Attaching the 'get' parameter together with the key word 'checksums', results in a HTTP download offering a csv file containing information of the transfer. This information contains the notification subject of the transfer and the file names and their corresponding checksums.
 
`[https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er]&get=checksums`
`[https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er]&get=checksums
`
 
This call will download the file 'checksums.csv' which, according to the meta information, will contain the following entries:
This call will download the file 'checksums.csv' which, according to the meta information, will contain the following entries:


Zeile 114: Zeile 85:
== Downloading all the files of a transfer ==
== Downloading all the files of a transfer ==
Attaching the 'get' parameter together with the key word 'allWithChecksums', results in a HTTP download offering a zip file containing all the files of the transfer and a csv file containing the checksums of the transfer's files.
Attaching the 'get' parameter together with the key word 'allWithChecksums', results in a HTTP download offering a zip file containing all the files of the transfer and a csv file containing the checksums of the transfer's files.
 
`[https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er]&get=allWithChecksums`
`[https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er]&get=allWithChecksums
`
 
This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt', 'transferFile\_2.txt' and 'checksums.csv'.
This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt', 'transferFile\_2.txt' and 'checksums.csv'.
== HTTP error codes and messages ==
== HTTP error codes and messages ==
The Cryptshare User Interface will behave differently when using the 'get' parameter and offering wrong parameters. Unlike the error messages usually presented when downloading files via the web form, the interface will respond with the HTTP error code and the corresponding error message based on the error case.
The Cryptshare User Interface will behave differently when using the 'get' parameter and offering wrong parameters. Unlike the error messages usually presented when downloading files via the web form, the interface will respond with the HTTP error code and the corresponding error message based on the error case.
Zeile 149: Zeile 116:
|-
|-
|
|
* There was a wrong password specified
* The authentication failed


|401
|401
Zeile 155: Zeile 122:
|-
|-
|
|
* The transfer was deleted because of a wrong password with this request
* The transfer was deleted because of wrong authentication with this request


|410
|410
Zeile 162: Zeile 129:
|
|
* The transfer was already locked
* The transfer was already locked
* The transfer was locked because of a wrong password
* The transfer was locked because of wrong authentication


|403
|403
|Forbidden
|Forbidden
|-
|
* The download of the transfer requires an ID provider authentication. Currently, such transfers can't be retrieved using this download interface.
|412
|Precondition failed
|-
|-
|
|
Zeile 176: Zeile 149:
This way it is easily possible to identify the reason for a download failure when using this feature in automation scripts or API's.
This way it is easily possible to identify the reason for a download failure when using this feature in automation scripts or API's.


{{Panel|title=Related Knowledge Base Articles|content=Error rendering macro 'sv-contentbylabel'null
{{Panel|title=Related Knowledge Base Articles|content='''Error rendering macro 'sv-contentbylabel''''
null
}}
}}


-----
-----

Version vom 7. September 2021, 09:51 Uhr



For automation processes it is possible to download a Cryptshare transfer directly without the need to operate the user interface manually. To do this, the additional GET parameter 'get' has to be appended to the link URL: `https://<Cryptshare Server URL>/download?id=<transfer-id>&password=<password>&<get[=all|=checksums|allWithChecksums|=<file-id>]>`

The URL below can still be used for the automated download of transfers, but will be deactivated with one of the next Cryptshare versions. `https://<Cryptshare Server URL>/download1.php?id=<transfer-id>&password=<passwort>&<get[=all


Retrieving Meta-Information about a transfer Attaching the 'get' parameter only results in an HTTP download offering a TXT document with information about the transfer. The information is offered in a JSON compatible manner. Structure JSON file (example data):

{  
   "file\_1":\[  
      {  
         "6ac31d4b8b":\[  
            "transferFile\_1.txt"
         \],
         "size":\[  
            0
         \],
         "sha1":\[  
            ""
         \],
		 "checksum":\[  
            "0a28b295a883e4122c36482e4b0ad2275bbd2ebd60d066dc6f9e7fe6922ad7f4"
         \],
		 "checksumAlgorithm":\[  
            "SHA-256"
         \]
      }
   \],
   "file\_2":\[  
      {  
         "4f0109ad8b":\[  
            "transferFile\_2.txt"
         \],
         "size":\[  
            0
         \],
  	     "sha1":\[  
            ""
         \],
         "checksum":\[  
            "32d9c815c2c3cf989007b613d37844d919a1e7070b67a501150d760ac860505e"
         \],
		 "checksumAlgorithm":\[  
            "SHA-256"
         \]
       
      }
   \],
   "totalSize":\[  
      0
   \]
}

`https://<Cryptshare Server URL>/download?id=234ds43re&password=23erwr2er&get` The file lists all files within this transfer together with their corresponding File-IDs. This provides the possibility to find a specific file and download this file with a separate call.

Downloading specific files

Attaching the 'get' parameter together with a specific file id results in an HTTP download offering the file which corresponds to this id. `https://cryptshare.yourdomain.com/download?id=234ds43re&password=23erwr2er&get=6ac31d4b8b` Using our example from above this call will download the file 'transferFile\_1.txt'.

Downloading all the files of a transfer

Attaching the 'get' parameter together with the key word 'all', results in a HTTP download offering a zip file containing all the files of the transfer. `https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er&get=all` This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt' and 'transferFile\_2.txt'.

Downloading the checksums of the files of a transfer

Attaching the 'get' parameter together with the key word 'checksums', results in a HTTP download offering a csv file containing information of the transfer. This information contains the notification subject of the transfer and the file names and their corresponding checksums. `https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er&get=checksums` This call will download the file 'checksums.csv' which, according to the meta information, will contain the following entries:

File Name Checksum
transferFile\_1.txt 0a28b295a883e4122c36482e4b0ad2275bbd2ebd60d066dc6f9e7fe6922ad7f4 (SHA-256)
transferFile\_2.txt 32d9c815c2c3cf989007b613d37844d919a1e7070b67a501150d760ac860505e (SHA-256)

Downloading all the files of a transfer

Attaching the 'get' parameter together with the key word 'allWithChecksums', results in a HTTP download offering a zip file containing all the files of the transfer and a csv file containing the checksums of the transfer's files. `https://cryptshare.ihredomain.de/download?id=234ds43re&password=23erwr2er&get=allWithChecksums` This call will download the file 'cs\_transfer.zip' which, according to the meta information, will contain the files 'transferFile\_1.txt', 'transferFile\_2.txt' and 'checksums.csv'.

HTTP error codes and messages

The Cryptshare User Interface will behave differently when using the 'get' parameter and offering wrong parameters. Unlike the error messages usually presented when downloading files via the web form, the interface will respond with the HTTP error code and the corresponding error message based on the error case.

Situation Code Code Description
  • There was no transfer-id specified
  • There was no password specified
400 Bad Request
  • The transfer-id was not found
  • There are no transfer files available
  • The transfer was deleted.
  • The file-id was not found
404 Not found
  • The authentication failed
401 Unauthorized
  • The transfer was deleted because of wrong authentication with this request
410 Gone
  • The transfer was already locked
  • The transfer was locked because of wrong authentication
403 Forbidden
  • The download of the transfer requires an ID provider authentication. Currently, such transfers can't be retrieved using this download interface.
412 Precondition failed
  • Successful call
200 OK

This way it is easily possible to identify the reason for a download failure when using this feature in automation scripts or API's.

Related Knowledge Base Articles
Error rendering macro 'sv-contentbylabel' null