Skip to main content

Messenger API

The Messenger API, our original messages endpoint, delivers personalized notifications about upcoming goals. Its purpose is to remind users of how much time they have left to complete their next game goal. These timely messages motivate players to stay active, helping them earn rewards and stay engaged.


Note: APIs can be used with our iFrame but not with our Wallet solution.


Endpoint

Before you attempt to connect, complete the steps in Prepare to Connect to Besitos APIs.

Endpoint URL

https://wall.besitos.ai/data/messages/{partner_id}/upcoming-goals

HTTP method

POST

Path parameter

Path parameter

Data type

Required

Description

partner_id

string

yes

Your Besitos partner ID.

Supported filters

To filter the response, you can include optional POST parameters in the request body. Here are some examples of how and why you might use these parameters:

  • Return messages related to goals for users whose IDs you include in the subscribers parameter

  • Return messages for goals with the hours specified in the hours_from and hours_to parameters

  • Return messages for specific offers with the offers parameter

The entire dataset will be returned if you do not use these parameters.

Parameter

Data type

Required

Description and example

subscribers

array

no

Returns all goals for each user ID you include in the array.

If you do not include a user ID(s), all available goals for every user on your account will be returned.

Example: 21sdf1sef54wef64

offers

array

no

Returns all goals for each offer ID included in the array.

If you do not include any offer ID(s), all goals for all offers in your account will be returned.

Example: rYZv23fgqfSN

hours_from

number

no

Returns all goals for each offer ID included in the array.

If you do not include any offer ID(s), all goals for every offer in your account will be returned.

Example: 10

hours_to

number

no

This value marks the end of a range that returns all goals with the specified hours remaining.

If you do not specify a number, all goals with up to 48 hours remaining will be returned.

Example: 41

message_template

string

no

With this filter, you can modify the following message variables: hours, level, game, and reward.

If you omit message_template, the default message will be returned.

Example of default message:

Reminder: You have [#] hours left to reach [level] of [game] and earn [reward]. Don’t miss the deadline.

Examples

Request

$apiUrl = 'https://wall.besitos.ai/data/messages/{partnerID}/upcoming-goals';
$accessToken = 'your_bearer_access_token';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"subscribers": [
"LaQ1VYb5ANTAny25Ig",
"21sdf1sef54wef64"
],
"offers": [
"rYZvzXlCqfSN",
"rYZv23fgqfSN"
],
"hours_from": 24,
"hours_to": 120,
"message_template":"You have {hours} hours left to reach {level} of {game} and earn {reward}. Don\'t miss the deadline."
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer ' . $accessToken
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Response

{
"messages": [
{
"subscriber_id": "T7D8uz2Bo5kbdhqWfkjvbfv",
"game": "RAID: Shadow Legendss - Android",
"level": "level 250",
"level_description": "Reach Level 40: Complete this event to receive a free in-game appreciation pack worth $25",
"hours": 25,
"currency": "$",
"reward": "$ 10.00",
"image": "https://cdn.kashkick.com/offers/GHWD6eXjsksw.jpg",
"square_image": "https://cdn.kashkick.com/offers/JAAuXS8s2Ds7.png",
"large_image": "https://cdn.kashkick.com/offers/6A8bYaPximuw.jpg",
"url": "https://wall-aws-staging.besitos.ai/redirect/4Z2eNR0wnfgI/b-qM22DxBgo2scqV8rzv",
"message": "You have 25 hours left to reach level 250 of RAID: Shadow Legendss - Android and earn $ 10.00. Don't miss the deadline."
},
{
"subscriber_id": "T7D8uz2Bo5kbdhqWfkjvbfv",
"game": "RAID: Shadow Legendss - Android",
"level": "level 2815",
"level_description": "Purchase a Daily Gem Pack",
"hours": 1,
"currency": "$",
"reward": "$ 5.00",
"image": "https://cdn.kashkick.com/offers/GHWD6eXjsksw.jpg",
"square_image": "https://cdn.kashkick.com/offers/JAAuXS8s2Ds7.png",
"large_image": "https://cdn.kashkick.com/offers/6A8bYaPximuw.jpg",
"url": "https://wall-aws-staging.besitos.ai/redirect/4Z2eNR0wnfgI/b-qM22DxBgo2scqV8rzv",
"message": "You have 1 hours left to reach level 2815 of RAID: Shadow Legendss - Android and earn $ 5.00. Don't miss the deadline."
},
{
"subscriber_id": "T7D8uz2Bo5kbdhqWfkjvbfv",
"game": "RAID: Shadow Legendss - Android",
"level": "level 2812",
"level_description": "Purchase a Sacred Daily Pack",
"hours": 1,
"currency": "$",
"reward": "$ 15.00",
"image": "https://cdn.kashkick.com/offers/GHWD6eXjsksw.jpg",
"square_image": "https://cdn.kashkick.com/offers/JAAuXS8s2Ds7.png",
"large_image": "https://cdn.kashkick.com/offers/6A8bYaPximuw.jpg",
"url": "https://wall-aws-staging.besitos.ai/redirect/4Z2eNR0wnfgI/b-qM22DxBgo2scqV8rzv",
"message": "You have 1 hours left to reach level 2812 of RAID: Shadow Legendss - Android and earn $ 15.00. Don't miss the deadline."
},
{
"subscriber_id": "T7D8uz2Bo5kbdhqWfkjvbfv",
"game": "Cook & Merge - iOS",
"level": "level 11226",
"level_description": "Complete Area 7",
"hours": 31,
"currency": "$",
"reward": "$ 1.00",
"image": "https://cdn.kashkick.com/offers/9eG8bC3jCKuj.jpg",
"square_image": "https://cdn.kashkick.com/offers/z6Sewp358ma1.png",
"large_image": "https://cdn.kashkick.com/offers/kBR4O5aNhHsZ.jpg",
"url": "https://wall-aws-staging.besitos.ai/redirect/PjLFbPcymFFh/b-qM22DxBgo2scqV8rzv",
"message": "You have 31 hours left to reach level 11226 of Cook & Merge - iOS and earn $ 1.00. Don't miss the deadline."
}
],
"next_page_url": null,
"previous_page_url": null
}


Response attributes

Attributes

Type

Description

Example

subscriber_id

string

Unique identifier for the user.

"LaQ1VYb5ANTAny25Ig"

game

string

Name of the game associated with the message.

"Alice‘s Dream : Merge Island"

level

string

Current or target game level associated with the message.

"level 1079"

level_description

string

Description of the goal associated with the message.

"Reach Level 15"

hours

number

Number of hours remaining for the user to complete the goal. Calculated from the installation date and goal deadline.

3

currency

string

Currency name or symbol used for reward amounts. Returns your configured currency.

"coins"

reward

string

Reward amount for completing the upcoming goal, including the currency.

"40 coins"

url

string

Smart redirect URL for the game. If the app is installed, the user is directed to the app. Otherwise, the user is directed to the appropriate app store listing.

message

string

Message content generated for the user. May contain either a custom message template or the default message.

"You have 3 hours left to reach level 1079 of Alice‘s Dream : Merge Island and earn 40 coins. Don't miss the deadline."

For help, contact your Besitos Account Manager or our Implementation Team at [email protected] or via your project channel in Slack.

Did this answer your question?