查询规则列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
GET /v2/openapi/instances/[instanceId]/rules HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
instanceId | String | Path | 是 | airec-cn-o400whm78004 |
实例id |
ruleType | String | Query | 是 | selection |
selection 选品规则 operation 运营规则 |
sceneId | String | Query | 是 | test |
指定场景id, 全局运营规则是关键字 global |
status | String | Query | 否 | EFFECTIVE |
DRAFT 草稿状态; EFFECTIVE 生效状态; PUBLISHING 发布中状态; INEFFECTIVE 已失效状态; FAILED 未生效状态。 |
page | Integer | Query | 否 | 1 |
指定页码,默认为:1 |
size | Integer | Query | 否 | 10 |
指定每页展示条数,默认为10,限制:1-50 |
startTime | Long | Query | 否 | 1567584765 |
开始时间(秒级时间戳) |
endTime | Long | Query | 否 | 1567584765 |
结束时间 (秒级时间戳) |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | String | InternalServerError |
错误码 |
message | String | An internal server error occurred |
错误详情 |
requestId | String | 8F81A922-6C81-46D6-B78C-CC35E16B1691 |
请求id |
result | Array of Result |
返回详情结果 |
|
gmtCreate | String | 2020-04-27T06:38:28.000Z |
创建时间 |
gmtModified | String | 2020-04-27T06:38:28.000Z |
最后修改时间 |
ruleId | String | 98493A14-D619-4E88-9F8D-108939817F9F |
规则id |
status | String | true |
开关(true/false) |
示例
请求示例
GET /openapi/instances/{airec-xxxx}/rules?ruleType=xxx&sceneId=1234&page=1&size=10
正常返回示例
XML
格式
<0>
<Result>
<Status>DRAFT</Status>
<GmtCreate>2020-04-27T06:38:28.000Z</GmtCreate>
<GmtModified>2020-04-27T06:38:28.000Z</GmtModified>
<RuleId>98493A14-D619-4E88-9F8D-108939817F9F</RuleId>
<RuleMeta>
<RuleMetaType>SELECTION</RuleMetaType>
<SceneId>123</SceneId>
<PubState>PUBLISHING</PubState>
<SelectionParams>
<SelectType>QUERY_ITEM_TYPE</SelectType>
<SelectionOperation>OPERATOR_EQUAL</SelectionOperation>
<SelectValue>atrical,image</SelectValue>
</SelectionParams>
</RuleMeta>
</Result>
<RequestId>76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF</RequestId>
<Headers>
<X-Total-Count>19</X-Total-Count>
</Headers>
</0>
<1>
<Result>
<Status>DRAFT</Status>
<GmtCreate>2020-04-27T03:17:21.000Z</GmtCreate>
<GmtModified>2020-04-27T03:17:21.000Z</GmtModified>
<RuleId>123456789001122</RuleId>
<RuleMeta>
<RuleMetaType>OPERATION</RuleMetaType>
<SceneId>123</SceneId>
<PubState>PUBLISHING</PubState>
<OperationParams>
<OperationType>MIX</OperationType>
<Settings>
<Name>image</Name>
<Value>10</Value>
</Settings>
</OperationParams>
<OperationParams>
<OperationType>DIVERSIFY</OperationType>
<CategoryIndex>1</CategoryIndex>
<Window>2</Window>
<Status>true</Status>
<DiversifyType>TYPE_SHOP</DiversifyType>
</OperationParams>
<OperationParams>
<OperationType>EXPOSURE</OperationType>
<ExposureSettings>
<DurationSeconds>1234000</DurationSeconds>
<Status>true</Status>
<ExposureType>TYPE_EXPOSE</ExposureType>
<ScenarioBased>true</ScenarioBased>
</ExposureSettings>
<ExposureSettings>
<DurationSeconds>123400</DurationSeconds>
<Status>true</Status>
<ExposureType>TYPE_CLICK</ExposureType>
<ScenarioBased>true</ScenarioBased>
</ExposureSettings>
</OperationParams>
</RuleMeta>
</Result>
<RequestId>76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF</RequestId>
<Headers>
<X-Total-Count>19</X-Total-Count>
</Headers>
</1>
JSON
格式
[{
"Result": [{
"Status": "DRAFT",
"GmtCreate": "2020-04-27T06:38:28.000Z",
"GmtModified": "2020-04-27T06:38:28.000Z",
"RuleId": "98493A14-D619-4E88-9F8D-108939817F9F",
"RuleMeta": {
"RuleMetaType": "SELECTION",
"SceneId": "123",
"PubState": "PUBLISHING",
"SelectionParams": [{
"SelectType": "QUERY_ITEM_TYPE",
"SelectionOperation": "OPERATOR_EQUAL",
"SelectValue": "atrical,image"
}]
}
}],
"RequestId": "76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF",
"Headers": {
"X-Total-Count": 19
}
},
{
"Result": [{
"Status": "DRAFT",
"GmtCreate": "2020-04-27T03:17:21.000Z",
"GmtModified": "2020-04-27T03:17:21.000Z",
"RuleId": "123456789001122",
"RuleMeta": {
"RuleMetaType": "OPERATION",
"SceneId": "123",
"PubState": "PUBLISHING",
"OperationParams": [{
"OperationType": "MIX",
"Settings": [{
"Name": "image",
"Value": 10
}]
},
{
"OperationType": "DIVERSIFY",
"CategoryIndex": 1,
"Window": 2,
"Status": true,
"DiversifyType": "TYPE_SHOP"
},
{
"OperationType": "EXPOSURE",
"ExposureSettings": [{
"DurationSeconds": 1234000,
"Status": true,
"ExposureType": "TYPE_EXPOSE",
"ScenarioBased": true
},
{
"DurationSeconds": 123400,
"Status": true,
"ExposureType": "TYPE_CLICK",
"ScenarioBased": true
}
]
}
]
}
}],
"RequestId": "76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF",
"Headers": {
"X-Total-Count": 19
}
}
]
错误码
访问错误中心查看更多错误码。