Xsolla-logo
  • 文档
  • 创建帐户

补丁目录筛选规则Server-sideAdmin

patch/v2/project/{project_id}/admin/user/attribute/rule/{rule_id}

更新应用于用户属性的指定规则。当前值将用于未指定的属性。

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

项目编号。您可以在您的发布商帐户项目名称旁边。

Example: 44056
rule_id
required
number

规则ID。

Example: 1
Request Body schema: application/json
Array of type = string (objects) or Array of type = date (objects) or Array of type = number (objects)
One of:

与用户属性值进行比较的条件。 必须满足所有条件操作才生效。

[ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
attribute
required
string [ 1 .. 255 ] characters ^[-_.\\d\\w]+$

用户属性代码。

operator
required
string

按条件执行的操作类型。用于string属性类型。

Enum: Description
eq

等于

ne

不等于

value
required
string <= 255 characters

与用户属性值进行比较的条件值。类型取决于属性类型。

type
required
string

用户属性类型。

Value: "string"
can_be_missing
boolean

表示即使用户属性中缺少属性仍满足条件。传递true可向不具有此属性的用户显示该项目。具有该属性但值与条件中指定的值不匹配的用户将看不到该商品。传递False则具有该属性但值与条件中指定的值不匹配或缺少该属性的用户将看不到该商品。

is_enabled
boolean

If rule is enabled.

is_satisfied_for_unauth
boolean

Whether the item is displayed to unauthorized users. If true, the item is displayed to the unauthorized user regardless of catalog display rules. false by default.

Array of objects or objects [ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
One of:

Items which are shown to a user if their attribute values meet conditions.

item_id
required
number

Item ID.

name
string [ 1 .. 255 ] characters ^\S

Readable name of a rule. Used to display a rule in Publisher Account.

Responses
204

更新成功。

401

身份认证未通过或错误。请确保您使用了身份认证或正确的凭据。

422

请求验证错误。

Request samples
application/json
{
  • "is_enabled": false
}
Response samples
application/json
{
  • "errorCode": 1501,
  • "errorMessage": "[0401-1501]: Authorization failed: Authorization header not sent",
  • "statusCode": 401,
  • "transactionId": "x-x-x-x-transactionId-mock-x-x-x"
}