curl --request GET \
--url http://localhost:3000/api/notification-prefs \
--header 'Origin: <api-key>'import requests
url = "http://localhost:3000/api/notification-prefs"
headers = {"Origin": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Origin: '<api-key>'}};
fetch('http://localhost:3000/api/notification-prefs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/notification-prefs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Origin: <api-key>"
],
]);
$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 := "http://localhost:3000/api/notification-prefs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Origin", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/api/notification-prefs")
.header("Origin", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/notification-prefs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Origin"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"prefs": {
"label_changes": true,
"policy_updates": false,
"accessibility_changes": false,
"new_privacy_types": true,
"labelChanges": true,
"profileMismatch": true,
"policyUpdates": false,
"versionUpdates": true,
"importCompleted": true,
"manualAppsPrompt": true,
"aiTimeout": true,
"jobResumed": true,
"parserFallthrough": true
},
"stored": {},
"defaults": {
"labelChanges": true,
"profileMismatch": true,
"policyUpdates": false,
"versionUpdates": true,
"importCompleted": true,
"manualAppsPrompt": true,
"aiTimeout": true,
"jobResumed": true,
"parserFallthrough": true
}
}Read notification preferences
curl --request GET \
--url http://localhost:3000/api/notification-prefs \
--header 'Origin: <api-key>'import requests
url = "http://localhost:3000/api/notification-prefs"
headers = {"Origin": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Origin: '<api-key>'}};
fetch('http://localhost:3000/api/notification-prefs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/notification-prefs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Origin: <api-key>"
],
]);
$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 := "http://localhost:3000/api/notification-prefs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Origin", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/api/notification-prefs")
.header("Origin", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/notification-prefs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Origin"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"prefs": {
"label_changes": true,
"policy_updates": false,
"accessibility_changes": false,
"new_privacy_types": true,
"labelChanges": true,
"profileMismatch": true,
"policyUpdates": false,
"versionUpdates": true,
"importCompleted": true,
"manualAppsPrompt": true,
"aiTimeout": true,
"jobResumed": true,
"parserFallthrough": true
},
"stored": {},
"defaults": {
"labelChanges": true,
"profileMismatch": true,
"policyUpdates": false,
"versionUpdates": true,
"importCompleted": true,
"manualAppsPrompt": true,
"aiTimeout": true,
"jobResumed": true,
"parserFallthrough": true
}
}Authorizations
Same-origin CSRF check. The Origin header must match the request host;
enforced for every mutating verb (POST, PUT, PATCH, DELETE).
Response
Resolved per-type switches, with the Settings view's defaults.
Per-type notification switches under two sets of names. The four
snake_case keys are the flag.notifications.types.* feature flags.
The nine camelCase keys are the types the Settings view and the bell
use. Two types are in both sets: labelChanges is the same switch as
label_changes, and policyUpdates the same as policy_updates.
The other seven camelCase types are stored in the
notification_prefs setting. Privacy-policy text changes are opt-in: policy_updates and
policyUpdates stay false until
flag.notifications.types.policy_updates is on.
Every switch's current value, in this order: the four snake_case
flag keys, each resolved through the flag cascade (your override,
then the focus default, then the hard default), then all nine
camelCase keys. labelChanges and policyUpdates repeat their
flags' values. The other seven come from notification_prefs,
with defaults filling any type that was never saved. If the flag
resolver fails, prefs holds only the camelCase keys saved in
notification_prefs.
Show child attributes
Show child attributes
Same values as prefs.
Show child attributes
Show child attributes
The Settings view's defaults, keyed by its own type names. Fixed values, not the flags' resolved state.
Show child attributes
Show child attributes
{
"labelChanges": true,
"profileMismatch": true,
"policyUpdates": false,
"versionUpdates": true,
"importCompleted": true,
"manualAppsPrompt": true,
"aiTimeout": true,
"jobResumed": true,
"parserFallthrough": true
}