Gameball Developers Guide
v4.0
v4.0
  • Introduction
  • Installing Gameball
    • Web
      • Initialize Gameball Customer Widget
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • iOS
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Track Referrals
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Go-Live Checklist
    • React Native
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Flutter
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • Generic Mobile App
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
  • REST API
    • Overview
      • What's New in V4.0
      • Authentication
      • Rate Limiting
      • Status and Error Codes
    • Customers
      • Customer Management
      • Customer Progress
      • Customer Tags
      • Customer Notifications
    • Events
    • Order
      • Order Tracking
      • Order Rewards & History
    • Payment
      • Payment Tracking
    • Transactions
      • Cashback & Redemptions
      • Hold Management
      • Transaction Management
      • Transaction Validation
    • Coupons
    • Configurations
      • Reward Configurations
      • Program Configurations
      • Widget Configuration
    • Leaderboard
    • Batches
      • Batch Creation
      • Batch Management
  • Webhooks
    • Overview
    • Subscribing to Webhooks
    • Webhook Topics
      • Customer's Notifications
      • Customer's Profile Updates
  • Tutorials
    • Tracking Customer Events
    • Redemption Integration
      • Direct debit redemption
      • Coupons Redemption
        • Use Your Own Couponing Engine
        • Gameball Couponing Engine
    • Checkout Integration
    • Build Custom UI Elements
      • Reward Campaigns
      • VIP Tiers
      • Customer Balance
      • Widget Configurations
      • Coupons Customer Experience
      • Customer Notifications
      • Customer Leaderboard
    • Build your Own Notification System
    • Channel Merging Guide
    • Previewing Potential Points Before Purchase
    • Refund
    • Retail & POS Integration with Gameball Loyalty Program
    • Referrals
    • Widget Deep Links
    • Batch APIs usage example
  • Branch.io Integration
  • Adjust Integration
Powered by GitBook
On this page
  • Examples of when your app might use webhooks
  • APIs for continuous polling vs. Webhooks for events data
  • Key terminology
  • Topic
  • Headers
  • Webhooks Retry Policy
  1. Webhooks

Overview

PreviousBatch ManagementNextSubscribing to Webhooks

Last updated 5 months ago

Want to stay updated on events happening in Gameball? Webhooks are the way to go! They let your app automatically receive real-time updates whenever something important happens.

With Gameball webhooks, you can:

  • Keep your app synced when a customer's profile is updated.

  • Trigger notifications to keep customers engaged.

This guide will walk you through the basics of using webhooks, with clear explanations and tips to help you get started.

Examples of when your app might use webhooks

  • Notify customers about profile updates: Send alerts when something in a customer’s profile changes.

  • Forward notifications: Keep customers informed by sending messages triggered by their actions in Gameball.

  • Update loyalty points: Adjust a customer’s points balance when their profile is updated.

APIs for continuous polling vs. Webhooks for events data

Let’s look at how they differ, using the customer.notification.push webhook topic as an example:

  • Polling APIs: Your app constantly asks Gameball, “Did anything happen yet?” This can lead to unnecessary API calls, increased server load, and delayed updates.

  • Webhooks: Gameball tells your app, “Here’s the latest event!” This approach is faster, more efficient, and delivers data as soon as the event occurs.

By subscribing to a webhook like customer.notification.push, your app receives event data instantly, without the hassle of repetitive API requests.

  1. Your app subscribes to the customer.notification.push topic and listens for new notification push events.

  2. Your app specifies an POST endpoint to receive webhooks for the customer.notification.push topic. This endpoint is where the app listens for webhooks.

  3. Suppose now that a notification is pushed from Gameball system.

  4. This triggers a webhook to be published to the customer.notification.push topic.

  5. Gameball sends that webhook, which includes headers and an order payload, to the specified subscription endpoint.

Key terminology

Topic

Webhooks are grouped into topics, and your app subscribes to one or more of these topics to receive specific event updates.

What It Does

A webhook topic determines the type of event messages your app will receive. For instance, subscribing to the customer.profile.updated topic lets your app get notified whenever a customer’s profile is updated.

Why It Matters

The topic name clearly identifies the kind of event, helping your app stay focused on relevant updates.

Headers

Each webhook includes headers and a payload. The headers provide important metadata about the webhook.

X-GB-Signature: '3fcb4a3b2d96e6f8363d3b5594290111d02139df'
X-GB-Webhook-Version: 'v4'

X-GB-Signature A security signature used to verify that the webhook is authentic and originates from Gameball.


X-GB-Webhook-Version Indicates the version of the webhook being used.

Webhooks Retry Policy

If Gameball receives a non-2XX status code in response to a webhook, it will retry delivery up to three times:

  • 1st Retry: After 5 minutes.

  • 2nd Retry: After 20 minutes.

  • 3rd Retry: After 60 minutes.

If all retries fail, the webhook request will be discarded.