v4.0 (Beta)

Customer Notifications

Retrieve and manage customer notifications with these APIs. Use them to display notification lists and mark notifications as read, helping keep customers informed about their rewards and activity.

Available APIs


GET - Customer Notifications

https://api.gameball.co/api/v4/integrations/customers/{customerId}/notifications

This API retrieves a paged list of notifications for a specific customer in Gameball, identified by customerId. Each notification includes details such as title, message content, read status, and timestamp.

Security: Requires apikey headers.

Request

Path Parameters

customerId string Required Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.

Query Parameters

startAfter long Optional Specifies the page will start after which notification id. Defaults to 0.


limit integer Optional Specifies the number of notifications to return per page. Defaults to 50, with a maximum limit of 200 transactions per page.


isRead boolean Optional Filter notifications based on their read status. Set to true for read notifications and false for unread ones


lang string Optional Specifies the the language in which notifications will be retrieved.

Response

application/json

notifications array This array contains the list of notifications sent to the customer. Each notification represents an event or update that happened, based on pre-configured settings from the Gameball dashboard. These notifications are typically used to inform the customer about specific actions such as cashback rewards, point adjustments, tier changes, or campaign achievement. Each object in the array provides details about the notification, such as its content, creation date, and read status.

Example : When a customer receives a cashback reward, the system sends a notification with details about the reward (if you have enabled the cashback reward notification on your dashboard). For example, the title could be "Cashback Reward!" and the body might include "You’ve received a cashback reward for your recent purchase."

Notification Object

notificationId string Unique identifier for the notification.


title string Title of the notification.


body string The content of the notification.


isRead boolean Indicates whether the notification has been read by the customer (true if read, false if unread).


createdAt datetime The timestamp when the notification was created.


lang string Language of the notification.


icon string URL to the icon associated with the notification.It can be displayed alongside the notification message in user interfaces like a mobile app or web dashboard.


count number Number of notifications on the current page.


hasMore boolean Indicating whether there are additional notifications to be fetched beyond the current page.


Sample Response

{
    "notifications": [
        {
            "notificationId": "139944",
            "title": "Points Added!",
            "body": "Your points have been adjusted, your current points balance is 89",
            "isRead": true,
            "createdAt": "0001-01-01T00:00:00",
            "lang": "en",
            "icon": "https://cdn.gameball.co/uploads/Notifications/cachback.webp"
        },
        {
            "notificationId": "152966",
            "title": "Congratulations!",
            "body": "First Order 🛍️ earned. Enjoy your rewards and keep earning more!",
            "isRead": false,
            "createdAt": "0001-01-01T00:00:00",
            "lang": "en",
            "icon": "https://s3.us-east-2.amazonaws.com/gameball.stg.uploads/uploads/gb-library/general/order-01.webp"
        }
    ],
    "count": 2,
    "hasMore": true
}

GET - Customer Notifications Count

https://api.gameball.co/api/v4/integrations/customers/{customerId}/notifications/count

This API retrieves the total count of notifications for a specific customer in Gameball, identified by customerId. It provides the number of notifications matching the specified criteria without returning detailed notification records.

Security: Requires apikey headers.

Request

Path Parameters

customerId string Required Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.

Query Parameters

isRead boolean Optional Filter notifications based on their read status. Set to true for read notifications and false for unread ones


lang string Optional Specifies the the language in which notifications will be retrieved.

Response

application/json

count number The total number of notifications available for the customer in Gameball system.


Sample Response

{
    "count": 20
}

PUT - Mark Customer Notifications as Read

https://api.gameball.co/api/v4/integrations/customers/{customerId}/notifications

This API allows you to mark specific notifications as read for a customer in Gameball, identified by customerId. By providing notification IDs, you can update the read status of individual notifications.

Security: Requires apikey and secretkey headers.

Request

Body

application/json

notificationsIds array Required An array of notification IDs that you want to mark as read. These notification IDs are retrieved through the Get Notifications endpoint, which returns a list of all notifications sent to the customer. By marking specific notifications as read, you acknowledge that the customer has seen them. This is useful for keeping track of which notifications have been addressed and ensuring a clear customer communication experience.


Sample Request

{
  "notificationsIds": [          
    139944                       
  ]
}

Last updated