Notifications πŸ‘‘
The Notifications API can be used to list the player's notifications and also to update its status once read.

Available Endpoints

Type
Description
Endpoint
GET
/integrations/notifications/{playerUniqueId}
PUT
/integrations/notifications
This endpoint is only available for our GURU customers only. πŸ‘‘

GET - Player Notifications

1
https://api.gameball.co/api/v3.0/integrations/notifications/{playerUniqueId}/
Copied!
This API is used to to retrieve a specific player's list of notifications in Gameball.

Request

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Path Parameters

Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball

Query Parameters

Attribute
Type
Required
Description
isRead
boolean
No
Read status filter. This could be used in case you need to filter notifications based on their read status.
lang
string
No
Language filter. This could be used to specify the language needed to display the notification in. Note: The language provided should be as per configured languages in your account.
Example: "en", "fr".
page
integer
No
Result page number. Starts from 1. Default is 1
limit
integer
No
Result page size. Default is 50 notifications and Max is 200

Response

Returns an array of notification objects described as follows:
Attribute
Type
Description
notifications
array
List of returned notification objects.
count
integer
returned currently displayed notifications list count
total
integer
total number of notifications available matching the applied filters
Example:
"count": 50
"total": 200

notification Object

Attribute
Type
Description
notificationId
string
Unique Identifier for a notification
title
string
Notification Title
body
string
Notification Body
isRead
boolean
Indicates whether the notification is read or not.
createdAt
string
Notification's creation date, as an ISO8601 timestamp.
Example: "2019-09-21T16:53:28.190Z"
lang
string
The language in which the notification is displayed. In case the lang is not provided in the request, defaultlang is returned.
Note: The language provided should be as per configured languages in your account.
Example: "en", "fr".
icon
string
Notification's icon URL.

Sample Response

1
{
2
"notifications": [
3
{
4
"notificationId" : "123",
5
"title": "New level!",
6
"body": "Keep it up! You are now on Bronze ",
7
"isRead": true,
8
"createdAt": "2021-05-12T00:08:09.646174",
9
"lang": "en",
10
"icon": "https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb-icon-level-13.png"
11
},
12
{
13
"notificationId" : "124",
14
"title": "Congratulations! ",
15
"body": "Welcome earned. Enjoy your rewards and keep earning more!",
16
"isRead": true,
17
"createdAt": "2021-05-12T00:08:09.623367",
18
"lang": "en",
19
"icon": "https://cdn.gameball.co/uploads/client776/bcc5d9be-3861-415f-bdf9-34b4064a1320Group 2144.png"
20
}
21
],
22
"count": 50,
23
"total": 200
24
}
Copied!

Usage Example

cURL
1
curl -X GET -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -v -i
2
'https://api.gameball.co/api/v3.0/integrations/notifications/:playerUniqueId?lang=en'
Copied!

PUT - Mark Notification(s) as Read

1
https://api.gameball.co/api/v3.0/integrations/notifications
Copied!
The API call is used to mark the player's notification(s) as read in Gameball.

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Body

Attribute
Type
Required
Description
notificationIds
array
Yes
An array of IDs of the notifications to be marked as read.
Example: ["12334", "14533", "55343"]

Sample Body

1
{
2
"notificationIds" : ["123", "3441", "3245"]
3
}
Copied!

Usage Example

cURL
1
curl -X PUT -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"notificationIds" : ["123", "3441", "3245"]
3
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/notifications'
Copied!
Last modified 28d ago