Notifications
Queue restaurant notifications with a scoped key.
Server-to-server · Bearer API key · Restaurant scoped
Queue a notification#
POST
/api/v1/notificationsCreates a campaign for your restaurant and queues delivery to eligible users. 202 means queued, not device display. Delivery depends on enabled channels, eligible recipients, registered devices and provider configuration. restaurant_id is prohibited.
Authentication: IntegrationKey · Scope: notifications.write
Request body
| Parameter | Type | Description |
|---|---|---|
titleRequired | string | Maximum 255 characters. |
bodyRequired | string | Maximum 10,000 characters. |
channelRequired | string | Delivery channel.in_app · push |
curl
curl --request POST \
"https://api.rinili.com/api/v1/notifications" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"title": "Your order is ready", "body": "Please collect at the counter.", "channel": "in_app"}'JavaScript
const response = await fetch("https://api.rinili.com/api/v1/notifications", {
method: "POST",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "Your order is ready",
"body": "Please collect at the counter.",
"channel": "in_app"
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = response.status === 204 ? null : await response.text();Python
import requests
response = requests.request(
"POST",
"https://api.rinili.com/api/v1/notifications",
headers={'Accept': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'},
json={'title': 'Your order is ready', 'body': 'Please collect at the counter.', 'channel': 'in_app'},
timeout=15,
)
response.raise_for_status()
print(response.json())Response · 202
Illustrative response. Empty summary objects stand for configuration-dependent fields.
JSON
{
"id": 31,
"status": "queued",
"recipients": 2
}