Can we have alert notifications on google hangout?

A screenshot doesn’t show much, here is an obfuscated webhook URL, I just had to change the ‘%3D’ to an “=”:
https://chat.googleapis.com/v1/spaces/AASDF1V6QNs/messages?key=ASDFASDFASDFASDASDFjMm-ASDFASDFASDFASDF&token=ASDFASDFASDFASDFASDFASDFASDFASDF_z7oDQ8o7yk=

For APM alerts I used the following JSON:

{
    "cards": [
        {
            "sections": [
                {
                    "widgets": [
                        {
                            "keyValue": {
                                "topLabel": "NEW RELIC $EVENT_TYPE $INCIDENT_ID", 
                                "content": "$SEVERITY - $EVENT_STATE", 
                                "onClick": {
                                    "openLink": {
                                        "url": "$INCIDENT_URL"
                                    }
                                }
                            }
                        }
                    ]
                }, 
                {
                    "widgets": [
                        {
                            "keyValue": {
                                "content": "$CONDITION_NAME", 
                                "topLabel": "Condition"
                            }
                        }, 
                        {
                            "keyValue": {
                                "content": "$POLICY_NAME", 
                                "topLabel": "Policy"
                            }
                        }, 
                        {
                            "keyValue": {
                                "content": "$EVENT_DETAILS", 
                                "topLabel": "Details", 
                                "contentMultiline": "true"
                            }
                        }
                    ]
                }, 
                {
                    "widgets": [
                        {
                            "image": {
                                "imageUrl": "$VIOLATION_CHART_URL"
                            }
                        }
                    ]
                }, 
                {
                    "widgets": [
                        {
                            "buttons": [
                                {
                                    "textButton": {
                                        "text": "View $EVENT_TYPE", 
                                        "onClick": {
                                            "openLink": {
                                                "url": "$INCIDENT_URL"
                                            }
                                        }
                                    }
                                },
                                {
                                    "textButton": {
                                        "text": "Ack $EVENT_TYPE", 
                                        "onClick": {
                                            "openLink": {
                                                "url": "$INCIDENT_ACKNOWLEDGE_URL"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

I would suggest starting with a simple JSON body like:

{"text": "New Relic Test"}
2 Likes

Also, replace the double quotes to non-unicode ones (Remembered bbcode [code] tags)

Thank you, this JSON payload worked beautifully!

1 Like

For Infrastructure alerts, you can’t use the $VIOLATION_CHART_URL variable, use this:

 {
    "cards": [
        {
            "sections": [
                {
                    "widgets": [
                        {
                            "keyValue": {
                                "topLabel": "NEW RELIC $EVENT_TYPE $INCIDENT_ID", 
                                "content": "$SEVERITY - $EVENT_STATE", 
                                "onClick": {
                                    "openLink": {
                                        "url": "$INCIDENT_URL"
                                    }
                                }
                            }
                        }
                    ]
                }, 
                {
                    "widgets": [
                        {
                            "keyValue": {
                                "content": "$CONDITION_NAME",
                                "topLabel": "Condition"
                            }
                        },
                        {
                            "keyValue": {
                                "content": "$POLICY_NAME",
                                "topLabel": "Policy"
                            }
                        },
                        {
                            "keyValue": {
                                "content": "$EVENT_DETAILS", 
                                "topLabel": "Details", 
                                "contentMultiline": "true"
                            }
                        }
                    ]
                }, 
                {
                    "widgets": [
                        {
                            "buttons": [
                                {
                                    "textButton": {
                                        "text": "View $EVENT_TYPE", 
                                        "onClick": {
                                            "openLink": {
                                                "url": "$INCIDENT_URL"
                                            }
                                        }
                                    }
                                },
                                {
                                    "textButton": {
                                        "text": "Ack $EVENT_TYPE", 
                                        "onClick": {
                                            "openLink": {
                                                "url": "$INCIDENT_ACKNOWLEDGE_URL"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
3 Likes