Send push notifications to users or groups via Push Bunny, powered by Firebase Cloud Messaging. Ensure your service account is configured securely on the server.
POST https://push-bunny.com/api
Content-Type: application/json; charset=UTF-8
Field | Type | Required | Description |
---|---|---|---|
title | string | Yes | Notification title |
body | string | Yes | Notification message content |
recipient_type | string | No | user_id or group (default: user_id ) |
id_field | string | Yes | User ID or topic name |
image | string | No | URL for notification image |
link | string | No | URL to open on click |
{
"success": true,
"message": "Notification sent successfully to user '12345'"
}
{
"error": "Title and body are required"
}
curl -X POST https://push-bunny.com/api \
-H "Content-Type: application/json" \
-d '{
"title": "Hello!",
"body": "This is a test notification.",
"recipient_type": "user_id",
"id_field": "12345",
"image": "https://example.com/image.png",
"link": "https://example.com"
}'
$payload = [
'title' => 'Hello!',
'body' => 'Test notification',
'recipient_type' => 'user_id',
'id_field' => '12345',
'image' => 'https://example.com/image.png',
'link' => 'https://example.com'
];
$ch = curl_init('https://push-bunny.com/api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Get the Push Bunny mobile app for instant notifications