curl --request POST \
--url https://developer.synq.io/api/alerts/v2/template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"template": {
"plain": "<string>",
"title": "<string>"
},
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2/template"
payload = {
"identifier": { "fqn": "<string>" },
"template": {
"plain": "<string>",
"title": "<string>"
},
"etag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: {fqn: '<string>'},
template: {plain: '<string>', title: '<string>'},
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2/template', 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://developer.synq.io/api/alerts/v2/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'identifier' => [
'fqn' => '<string>'
],
'template' => [
'plain' => '<string>',
'title' => '<string>'
],
'etag' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer.synq.io/api/alerts/v2/template"
payload := strings.NewReader("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://developer.synq.io/api/alerts/v2/template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"createdAt": "2023-01-15T01:30:15.01Z",
"incidentLifecycle": {
"settings": {
"states": [
"STATE_UNSPECIFIED"
]
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"isDisabled": true,
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"etag": "<string>"
}
}UpdateTemplate
Set or clear the message template of an existing alert configuration. The config can be identified by either ID or FQN.
curl --request POST \
--url https://developer.synq.io/api/alerts/v2/template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"template": {
"plain": "<string>",
"title": "<string>"
},
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2/template"
payload = {
"identifier": { "fqn": "<string>" },
"template": {
"plain": "<string>",
"title": "<string>"
},
"etag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifier: {fqn: '<string>'},
template: {plain: '<string>', title: '<string>'},
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2/template', 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://developer.synq.io/api/alerts/v2/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'identifier' => [
'fqn' => '<string>'
],
'template' => [
'plain' => '<string>',
'title' => '<string>'
],
'etag' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer.synq.io/api/alerts/v2/template"
payload := strings.NewReader("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://developer.synq.io/api/alerts/v2/template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"createdAt": "2023-01-15T01:30:15.01Z",
"incidentLifecycle": {
"settings": {
"states": [
"STATE_UNSPECIFIED"
]
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"isDisabled": true,
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"etag": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
UpdateTemplateRequest sets or clears an alert's message template.
Identifier for the config to update.
- fqn
- id
Show child attributes
Show child attributes
New custom template for the rendered alert message. Omit to clear the template and revert to the default rendering. Currently applied only to issue alerts; accepted and ignored for other kinds.
- AlertTemplate
- AlertTemplate
Show child attributes
Show child attributes
Optional optimistic-concurrency guard. When set, the write fails with a conflict (ABORTED) if the alert was modified since this etag was read.
Response
Success
UpdateTemplateResponse returns the updated alert configuration.
The alert configuration that was updated.
- Alert
- Alert
- Alert
Show child attributes
Show child attributes