Obtaining Plaintext Data
Function
This API is used to obtain the decrypted plaintext. Watermarking is not supported.
URI
POST /v1/datashare/dataset/query-plaintext
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
orgID |
Yes |
String |
Organization ID. |
channelID |
Yes |
String |
Channel ID. |
cryptoMethod |
Yes |
String |
Encryption method, which is fixed at SW. |
cert |
Yes |
String |
Certificate. |
sk |
Yes |
String |
Private key. |
timestamp |
Yes |
String |
Timestamp. |
consumer |
Yes |
String |
Order applicant identifier. |
orderSeq |
Yes |
String |
Order number. |
encryptData |
No |
String |
Ciphertext data. This parameter is optional when onChainStore is set to true. |
watermarkType |
No |
String |
Watermark type, which can be visible or blind. Specify this parameter if you want to embed a watermark. If a blind watermark has already been embedded into the data set to be published or shared, no more blind watermarks can be embedded into the data set. The embedded watermark is in the format of User DID_Order ID. |
onChainStore |
No |
String |
Whether to store ciphertext data on the chain. The value can be true or false (default). If you set this parameter to true, you do not need to specify encryptData. The ciphertext data can be automatically obtained from the chain. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
provider |
String |
Order provider identifier. |
productID |
String |
Data set product ID. |
plaintext |
String |
Plaintext of the Base64-encoded data. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. |
errorMsg |
String |
Error description. |
Example Requests
{ "orgID" : "ce0ac69b0c8648cd25b44a551780409767c8890b", "channelID" : "mychannel", "cryptoMethod" : "SW", "cert" : "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----", "sk" : "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----", "timestamp" : "2020-10-27T17:28:16+08:00", "consumer" : "did:example:3TMWx8owKHARgNwbj4ywmG", "orderSeq" : "1", "encryptData" : "base64 encoding string", "watermarkType" : "string", "onChainStore" : "string" }
Example Responses
Status code: 200
Order information.
{ "provider" : "did:example:DHkJjyD5wZwya6sd6BNBnG", "productID" : "product1", "plaintext" : "base64 encoding string" }
Status code: 500
Error response.
{ "errorCode" : "BCS.5002046", "errorMsg" : "Incorrect number of arguments" }
Status Codes
Status Code |
Description |
---|---|
200 |
Order information. |
500 |
Error response. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot