Help Center/ Database Security Service/ API Reference/ API/ Audit Rules/ Querying a Privacy Data Masking Rule
Updated on 2025-06-19 GMT+08:00

Querying a Privacy Data Masking Rule

Function

This API is used to query a privacy data masking rule.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/{instance_id}/dbss/audit/sensitive/masks

Table 1 URI parameter

Parameter

Mandatory

Parameter Type

Description

project_id

Yes

String

Project ID.

instance_id

Yes

String

Instance ID. You can obtain the value from the ID field in the API for querying the instance list.

Table 2 Query parameter

Parameter

Mandatory

Parameter Type

Description

offset

No

String

Offset

limit

No

String

Number of query records.

Request Parameter

Table 3 Request header parameter

Parameter

Mandatory

Parameter Type

Description

X-Auth-Token

Yes

String

User token. The token can be queried by calling the IAM API. (The token is the value of X-Subject-Token in the response header.)

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Parameter Type

Description

rules

Array of rules objects

Rules

total

Integer

Total number

Table 5 rules

Parameter

Parameter Type

Description

id

String

Rule ID

name

String

Rule name.

type

String

Rule types. The value can be:

  • BUILD_IN: built-in rules
  • USER_DEFINE: user-defined rules

regex

String

Regular expression

mask_value

String

Substitution value

status

String

Rule status

operate_time

String

Operation time

Status code: 400

Table 6 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 7 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 403

Table 8 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 9 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 10 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 11 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

/v1/{project_id}/{instance_id}/dbss/audit/sensitive/masks

Example Response

Status code: 200

Execution succeeded.

{
  "rules" : [ {
    "id" : "n34W2ngBo47GiyUSKOVl",
    "name" : "Passport NO.",
    "type" : "BUILD_IN",
    "regex" : "-",
    "mask_value" : "###",
    "status" : "ON",
    "operate_time" : "2030-01-01 00:00:06"
  }, {
    "id" : "nn4W2ngBo47GiyUSKOVP",
    "name" : "Military officer card NO.",
    "type" : "BUILD_IN",
    "regex" : "-",
    "mask_value" : "###",
    "status" : "ON",
    "operate_time" : "2030-01-01 00:00:05"
  }, {
    "id" : "nX4W2ngBo47GiyUSKOU9",
    "name" : "Ethnicity",
    "type" : "BUILD_IN",
    "regex" : "-",
    "mask_value" : "###",
    "status" : "ON",
    "operate_time" : "2030-01-01 00:00:04"
  }, {
    "id" : "mn4W2ngBo47GiyUSKOUO",
    "name" : "GPS Information",
    "type" : "BUILD_IN",
    "regex" : "-",
    "mask_value" : "###",
    "status" : "ON",
    "operate_time" : "2030-01-01 00:00:01"
  } ],
  "total" : 6
}

Status code: 400

Incorrect request parameter.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status code: 500

Internal server error.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status Code

Status Code

Description

200

Request succeeded.

400

Incorrect request parameter.

403

Authentication failed.

500

Internal Server Error

Error Code

For details, see Error Codes.