oncall-engine/docs/sources/oncall-api-reference/resolution_notes.md
Joey Orlando c5b76a5869
fix right-hand navigation in API docs (#4546)
# What this PR does

The right-hand side navigation in the OnCall API public docs
([example](https://grafana.com/docs/oncall/latest/oncall-api-reference/alertgroups/))
doesn’t render as expected vs. what we see in the Grafana API public
docs
([example](https://grafana.com/docs/grafana/latest/developers/http_api/folder/);
2nd screenshot). This PR fixes that ([convo on
Slack](https://raintank-corp.slack.com/archives/C045CTY1QEP/p1718388424649359)).


![Screenshot 2024-06-14 at 14 05
03](https://github.com/grafana/oncall/assets/9406895/0636d9d7-2f58-4c82-91b5-5b4af0dd3524)

![Screenshot 2024-06-14 at 14 06 36
(1)](https://github.com/grafana/oncall/assets/9406895/7a5bc2c8-ccb2-4b53-b982-d7d7596f90e2)
2024-06-17 11:31:35 -04:00

3.2 KiB

canonical title weight
https://grafana.com/docs/oncall/latest/oncall-api-reference/resolution_notes/ Resolution notes HTTP API 900

Resolution notes HTTP API

Create a resolution note

curl "{{API_URL}}/api/v1/resolution_notes/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "alert_group_id": "I68T24C13IFW1",
      "text": "Demo resolution note"
  }'

The above command returns JSON structured in the following way:

{
  "id": "M4BTQUS3PRHYQ",
  "alert_group_id": "I68T24C13IFW1",
  "author": "U4DNY931HHJS5",
  "source": "web",
  "created_at": "2020-06-19T12:40:01.429805Z",
  "text": "Demo resolution note"
}
Parameter Required Description
alert_group_id Yes Alert group ID
text Yes Resolution note text

HTTP request

POST {{API_URL}}/api/v1/resolution_notes/

Get a resolution note

curl "{{API_URL}}/api/v1/resolution_notes/M4BTQUS3PRHYQ/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured in the following way:

{
  "id": "M4BTQUS3PRHYQ",
  "alert_group_id": "I68T24C13IFW1",
  "author": "U4DNY931HHJS5",
  "source": "web",
  "created_at": "2020-06-19T12:40:01.429805Z",
  "text": "Demo resolution note"
}

HTTP request

GET {{API_URL}}/api/v1/resolution_notes/<RESOLUTION_NOTE_ID>/

List resolution notes

curl "{{API_URL}}/api/v1/resolution_notes/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured in the following way:

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "M4BTQUS3PRHYQ",
      "alert_group_id": "I68T24C13IFW1",
      "author": "U4DNY931HHJS5",
      "source": "web",
      "created_at": "2020-06-19T12:40:01.429805Z",
      "text": "Demo resolution note"
    }
  ],
  "current_page_number": 1,
  "page_size": 50,
  "total_pages": 1
}

The following available filter parameter should be provided as a GET argument:

  • alert_group_id

HTTP request

GET {{API_URL}}/api/v1/resolution_notes/

Update a resolution note

curl "{{API_URL}}/api/v1/resolution_notes/M4BTQUS3PRHYQ/" \
  --request PUT \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "text": "Demo resolution note updated"
  }'

The above command returns JSON structured in the following way:

{
  "id": "M4BTQUS3PRHYQ",
  "alert_group_id": "I68T24C13IFW1",
  "author": "U4DNY931HHJS5",
  "source": "web",
  "created_at": "2020-06-19T12:40:01.429805Z",
  "text": "Demo resolution note updated"
}

HTTP request

PUT {{API_URL}}/api/v1/resolution_notes/<RESOLUTION_NOTE_ID>/

Delete a resolution note

curl "{{API_URL}}/api/v1/resolution_notes/M4BTQUS3PRHYQ/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow"

HTTP request

DELETE {{API_URL}}/api/v1/resolution_notes/<RESOLUTION_NOTE_ID>/