Update Message Rules


Update message rules.

Request Format


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

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

ruleId

Mandatory

String

Message rule ID

ruleName

Optional

String

Message rule name

isEnable

Optional

String

Enable or disable the rule. 0 for disable, 1 for enable

messageRule

Mandatory

Object

Message rules

relations

Optional

RelationDTO Struct

The users or user groups associated with the rules

RelationDTO Struct


Name

Mandatory/Optional

Data Type

Description

type

Optional

Integer

Type. 0 for user, 1 for user group

identifiers

Optional

List

The ID of user or user group

Response Parameters


Name

Data Type

Description

data

Boolean

True for updated, false for failed to update

Error Codes


Error Code

Description

31400

Possible causes: OU ID is required, parameters are invalid, etc.

31404

Possible causes: non-existed OU, application, user, user group, or message rules; or application not acquired

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/update?orgId=your_org_id

method: POST

requestBody:
{
    "ruleId": "your_rule_id",
    "ruleName": "your_rule_name",
    "isEnable": 0,
    "messageRule": {
        "mark1": ["siteA","siteB"],
        "mark2": ["deviceA","deviceB"],
        "mark3": ["fault"],
        "mark4": [""],
        "mark6": null
    },
    "relations": [
        {
            "type": 0,
            "identifiers": ["your_user_id_1","your_user_id_2"]
        },
        {
            "type": 1,
            "identifiers": ["your_user_group_id"]
        }
    ]
}

Return Sample


{
    "code": 0,
    "message": "OK",
    "data": true
}