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 purchased

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

method: POST

requestBody:
{
    "ruleId": "mrxxxxxxxx",
    "ruleName": "xxxxxx",
    "isEnable": 0,
    "messageRule": {
        "mark1": ["siteA","siteB"],
        "mark2": ["deviceA","deviceB"],
        "mark3": ["fault"],
        "mark4": [""],
        "mark6": null
    },
    "relations": [
        {
            "type": 0,
            "identifiers": ["u16256471457621422","u16256647859583527"]
        },
        {
            "type": 1,
            "identifiers": ["ug16256509948171695"]
        }
    ]
}

Return Sample


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