Updated on 2023-01-18 GMT+08:00

Querying a Data Set

Function

This API is used to query a data set based on the publisher identifier and product ID.

URI

POST /v1/datashare/query-dataset

Request Parameters

Table 1 Request body 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.

provider

Yes

String

Data set publisher identifier.

productID

Yes

String

Data set product ID.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

provider

String

Data set provider identifier.

providerName

String

Data set provider name.

productName

String

Data set product name.

productID

String

Data set product ID.

sampleUrl

String

Sample data URL.

sampleSize

String

Sample data size.

sampleType

String

Sample data type.

sampleName

String

Sample data name.

fileType

String

File type.

dataUrl

String

Data URL.

dataHash

String

Data hash value.

dataSize

String

Data size.

dataName

String

Data name.

description

String

Data description.

price

String

Data price.

encryptedAesKey

String

Private key.

status

String

Status.

publishTime

String

Data publishing time.

dataFiles

Array of DataFile objects

Data file list.

sampleFiles

Array of DataFile objects

Sample file list.

category

String

Encryption type.

Table 3 DataFile

Parameter

Type

Description

fileType

String

File type.

dataUrl

String

Data URL.

dataHash

String

Data hash value.

dataSize

String

Data size.

dataName

String

Data name.

Status code: 500

Table 4 Response body parameters

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",
  "provider" : "did:example:DHkJjyD5wZwya6sd6BNBnG",
  "productID" : "product2"
}

Example Responses

Status code: 200

Operation result.

{
  "provider" : "did:example:DHkJjyD5wZwya6sd6BNBnG",
  "providerName" : "aws",
  "productName" : "prodname2",
  "productID" : "product2",
  "sampleUrl" : "http://hwcloud.com/sample.com/prodname2",
  "sampleSize" : "10KB",
  "sampleType" : "csv",
  "sampleName" : "data_sub1",
  "fileType" : "csv",
  "dataUrl" : "http://hwcloud.com/prodname2",
  "dataHash" : "2282ba7a1a2ef5700609214a997d3d4237a03bfd3632c6d089e57e7b6f467969",
  "dataSize" : "100MB",
  "dataName" : "mydata",
  "description" : "this is second prod",
  "price" : "0",
  "encryptedAesKey" : "BA4Ub3t3IskN8uKcEMa+4cbtsDS8OzF4V/qqb4OcPMeMvp7IL+HClzAbL6lPnhbDg/AnrStBlf0qFzRj+qvk6ZH0c7wP0aS48fSoNtecG79aFpFx0dg7rFdVYXWWzgeyI03eD3gFdXlQ/ovpxKJG5ALK39OCazUqDrawZHSDGyIlw0hGh88Q+GVORVSp+6V5Ag==",
  "status" : "ready",
  "publishTime" : "1607157244",
  "dataFiles" : [ {
    "fileType" : "csv",
    "dataUrl" : "http://hwcloud.com/prodname2",
    "dataHash" : "2282ba7a1a2ef5700609214a997d3d4237a03bfd3632c6d089e57e7b6f467969",
    "dataSize" : "100MB",
    "dataName" : "mydata"
  } ],
  "sampleFiles" : [ {
    "fileType" : "csv",
    "dataUrl" : "http://hwcloud.com/prodname2",
    "dataHash" : "2282ba7a1a2ef5700609214a997d3d4237a03bfd3632c6d089e57e7b6f467969",
    "dataSize" : "100MB",
    "dataName" : "mydata"
  } ],
  "category" : "string"
}

Status code: 500

Error response.

{
  "errorCode" : "BCS.5002046",
  "errorMsg" : "Incorrect number of arguments"
}

Status Codes

Status Code

Description

200

Operation result.

500

Error response.

Error Codes

See Error Codes.