Search Message Rules


Search message rules.

Request Format


POST https://{apigw-address}/app-portal-service/v2.2/message-service/rule/search

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

orgId

Query

Required

String

OU ID. How to get orgId >>

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

appId

Optional

String

The access key of the application. If not specified, all message rules associated with applications in the OU are returned by default. How to get Access Key >>

identifier

Optional

String

The ID of user or user group. If not specified, message rules associated with all objects in the OU are returned by default.

identifierType

Optional

Integer

The associated object type. The following values ​​are supported:

  • 0: user.

  • 1: user group.

If not specified, all types of message rules are returned by default.

ruleIds

Required

List

The list of message rule IDs.

createdBy

Optional

String

The creator of the message rule. If not specified, all message rules created by users in the OU are returned by default.

Response Parameters


Name

Data Type

Description

messageRuleList

MessageRuleDTO Struct

Message rule lists. MessageRuleDTO Struct >>

MessageRuleDTO Struct


Name

Data Type

Description

appId

String

The access key of the application.

ruleId

String

Message rule ID.

ruleName

String

Message rule name.

relations

RelationDTO Struct

The users or user groups associated with the message rule. RelationDTO Struct >>

messageRule

Object

The content of the message rule.

isEnable

Integer

Whether the rule is enabled. true means enabled, false means disabled.

createdBy

String

The creator of the message rule.

createdAt

String

The creation time of the message rule.

updatedBy

String

The updater of the message rule.

updatedAt

String

The update time of the message rule.

RelationDTO Struct


Name

Data Type

Description

type

Integer

Object type. 0 for user, 1 for user group.

identifiers

List

The ID of user or user group.

Error Codes


Error Code

Description

31400

OU ID is required.

31404

OU, application or message rule does not exist, or the OU does not acquire the application.

31600

Message rule error.

31602

The number of marks in the message rule exceeds the limit.

31603

The message rule does not match.

31604

Message rule marks are required.

31607

Organization structure error.

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/message-service/rule/search?orgId=your_org_id

method: POST

requestBody:
{
    "appId": "your_access_key",
    "ruleIds": ["your_rule_id_1","your_rule_id_2"],
    "identifier": "your_user_id",
    "identifierType": 0,
    "createdBy": "your_user_id"
}

Return Sample


{
    "code": 0,
    "message": "OK",
    "data": {
        "messageRuleList": [
            {
                "appId": "your_access_key",
                "ruleId": "",
                "ruleName": "",
                "relations": [
                    {
                        "type": 0,
                        "identifiers": ["your_user_id_1","your_user_id_2"]
                    },
                    {
                        "type": 1,
                        "identifiers": ["your_user_group_id"]
                    }
                ],
                "messageRule": {
                    "mark1": ["siteA","siteB"],
                    "mark2": ["deviceA","deviceB"],
                    "mark3": ["fault"],
                    "mark4": [""],
                    "mark6": null
                },
                "isEnable": 1,
                "createdBy": "your_user_id",
                "createdAt": "2021-01-01 00:00:00",
                "updatedBy": "your_user_id",
                "updatedAt": "2021-01-01 00:00:00"
            }
        ]
    }
}