All Products
Search
Document Center

:ModifyRule

Last Updated:Mar 01, 2024

Modifies a rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

PUT /v2/openapi/instances/{instanceId}/rules/{ruleId}

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringYes

The ID of the instance.

airec-cn-o400whm78004
ruleIdstringYes

The ID of the rule.

xxx
// Modify an item selection rule.
{	  "type":"SelectionRule",
    "ruleMeta":{
        "sceneId":"123",
        "ruleMetaType":"SELECTION",
        "selectionParams":[
            {
                "selectType":"QUERY_ITEM_TYPE",
                "selectionOperation":"QUERY_VALUE_IN",
                "selectValue":"[\"atrical\",\"image\"]"
            }
        ]
    }
}
// Modify an operations rule.
{
    "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
                    }
                ]
            }
        ]
    }
}

Response parameters

ParameterTypeDescriptionExample
object
resultobject

The returned result.

ruleIdstring

The ID of the rule.

98493A14-D619-4E88-9F8D-108939817F9F
ruleMetaobject

The specific information about the rule.

xxx
gmtModifiedstring

The time when the rule was last modified.

2020-04-27T06:38:28.000Z
statusstring

Indicates whether the rule is enabled. Valid values: true and false.

true
gmtCreatestring

The time when the rule was created.

2020-04-27T06:38:28.000Z
codestring

The error code.

InternalServerError
requestIdstring

The ID of the request.

8F81A922-6C81-46D6-B78C-CC35E16B1691
messagestring

The error message.

An internal server error occurred

Examples

Sample success responses

JSONformat

{
  "result": {
    "ruleId": "98493A14-D619-4E88-9F8D-108939817F9F",
    "ruleMeta": {
      "test": "test",
      "test2": 1
    },
    "gmtModified": "2020-04-27T06:38:28.000Z",
    "status": "true",
    "gmtCreate": "2020-04-27T06:38:28.000Z"
  },
  "code": "InternalServerError",
  "requestId": "8F81A922-6C81-46D6-B78C-CC35E16B1691",
  "message": "An internal server error occurred"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history