Xsolla-logo

创建目录筛选规则

post/v2/project/{project_id}/admin/user/attribute/rule

创建用户属性的规则。

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

项目ID。

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

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

is_enabled
required
boolean

如果已启用规则。

required
Array of objects [ 1 .. 100 ] items

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

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

用户属性代码。

operator
required
string

按条件执行的操作类型。

Enum: Description
eq

等于

ge

大于或等于

gt

大于

le

小于或等于

lt

小于

ne

不等于

value
required
string <= 255 characters

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

type
required
string

用户属性类型。

Enum: "string" "date" "number"
required
Array of objects or objects [ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
One of:

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

item_id
required
number

商品ID。

Responses
201

规则已成功创建。

401

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

422

请求验证错误。

Request samples
application/json
{
  • "attribute_conditions": [
    ],
  • "is_enabled": true,
  • "items": [
    ],
  • "name": "Ork race armor rule"
}
Response samples
application/json
{
  • "rule_id": 1
}