Search Message Rules


Search message rules.

Request Format


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

Request Parameters (Header)


Name

Mandatory/Optional

Data Type

Description

Authorization

Optional

String

User identification

Request Parameters (URI)


Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

OU ID

Request Parameters (Body)


Name

Mandatory/Optional

Data Type

Description

appId

Optional

String

Application ID

identifier

Optional

String

The ID of user or user group

identifierType

Optional

Integer

Object type0 for user, 1 for user group

ruleIds

Mandatory

List

The list of message rule IDs

createdBy

Optional

String

The creator of the message rule.

Response Parameters


Name

Data Type

Description

messageRuleList

MessageRuleDTO Struct

Message rule lists

MessageRuleDTO Struct


Name

Data Type

Description

appId

String

Application ID

ruleId

String

Message rule ID

ruleName

String

Message rule name

relations

RelationDTO Struct

The users or user groups associated with the message rule

messageRule

Object

Message rules

isEnable

Integer

Whether the rule is enabled

createdBy

String

The user who creates the message rule

createdAt

String

The time when user creates the message rule

updatedBy

String

The user who updates the message rule

updatedAt

String

The time when user updates the message rule

deletedBy

String

The user who deletes the message rule

deletedAt

String

The time when user deletes the message rule

RelationDTO Struct


Name

Data Type

Description

type

Integer

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 purchase the application

31600

message rule error

31601

The number of message rules exceeds the limit

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=oxxxxxxxxxxx

method: POST

requestBody:
{
    "appId": "5244xxxx-522c-43f6-af4e-e8575xxxxxx",
    "ruleIds": ["mr16256509948xxxxxx","mr16256509948xxxxxx"],
    "identifier": "u16256471457xxxxxx",
    "identifierType": 0,
    "createdBy": "u16256471457xxxxxx"
}

Return Sample


{
    "code": 0,
    "message": "OK",
    "data": {
        "messageRuleList": [
            {
                "appId": "",
                "ruleId": "",
                "ruleName": "",
                "relations": [
                    {
                        "type": 0,
                        "identifiers": ["u16256471457xxxxxx","u16256647859xxxxxx"]
                    },
                    {
                        "type": 1,
                        "identifiers": ["ug16256509948xxxxxx"]
                    }
                ],
                "messageRule": {
                    "mark1": ["siteA","siteB"],
                    "mark2": ["deviceA","deviceB"],
                    "mark3": ["fault"],
                    "mark4": [""],
                    "mark6": null
                },
                "isEnable": 1,
                "createdBy": "uxxxxxxx",
                "createdAt": "2021-01-01 00:00:00",
                "updatedBy": "uxxxxxxx",
                "updatedAt": "2021-01-01 00:00:00",
                "deletedAt": null,
                "deletedBy": null
            }
        ]
    }
}