修改规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
PUT /v2/openapi/instances/[instanceId]/rules/[ruleId] HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
instanceId | String | Path | 是 | airec-cn-o400whm78004 |
实例id |
ruleId | String | Path | 是 | xxx |
规则id |
json
// 修改选品规则
{ "type":"SelectionRule",
"ruleMeta":{
"sceneId":"123",
"ruleMetaType":"SELECTION",
"selectionParams":[
{
"selectType":"QUERY_ITEM_TYPE",
"selectionOperation":"QUERY_VALUE_IN",
"selectValue":"[\"atrical\",\"image\"]"
}
]
}
}
// 修改运营规则
{
"type":"OperationRule",
"ruleMeta":{
"ruleMetaType":"OPERATION",
"sceneId":"123",
"operationParams":[
{
"operationType":"MIX",
"settings":[
{
"name":"image",
"value":10
}
]
},
{
"operationType":"DIVERSIFY",
"status":true,
"diversifyType":"TYPE_SHOP",
"categoryIndex":1,
"window":2
},
{
"operationType":"EXPOSURE",
"exposureSettings":[
{
"durationSeconds":1234000,
"status":true,
"exposureType":"TYPE_EXPOSE",
"scenarioBased":true
},
{
"durationSeconds":123400,
"status":true,
"exposureType":"TYPE_CLICK",
"scenarioBased":true
},
{
"durationSeconds":3000,
"status":true,
"exposureType":"TYPE_LOOP",
"scenarioBased":false
}
]
}
]
}
}
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | String | InternalServerError |
错误码 |
message | String | An internal server error occurred |
错误详情 |
requestId | String | 8F81A922-6C81-46D6-B78C-CC35E16B1691 |
请求id |
result | Struct |
返回详情结果 |
|
gmtCreate | String | 2020-04-27T06:38:28.000Z |
创建时间 |
gmtModified | String | 2020-04-27T06:38:28.000Z |
最后修改时间 |
ruleId | String | 98493A14-D619-4E88-9F8D-108939817F9F |
规则id |
ruleMeta | Map | xxx |
规则的具体信息 |
status | String | true |
开关(true/false) |
示例
请求示例
PUT openapi/instances/{instanceId}/rules/{ruleId}
正常返回示例
JSON
格式
{"result":{"gmtModified":"2020-04-27T06:38:28.000Z","ruleId":"98493A14-D619-4E88-9F8D-108939817F9F","gmtCreate":"2020-04-27T06:38:28.000Z","status":"true","ruleMeta":"xxx"},"code":"InternalServerError","requestId":"8F81A922-6C81-46D6-B78C-CC35E16B1691","message":"An internal server error occurred"}
返回示例补充说明
```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"
}
// 运营规则
{
"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":12340,
"Status":true,
"ExposureType":"TYPE_EXPOSE",
"ScenarioBased":true
},
{
"DurationSeconds":12340000,
"Status":true,
"ExposureType":"TYPE_CLICK",
"ScenarioBased":true
},
{
"DurationSeconds":3000,
"Status":true,
"ExposureType":"TYPE_LOOP",
"ScenarioBased":false
}
]
}
]
}
},
"RequestId":"76E2C51D-A2D7-4775-9FD8-2AB84B2A0CEF"
}
```
错误码
访问错误中心查看更多错误码。