goalert icon indicating copy to clipboard operation
goalert copied to clipboard

Acknowledge alert API endpoint

Open m-shalenko opened this issue 1 year ago • 4 comments

Hello, everyone!

What problem would you like to solve? Please describe: I have found out that graphql is used in GoAlert, especially to acknowledge alert in web UI. I am developing my own monitoring system based on goalert and I did not find any solutions to acknowledge alert without web UI.

Describe the solution you'd like: I would like to acknowledge alerts using, for example, REST API and API token.

Describe alternatives you've considered: -

Additional context: At the moment, I can do this using /api/graphql endpoint and json I attach below.

{
  "operationName": "UpdateAlertsMutation",
  "query": "mutation UpdateAlertsMutation($input: UpdateAlertsInput!) {\n  updateAlerts(input: $input) {\n    id\n    __typename\n  }\n}",
  "variables": {
    "input": {
      "alertIDs": [
        "1227"
      ],
      "newStatus": "StatusAcknowledged"
    }
  }
}
 curl 'https://<goalert_url>/api/graphql' -H "Content-Type: application/json" -H "Cookie: $COOKIE" -d @payload.json 

It works but this operation requires my cookie from a browser. Also, I did not find any opportunities to create an API token in goalert. Is it possible to develop such feature?

m-shalenko avatar Nov 02 '23 17:11 m-shalenko

We are currently working on this: https://github.com/target/goalert/issues/3007

It's in the nightly build under an experimental flag, though that should be wrapped up in the next week or so; and it will be in the next release.

mastercactapus avatar Nov 02 '23 18:11 mastercactapus

@mastercactapus great! Nice news! I am looking forward to try this feature!

m-shalenko avatar Nov 02 '23 18:11 m-shalenko

@mastercactapus Hello! Are there any updates?

m-shalenko avatar Nov 21 '23 11:11 m-shalenko

@mastercactapus what is the status on this issue?

Gakhramanzode avatar Dec 26 '23 10:12 Gakhramanzode