Skip to main content

Messenger API

Updated this week

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.


Preparing to connect

Follow these steps to prepare to connect to Besitos APIs:

  1. Have your partner ID ready.

  2. Contact your Besitos Account Manager to request API access.

  3. Generate and save your bearer token for authentication.

Continue reading for a complete description of the API parameters and response attributes, or visit our Postman collection to start testing.


Endpoint

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

integer

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

integer

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 the "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

The unique identifier of the user.

"LaQ1VYb5ANTAny25Ig"

game

string

The name of the game.

"Alice‘s Dream : Merge Island"

level

string

The current or target level (contains text and number).

"level 1079"

level_description

string

A description of the goal in the offer.

"Reach Level 15"

hours

integer

Hours remaining to achieve the goal, calculated from the “install” goal; the countdown begins once a user installs the game app.

3

currency

string

Your (partner) currency (points, dollars, etc.).

"coins"

reward

string

The user’s reward for reaching the upcoming goal.

"40 coins"

url

string

This link checks whether the user has the app installed on their device.

If it's installed, the user is directed to the app; otherwise, they are directed to the app in the Google Play Store or the Apple App Store.

"https://wall-aws-staging.besitos.ai/redirect/4Z2eNR0wnfgI/b-qM22DxBgo2scqV8rzv"

message

string

The message for the upcoming goal.

"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?