Get an occurrence
curl --request GET \
--url https://api.bbrands.io/api/v3/notification/occurrence/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bbrands.io/api/v3/notification/occurrence/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bbrands.io/api/v3/notification/occurrence/{document_id}', 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://api.bbrands.io/api/v3/notification/occurrence/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.bbrands.io/api/v3/notification/occurrence/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bbrands.io/api/v3/notification/occurrence/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/occurrence/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_key": "maihue.onboarding.invited",
"notification_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"reason": "<string>",
"error": "<string>",
"origin": "api_key",
"subject_type": "<string>",
"subject_id": "<string>",
"account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_gateway": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_request": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"correlation": "<string>",
"idempotency_key": "<string>",
"locale": "<string>",
"payload": "<unknown>",
"payload_schema_version": 123,
"evaluated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"event": {},
"gateway": {},
"decisions_count": 123,
"notifications_count": 123,
"decisions": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"outcome": "deferred",
"reason": "quiet-hours",
"fallback_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_key": "<string>",
"locale": "<string>",
"locale_fallback": true,
"notification": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_template_version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_version": 123,
"deferred_until": "2023-11-07T05:31:56Z",
"evaluated_at": "2023-11-07T05:31:56Z"
}
],
"notifications": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"category": "<string>",
"status": "<string>",
"status_reason": "<string>",
"origin": "<string>",
"external_id": "<string>",
"notification_occurrence": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_gateway": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_request": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_template_version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>",
"locale_fallback": true,
"provider": "<string>",
"provider_message_id": "<string>",
"queue_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_from": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_reason": "<string>",
"cost_amount": 123,
"cost_currency": "<string>",
"data": "<unknown>",
"error": "<string>",
"last_event": "<string>",
"last_event_at": "2023-11-07T05:31:56Z",
"send_at": "2023-11-07T05:31:56Z",
"deferred_until": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"opened_at": "2023-11-07T05:31:56Z",
"clicked_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"resends": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"events": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "<string>",
"event_type": "email.delivered",
"provider": "<string>",
"provider_event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"payload": "<unknown>"
}
],
"timeline": [
{}
]
}
]
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}Occurrences
Get Occurrence
Requires notification-occurrence:find-one. The occurrence with its
event, gateway, decisions per channel and recipient (fallback chain
included), its notifications with their resends, and one timeline
per notification mixing Horizon transitions and provider events.
Recipients are shown by user id; addresses only as their digest.
Without notification:view-content the payload values are
[redacted], notification data is null and provider payloads are
left out.
GET
/
notification
/
occurrence
/
{document_id}
Get an occurrence
curl --request GET \
--url https://api.bbrands.io/api/v3/notification/occurrence/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bbrands.io/api/v3/notification/occurrence/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bbrands.io/api/v3/notification/occurrence/{document_id}', 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://api.bbrands.io/api/v3/notification/occurrence/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.bbrands.io/api/v3/notification/occurrence/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bbrands.io/api/v3/notification/occurrence/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/occurrence/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_key": "maihue.onboarding.invited",
"notification_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"reason": "<string>",
"error": "<string>",
"origin": "api_key",
"subject_type": "<string>",
"subject_id": "<string>",
"account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actor_user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_gateway": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_request": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"correlation": "<string>",
"idempotency_key": "<string>",
"locale": "<string>",
"payload": "<unknown>",
"payload_schema_version": 123,
"evaluated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"event": {},
"gateway": {},
"decisions_count": 123,
"notifications_count": 123,
"decisions": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"outcome": "deferred",
"reason": "quiet-hours",
"fallback_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_key": "<string>",
"locale": "<string>",
"locale_fallback": true,
"notification": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_template_version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_version": 123,
"deferred_until": "2023-11-07T05:31:56Z",
"evaluated_at": "2023-11-07T05:31:56Z"
}
],
"notifications": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"category": "<string>",
"status": "<string>",
"status_reason": "<string>",
"origin": "<string>",
"external_id": "<string>",
"notification_occurrence": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_gateway": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_request": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification_template_version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>",
"locale_fallback": true,
"provider": "<string>",
"provider_message_id": "<string>",
"queue_event": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_from": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resent_reason": "<string>",
"cost_amount": 123,
"cost_currency": "<string>",
"data": "<unknown>",
"error": "<string>",
"last_event": "<string>",
"last_event_at": "2023-11-07T05:31:56Z",
"send_at": "2023-11-07T05:31:56Z",
"deferred_until": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"opened_at": "2023-11-07T05:31:56Z",
"clicked_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"resends": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"events": [
{
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notification": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "<string>",
"event_type": "email.delivered",
"provider": "<string>",
"provider_event_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"payload": "<unknown>"
}
],
"timeline": [
{}
]
}
]
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}Authorizations
bearerAuthapiKeyAuth
Was this page helpful?