- In-app notifications for web applications.
- Push notifications using Firebase for mobile apps.
How It Works
- Your Webhook Endpoint: A piece of code on your server (written in any language like Ruby, PHP, or Node.js) that processes incoming requests.
- Providing the URL: Share your endpoint URL (e.g.,
https://yourdomain.com/webhook-endpoint) with Gameball. - Receiving Notifications: Gameball sends a POST request with all the necessary data to your endpoint whenever a customer should receive a notification.

Steps to Get Started
- Build a webhook endpoint on your server to receive notifications.
- Subscribe to notification webhooks from your Gameball dashboard.
- Verify webhook signatures to ensure secure communication.
- Create logic to send notifications to your customers via your preferred channels.
Note: Code snippets provided in this tutorial are for illustration purposes and may require adjustments to work in your environment.Example Scenario Imagine you own a store that specializes in video games and gift cards. You want to send notifications to your customers through your own channels, such as SMS, WhatsApp, or other custom platforms. This tutorial will help you achieve that integration.
Configurations
Before diving in, you need to set up some configurations to enable webhooks.Step 1: Build a Notifications Endpoint
The first step is to prepare a webhook endpoint on your server where Gameball will send POST requests containing notification details. This endpoint will act as the bridge between Gameball and your notification system./gb-webhook/notification.
Step 2: Activate Notifications Webhook
In your Gameball dashboard, navigate to Admin Settings > Account Integration > Webhooks and add your notification endpoint URL (e.g.,www.yourdomain.com/gb-webhook/notification) to Notification Webhook.

Step 3: Verifying Webhooks
You should verify that the incoming request is a legit request from Gameball and not a malicious request that tries to spam your system. You can achieve this by calculating a digital signature which is SHA1 hash inX-GB-Signature header. You can get more information about webhook verification in this section.
Step 4: Write Your Own Logic
In the webhook request body, you will get all the needed data for you to send your customized notifications to designated customers. Each notification item in the posted data will contain thecustomer_id and locales with their titles and bodies. You can check the full data specification and example in the documentation here.
Here is an example of a notification data:
customer_id in the request body. You can use the received customer_id to retrieve your customer’s mobile number or any other required data from your database, then use an SMS Gateway to send an SMS to your customer.

Whatsapp Example
The next day your boss requested a slight change, that you need to also send WhatsApp messages to your customers in addition to sending SMS. You will need to have an integration with WhatsApp business API or any communication API as Twilio. In your/gb-webhook/notification endpoint you will add the logic that sends WhatsApp message to your customer.

/gb-webhook/notification endpoint you will add the logic that sends push notification to your customer mobile device.