Skip to content

アラート通知(notifyAlert)着信

アラート通知メッセージを受信します。

出力サンプル

{
    "jsonrpc": 2,
    "method": "notifyAlert",
    "result": {
        "condition": {
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                            139.744595779187,
                            35.7330988098923
                        ],
                        ...
                    ]
                ]
            },
            "properties": {
                "theme": "rm_hiyarihatto",
                "threshold": 1,
                "interval": 5,
                "notified": 1
            }
        },
        "alert": {
            "type": "FeatureCollection",
            "name": "alertResponse",
            "extraProperties": {
                "servertime": "2018-09-18 09:00:00+0000"
            },
            "features": [
                {
                    "type": "Feature",
                    "properties": {
                        "theme": "rm_hiyarihatto",
                        "risk": 1,
                        "datetime": null
                    },
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [
                            [
                                [
                                    139.73892234757713,
                                    35.72854147669082
                                ],
                                ...
                            ]
                        ]
                    }
                },
                {
                    "type": "Feature",
                    "properties": {
                        "theme": "rm_hiyarihatto",
                        "risk": 2,
                        "datetime": null
                    },
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [
                            [
                                [
                                    139.73907227364109,
                                    35.72999964639976
                                ],
                                ...
                            ]
                        ]
                    }
                },
                ...
            ]
        }
    },
    "id": 1
}

... 部分は内容を省略しています。

戻り値

アラート通知APIのメッセージのやりとりはWebSocketを利用しますが、notifyAlertの内容はJSON-RPCのレスポンス形式で受信します。

キー
jsonrpc 2.0
method notifyAlert
result "alert" 及び "condition" を持つオブジェクト
id 任意

result部の書式

キー
alert 監視対象のアラート内容を表すGeoJSON、アラートが発生していなければnull
"extraProperties" にアラート時刻を持つ
condition setAlertまたはalterAlert時に送信して指定したジオメトリオブジェクト
"properties" に検索条件のテーマ・閾値・インターバルを持つ

alert.extraProperties、condition.properties部の書式

キー
alert.extraProperties.servertime アラートの発生時間
YYYY-MM-DD HH:MM:SS+0000 の文字列
condition.properties.comment
condition.properties.theme
condition.properties.threshold
condition.properties.interval
condition.properties.thinning_step
condition.properties.thinning_filter_step
setAlert,alterAlert時に設定したproperties