Injecting a Data Watermark
Function
This API is used to dynamically inject a watermark into the JSON body.
URI
POST /v1/{project_id}/sdg/database/watermark/embed
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
Request 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). |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
watermark_content |
Yes |
String |
Watermark content |
|
watermark_key |
Yes |
String |
Watermark key |
|
columns |
Yes |
Array of Columns objects |
List of field types. The number of field types in a list cannot exceed 100. At least two fields must be included. primary_key set to true indicates the primary key and primary_key set to false indicates watermark injection. |
|
data |
Yes |
Array of Map<String,Object> objects |
Content of a field, which can contain a maximum of 2000 characters. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
marked_data |
Array of Map<String,Object> objects |
Watermarked data |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error Code |
|
error_msg |
String |
Error Message |
Example Requests
Embed the watermark test12345678test. The watermark key is "keyword". The data field of the data type table is "item1". This field is the primary key.
POST https://{endpoit}/v1/{project_id}/sdg/database/watermark/embed
{
"watermark_content" : "test12345678test",
"watermark_key" : "keyword",
"columns" : [ {
"name" : "item1",
"type" : "INTEGER",
"primary_key" : true
}, {
"name" : "item2",
"type" : "INTEGER",
"primary_key" : false
} ],
"data" : [ {
"item1" : 0,
"item2" : 3
}, {
"item1" : 1,
"item2" : 4
} ]
}
Example Responses
Status code: 200
Request successful.
{
"marked_data" : [ {
"item2" : 3,
"item1" : "test"
}, {
"item2" : 5,
"item1" : "test"
} ]
}
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.