Show
Show a single alert for your account
GET
/
v2
/
alerts
/
{id}
Show
curl --request GET \
--url https://api.incident.io/v2/alerts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/alerts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/alerts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/alerts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/alerts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/alerts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alerts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"alert": {
"alert_group_ids": [
"01GW2G3V0S59R238FAHPDS1R66"
],
"alert_source_id": "01GW2G3V0S59R238FAHPDS1R66",
"attributes": [
{
"array_value": [
{
"catalog_entry": {
"catalog_type_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Primary On-call"
},
"label": "Payments Team",
"literal": "SEV123"
}
],
"attribute": {
"array": false,
"emoji": "fire",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"name": "service",
"required": false,
"type": "CatalogEntry[\"01GW2G3V0S59R238FAHPDS1R67\"]"
},
"value": {
"catalog_entry": {
"catalog_type_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Primary On-call"
},
"label": "Payments Team",
"literal": "SEV123"
}
}
],
"created_at": "2021-08-17T13:28:57.801578Z",
"deduplication_key": "4293868629",
"description": "CPU on the payments service has exceeded 75 percent for 5 minutes",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"resolved_at": "2021-08-17T14:28:57.801578Z",
"source_url": "https://www.my-alerting-platform.com/alerts/my-alert-123",
"status": "firing",
"title": "*errors.withMessage: PG::Error failed to connect",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}🔑 Requires the
alerts.view scope.Was this page helpful?
⌘I
Show
curl --request GET \
--url https://api.incident.io/v2/alerts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/alerts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/alerts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/alerts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/alerts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/alerts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alerts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"alert": {
"alert_group_ids": [
"01GW2G3V0S59R238FAHPDS1R66"
],
"alert_source_id": "01GW2G3V0S59R238FAHPDS1R66",
"attributes": [
{
"array_value": [
{
"catalog_entry": {
"catalog_type_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Primary On-call"
},
"label": "Payments Team",
"literal": "SEV123"
}
],
"attribute": {
"array": false,
"emoji": "fire",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"name": "service",
"required": false,
"type": "CatalogEntry[\"01GW2G3V0S59R238FAHPDS1R67\"]"
},
"value": {
"catalog_entry": {
"catalog_type_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Primary On-call"
},
"label": "Payments Team",
"literal": "SEV123"
}
}
],
"created_at": "2021-08-17T13:28:57.801578Z",
"deduplication_key": "4293868629",
"description": "CPU on the payments service has exceeded 75 percent for 5 minutes",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"resolved_at": "2021-08-17T14:28:57.801578Z",
"source_url": "https://www.my-alerting-platform.com/alerts/my-alert-123",
"status": "firing",
"title": "*errors.withMessage: PG::Error failed to connect",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}