Send to one user
Transactional sends to one of your own users by externalId, with examples in cURL, Node.js, Python and PHP.
First link the browser to your user: pass your own user id as externalId in RelayBell.init(), or call RelayBell.identify(externalId) once the visitor signs in (with userHash if you use identity verification). Then send with that id from your server. If no subscribed browser has the id, the send still answers 202 and simply reaches nobody.
curl -X POST https://relaybell.com/api/v1/notifications \
-H "Authorization: Bearer rb_live_xxxxx" -H "Content-Type: application/json" \
-d '{
"externalId": "user_123",
"transactional": true,
"title": "Your order has shipped",
"body": "Order #1042 is on its way.",
"url": "https://shop.example/orders/1042"
}'For several users at once, send "externalIds": ["user_1", "user_2"] instead.