Mettre à jour une valeur de notification par défaut de l’entreprise
curl --request POST \
--url https://www.corgea.app/api/v1/notifications/company-defaults/{type_code} \
--header 'CORGEA-TOKEN: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email_enabled": true,
"webhook_enabled": true
}
'import requests
url = "https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}"
payload = {
"email_enabled": True,
"webhook_enabled": True
}
headers = {
"CORGEA-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'CORGEA-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email_enabled: true, webhook_enabled: true})
};
fetch('https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}', 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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}",
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([
'email_enabled' => true,
'webhook_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"CORGEA-TOKEN: <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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}"
payload := strings.NewReader("{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("CORGEA-TOKEN", "<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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}")
.header("CORGEA-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["CORGEA-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "Invalid JSON body"
}{
"error": "Missing or invalid authorization header"
}{
"error": "Admin permission required"
}{
"error": "Unknown notification type"
}Notifications
Mettre à jour une valeur de notification par défaut de l’entreprise
Mettez à jour partiellement les paramètres par défaut des e-mails ou des webhooks au niveau de l’entreprise pour un type de notification. Utilisez null pour hériter de la valeur par défaut de la plateforme. Un accès administrateur de l’entreprise est requis.
POST
/
notifications
/
company-defaults
/
{type_code}
Mettre à jour une valeur de notification par défaut de l’entreprise
curl --request POST \
--url https://www.corgea.app/api/v1/notifications/company-defaults/{type_code} \
--header 'CORGEA-TOKEN: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email_enabled": true,
"webhook_enabled": true
}
'import requests
url = "https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}"
payload = {
"email_enabled": True,
"webhook_enabled": True
}
headers = {
"CORGEA-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'CORGEA-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email_enabled: true, webhook_enabled: true})
};
fetch('https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}', 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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}",
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([
'email_enabled' => true,
'webhook_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"CORGEA-TOKEN: <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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}"
payload := strings.NewReader("{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("CORGEA-TOKEN", "<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://www.corgea.app/api/v1/notifications/company-defaults/{type_code}")
.header("CORGEA-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.corgea.app/api/v1/notifications/company-defaults/{type_code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["CORGEA-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_enabled\": true,\n \"webhook_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"error": "Invalid JSON body"
}{
"error": "Missing or invalid authorization header"
}{
"error": "Admin permission required"
}{
"error": "Unknown notification type"
}Autorisations
CorgeaTokenBearerAuth
Clé API pour l'authentification
Paramètres de chemin
Code de type de notification, tel que scheduled_scan.daily_report
Corps
application/json
Réponse
Requête traitée avec succès
Exemple:
"ok"
Cette page vous a-t-elle été utile ?
⌘I
