Updated on 2026-01-13 GMT+08:00

Extracting a Data Watermark

Function

This API is used to extract a data watermark.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/sdg/database/watermark/extract

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

watermark_key

Yes

String

Watermark key.

columns

Yes

Array of Columns objects

List of field types. There can be a maximum of 100 types. Ensure that all fields whose primary_key is true are contained and there is at least one field whose value is false to extract watermarks.

data

Yes

Array of Map<String,Object> objects

Watermark data. There can be a maximum of 30,000 records.

Table 4 Columns

Parameter

Mandatory

Type

Description

name

Yes

String

Field name, which can contain a maximum of 256 characters.

type

Yes

String

Field type.

primary_key

Yes

Boolean

Whether a field in the database table is a primary key.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

watermarks

Array of strings

List of watermarks extracted. The uploaded data may include different watermarks. All watermarks extracted are returned, and the number of watermarks cannot exceed 100.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Message

Example Requests

Extract database watermarks. The watermark key is "key", and the data field of the data type table is "col". This field is not a primary key.

POST https://{endpoint}/v1/{project_id}/sdg/database/watermark/extract

{
  "watermark_key" : "key",
  "columns" : [ {
    "name" : "col",
    "type" : "INTEGER",
    "primary_key" : false
  } ],
  "data" : [ {
    "col" : {
      "a" : 0.1
    }
  } ]
}

Example Responses

Status code: 200

Request successful.

{
  "watermarks" : [ "watermark" ]
}

Status code: 400

Parameter error.

{
  "error_code" : "DSC.00000004",
  "error_msg" : "Invalid parameter"
}

Status Codes

Status Code

Description

200

Request successful.

400

Parameter error.

Error Codes

See Error Codes.