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

Listing Data Sets

Function

This API is used to query data sets by pages and specific conditions.

URI

POST /v1/datashare/query-datasets

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.

currentPage

No

String

Pagination parameter: page number (default value: 1).

pageSizeNum

No

String

Pagination parameter: number of records on each page (default value: 100).

provider

No

String

Filtering condition: publisher identifier.

searchText

No

String

Filtering condition: keywords (names and descriptions of products in the data set).

status

No

String

Filtering condition: data set status (ready or closed).

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

items

Array of DatasetResponse objects

List.

pagination

PaginationResp object

Pagination information.

Table 3 DatasetResponse

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 4 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.

Table 5 PaginationResp

Parameter

Type

Description

currentPage

Integer

Current page.

pageSizeNum

Integer

Number of records on each page.

totalItems

Integer

Total number of records.

Status code: 500

Table 6 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",
  "currentPage" : "string",
  "pageSizeNum" : "string",
  "provider" : "string",
  "searchText" : "string",
  "status" : "string"
}

Example Responses

Status code: 200

Data set pagination information.

{
  "items" : [ {
    "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"
  } ],
  "pagination" : {
    "currentPage" : 1,
    "pageSizeNum" : 100,
    "totalItems" : 10
  }
}

Status code: 500

Error response.

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

Status Codes

Status Code

Description

200

Data set pagination information.

500

Error response.

Error Codes

See Error Codes.