Xsolla-logo

更新目录筛选规则

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

更新应用于用户属性的指定规则。默认值将用于未指定的属性(如果属性非必需)。

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

项目ID。

Example: 44056
rule_id
required
number

规则ID。

Example: 1
Request Body schema: application/json
name
required
string [ 1 .. 255 ] characters ^\S

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

is_enabled
required
boolean

如果已启用规则。

required
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"
required
Array of objects or objects [ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
One of:

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

item_id
required
number

商品ID。

Responses
204

更新成功。

401

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

422

请求验证错误。

Request samples
application/json
{
  • "attribute_conditions": [
    ],
  • "is_enabled": true,
  • "items": [
    ],
  • "name": "Ork race armor rule"
}
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"
}