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

Indicates that the condition is met even if attribute is missing from user attributes. Pass true to show the item to users who don't have this attribute. Users who have the attribute, but the value does not match that specified in the condition, will not see the item. False — users who have the attribute, but the value does not match that specified in the condition, or the attribute is missing, will not see the item.

is_enabled
boolean

如果已启用规则。

is_satisfied_for_unauth
boolean

是否向未经授权的用户显示该商品。如为true,无论目录显示规则如何,该商品都会向未经授权的用户显示。默认为false

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

属性值满足条件的情况下向用户显示的商品。

item_id
required
number

商品ID。

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

规则的可读名称。用于在发布商帐户中显示规则。

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"
}