All Products
Search
Document Center

:ListRules

Last Updated:Jan 15, 2021

Description

Queries rules.

Method

GET

URI

openapi/instances/{instanceId}/rules GET

Request parameters

Parameter

Type

Required

Description

instanceId

String

Yes

The ID of the instance.

ruleType

String

Yes

The type of the rule. Valid values: selection and operation.

sceneId

String

Yes

The ID of the scene.

status

Sring

No

The status. Valid values: DRAFT, EFFECTIVE, PUBLISHING, INEFFECTIVE, and FAILED.

page

Integer

No

The number of the page to return. Default value: 1.

size

Integer

No

The number of entries to return on each page. Valid values: 1 to 50. Default value: 10.

startTime

Long

No

The start time. The value must be accurate to the second.

endTime

Long

No

The end time. The value must be accurate to the second.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request.

Result

List

The rules.

Headers

Map

Details about headers.

└X-Total-Count

Integer

The total number of rules.

Examples

Sample requests

GET /openapi/instances/{airec-xxxx}/rules?ruleType=xxx&sceneId=1234&page=1&size=10

Sample responses

JSON format

// Item selection rules
{
    "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
    }
}

// Operations rules
{
    "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
    }
}

Sample responses with no results

{
    "RequestId":"8F81A922-6C81-46D6-B78C-CC35E16B1691",
    "Result":[]
}

Sample error responses

JSON format

{
    "Code": "InstanceNotFound",
    "Message": "The specified instance does not exist. Check the instanceId please.",
    "RequestId": "829F38F6-E2D6-4109-90A6-888160BD16C2"
}