Python
# Pull instead of receiving webhooks: keep the cursor between polls
page = niadra.api.notifications(cursor=cursor, limit=100)
for event in page.items:
handle(event.type, event.data) # ids and pointers, never content
cursor = page.next_cursor// Pull instead of receiving webhooks: keep the cursor between polls
const page = await niadra.api.notifications({ cursor, limit: 100 });
for (const event of page.items) handle(event.type, event.data); // ids and pointers, never content
cursor = page.next_cursor;curl --request GET \
--url https://{space}.{region}.api.niadra.com/v1/notificationsconst options = {method: 'GET'};
fetch('https://{space}.{region}.api.niadra.com/v1/notifications', 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://{space}.{region}.api.niadra.com/v1/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://{space}.{region}.api.niadra.com/v1/notifications"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{space}.{region}.api.niadra.com/v1/notifications")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"tenant": "<string>",
"type": "<string>",
"links": {},
"subject": {}
}
],
"next_cursor": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Turn records and replay
Notifications feed
The events the webhooks carry, oldest first, by cursor, for those who pull instead of receiving. The notifications feature.
GET
/
v1
/
notifications
Python
# Pull instead of receiving webhooks: keep the cursor between polls
page = niadra.api.notifications(cursor=cursor, limit=100)
for event in page.items:
handle(event.type, event.data) # ids and pointers, never content
cursor = page.next_cursor// Pull instead of receiving webhooks: keep the cursor between polls
const page = await niadra.api.notifications({ cursor, limit: 100 });
for (const event of page.items) handle(event.type, event.data); // ids and pointers, never content
cursor = page.next_cursor;curl --request GET \
--url https://{space}.{region}.api.niadra.com/v1/notificationsconst options = {method: 'GET'};
fetch('https://{space}.{region}.api.niadra.com/v1/notifications', 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://{space}.{region}.api.niadra.com/v1/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://{space}.{region}.api.niadra.com/v1/notifications"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{space}.{region}.api.niadra.com/v1/notifications")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"tenant": "<string>",
"type": "<string>",
"links": {},
"subject": {}
}
],
"next_cursor": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Query Parameters
Maximum string length:
200Required range:
1 <= x <= 200
