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:
Have your partner ID ready.
Contact your Besitos Account Manager to request API access.
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 |
| 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 |
| 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: |
| 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: |
| 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: |
| 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: |
| 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:
|
Examples
Request
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
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 |
| string | The unique identifier of the user. |
|
| string | The name of the game. |
|
| string | The current or target level (contains text and number). |
|
| string | A description of the goal in the offer. |
|
| integer | Hours remaining to achieve the goal, calculated from the “install” goal; the countdown begins once a user installs the game app. |
|
| string | Your (partner) currency (points, dollars, etc.). |
|
| string | The user’s reward for reaching the upcoming goal. |
|
| 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. |
|
| string | The message for the upcoming goal. |
|
For help, contact your Besitos Account Manager or our Implementation Team at [email protected] or via your project channel in Slack.
