Acknowledging an alert from MS Teams

I am trying to acknowlege an alert from Microsoft Teams. I have the Message Card sending just fine. It’s the link that doesn’t work. I have used $alert->id and $alert->uid to try and do an http post to the api. When I do this, the id and uid are always 81 and not 1 for the alert that I want to acknowledge. Here is my json for the Message Card:

if ($alert->state != 0)
{
“type”: “MessageCard”,
“context”: “http://schema.org/extensions”,
“themeColor”: “ff0000”,
“summary”: “{{ $alert->hostname }} is DOWN!!”,
“sections”:
[{
“activityTitle”: “{{ $alert->hostname }} is DOWN!!”,
“activitySubtitle”: “http://{Hostname of My System}/”,
“activityImage”: “https://{Hostname of My System}/icons/red-cross-icon.png”,
“facts”:
[{
“name”: “Hostname:”,
“value”: “{{ $alert->hostname }}”
},
{
“name”: “IP Address:”,
“value”: “{{ $alert->ip }}”
},
{
“name”: “URL:”,
“value”: “http://{Hostname of My System}/device/device={{ $alert->hostname }}”
},
{
“name”: “Alert ID:”,
“value”: “{{ $alert->uid }}”
}],
“markdown”: true
}],
“potentialAction”:
[{
“type”: “ActionCard”,
“name”: “Acknowledge”,
“actions”:
[{
“type”: “HttpPOST”,
“name”: “Acknowledge”,
“target”: “https://{Hostname of My System}/api/v0/alerts/{{ $alert->uid }}”,
“headers”:
[{
“name”: “X-Auth-Token”,
“value”: “API Key”
}]
}]
},
{
“type”: “ActionCard”,
“name”: “Delay”,
“actions”:
[{
“type”: “HttpPOST”,
“name”: “Mute Until the Morning”,
“target”: “https:/{Hostname of My System}/api/v0/alerts/{{ $alert->id }}”,
“headers”:
[{
“name”: “X-Auth-Token”,
“value”: “API Key”
}]
}]

}]

}
else
{
“type”: “MessageCard”,
“context”: “http://schema.org/extensions”,
“themeColor”: “00FF00”,
“summary”: “{{ $alert->hostname }} is up”,
“sections”: [{
“activityTitle”: “{{ $alert->hostname }} is up”,
“activitySubtitle”: “http://{Hostname of My System}/”,
“activityImage”: “https://{Hostname of My System}/icons/green-cross-icon.png”,
“facts”:
[{
“name”: “Hostname:”,
“value”: “{{ $alert->hostname }}”
},
{
“name”: “IP Address:”,
“value”: “{{ $alert->ip }}”
},
{
“name”: “URL:”,
“value”: “http://{Hostname of My System}/device/device={{ $alert->hostname }}”
}],
“markdown”: true
}]
}
endif

  • I had to remove some @'s

I’m sure the id and uid are what they are supposed to be but is there another variable I am missing that I can use?

did you make it work?