curl --request POST \
--url https://app.launchdarkly.com/api/v2/announcements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"severity": "warning",
"startTime": 1731439812,
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
'
import requests
url = "https://app.launchdarkly.com/api/v2/announcements"
payload = {
"severity": "warning",
"startTime": 1731439812,
"isDismissible": True,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
severity: 'warning',
startTime: 1731439812,
isDismissible: true,
endTime: 1731439880,
title: 'System Maintenance Notice',
message: '**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
})
};
fetch('https://app.launchdarkly.com/api/v2/announcements', 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://app.launchdarkly.com/api/v2/announcements",
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([
'severity' => 'warning',
'startTime' => 1731439812,
'isDismissible' => true,
'endTime' => 1731439880,
'title' => 'System Maintenance Notice',
'message' => '**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.launchdarkly.com/api/v2/announcements"
payload := strings.NewReader("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.launchdarkly.com/api/v2/announcements")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/announcements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}"
response = http.request(request)
puts response.read_body
curl --request POST \
--url https://app.launchdarkly.com/api/v2/announcements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"severity": "warning",
"startTime": 1731439812,
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
'
import requests
url = "https://app.launchdarkly.com/api/v2/announcements"
payload = {
"severity": "warning",
"startTime": 1731439812,
"isDismissible": True,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
severity: 'warning',
startTime: 1731439812,
isDismissible: true,
endTime: 1731439880,
title: 'System Maintenance Notice',
message: '**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
})
};
fetch('https://app.launchdarkly.com/api/v2/announcements', 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://app.launchdarkly.com/api/v2/announcements",
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([
'severity' => 'warning',
'startTime' => 1731439812,
'isDismissible' => true,
'endTime' => 1731439880,
'title' => 'System Maintenance Notice',
'message' => '**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.launchdarkly.com/api/v2/announcements"
payload := strings.NewReader("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.launchdarkly.com/api/v2/announcements")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/announcements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}"
response = http.request(request)
puts response.read_body
"**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
"**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."