Receive a OneSignal event
curl --request POST \
--url https://api.bbrands.io/api/v3/integration/onesignal/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "message.push.clicked",
"id": "6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d",
"timestamp": "2026-10-21T14:05:12.228Z",
"external_id": "1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"subscription_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"device_type": "iOSPush",
"message_id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"failure_reason": "",
"app": "default"
}
'import requests
url = "https://api.bbrands.io/api/v3/integration/onesignal/webhook"
payload = {
"kind": "message.push.clicked",
"id": "6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d",
"timestamp": "2026-10-21T14:05:12.228Z",
"external_id": "1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"subscription_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"device_type": "iOSPush",
"message_id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"failure_reason": "",
"app": "default"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'message.push.clicked',
id: '6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d',
timestamp: '2026-10-21T14:05:12.228Z',
external_id: '1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
subscription_id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
device_type: 'iOSPush',
message_id: '0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',
failure_reason: '',
app: 'default'
})
};
fetch('https://api.bbrands.io/api/v3/integration/onesignal/webhook', 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/integration/onesignal/webhook",
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([
'kind' => 'message.push.clicked',
'id' => '6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d',
'timestamp' => '2026-10-21T14:05:12.228Z',
'external_id' => '1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'subscription_id' => '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
'device_type' => 'iOSPush',
'message_id' => '0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',
'failure_reason' => '',
'app' => 'default'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.bbrands.io/api/v3/integration/onesignal/webhook"
payload := strings.NewReader("{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.bbrands.io/api/v3/integration/onesignal/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/integration/onesignal/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted": true,
"kind": "<string>",
"queued": true
},
"message": "<string>"
}Webhooks
OneSignal Event Streams
Fails closed: without a configured secret, hosted environments answer
401. Unset Liquid variables arrive as empty strings and are read as
missing. timestamp accepts ISO 8601 ({{ event.datetime }}) or
UNIX seconds ({{ event.timestamp }}).
POST
/
integration
/
onesignal
/
webhook
Receive a OneSignal event
curl --request POST \
--url https://api.bbrands.io/api/v3/integration/onesignal/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "message.push.clicked",
"id": "6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d",
"timestamp": "2026-10-21T14:05:12.228Z",
"external_id": "1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"subscription_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"device_type": "iOSPush",
"message_id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"failure_reason": "",
"app": "default"
}
'import requests
url = "https://api.bbrands.io/api/v3/integration/onesignal/webhook"
payload = {
"kind": "message.push.clicked",
"id": "6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d",
"timestamp": "2026-10-21T14:05:12.228Z",
"external_id": "1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"subscription_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
"device_type": "iOSPush",
"message_id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"failure_reason": "",
"app": "default"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'message.push.clicked',
id: '6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d',
timestamp: '2026-10-21T14:05:12.228Z',
external_id: '1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
subscription_id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
device_type: 'iOSPush',
message_id: '0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',
failure_reason: '',
app: 'default'
})
};
fetch('https://api.bbrands.io/api/v3/integration/onesignal/webhook', 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/integration/onesignal/webhook",
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([
'kind' => 'message.push.clicked',
'id' => '6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d',
'timestamp' => '2026-10-21T14:05:12.228Z',
'external_id' => '1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d',
'subscription_id' => '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
'device_type' => 'iOSPush',
'message_id' => '0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',
'failure_reason' => '',
'app' => 'default'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.bbrands.io/api/v3/integration/onesignal/webhook"
payload := strings.NewReader("{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.bbrands.io/api/v3/integration/onesignal/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/integration/onesignal/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"message.push.clicked\",\n \"id\": \"6f2a1f4e-6c1b-4b8e-9d0e-5f6f7a8b9c0d\",\n \"timestamp\": \"2026-10-21T14:05:12.228Z\",\n \"external_id\": \"1d0c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d\",\n \"subscription_id\": \"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n \"device_type\": \"iOSPush\",\n \"message_id\": \"0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n \"failure_reason\": \"\",\n \"app\": \"default\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted": true,
"kind": "<string>",
"queued": true
},
"message": "<string>"
}Authorizations
Body
application/json
Was this page helpful?