🛡️Setup S2S Postback

You can configure the S2S postback for the application in the dashboard while adding new app inside manage app section.

Setting Up Postback URL

We fire an HTTP GET request to the provided postback URL. The following query parameters will be consider.

//Example URL

http://www.example.com/postbacks/postback_file_name.php
Query Params
Description

user_id

Your application unique_id set while initializing the SDK.

offer_id

The identifier of the offer for which the user receives a postback.

offer_name

The name of the offer for which the user receives a postback.

payout

The amount earned per completed milestone by publisher.

amount

The value of the reward earned by the end user.

signature

Hash of the above values to verify the request

task_name

The name of task for which user receives reward (for level or playtime offers)

task_id

The id of task for which user receives reward (for level or playtime offers)

Example

user_id = 123

offer_id = 123

offer_name = Test_game

payout = 500

amount= 250

signature = 45786sdg458-sdg465-659s465sdg-465ery98bm-65fb798sdg32dv

task_name = Complete_level_X

task_id = 162657

PostbackURL -> http://www.example.com/postbacks/postback_file_name.php?Suser_id=123&offer_id=123&offer_name=Test_game&payout=500&amount=250&signature=45786sdg458-sdg465-659s465sdg-465ery98bm-65fb798sdg32dv&task_name=Complete_level_X&task_id=162657

Sample code to validate request

 // Signature Authentication
 
 $userId = $_REQUEST['user_id'];
 $offer_id = $_REQUEST['offer_id'];
 $coin_amount = (int)$_REQUEST['amount'];
 $signature = $_REQUEST['signature'];
 $task_id= $_REQUEST['task_id'];
 $task_name= $_REQUEST['task_name'];

 $calculated_signature = sha1($.$.$.""."");
 
 if($signature === $calculated_signature){
 // Request is valid
 }

Points to keep in mind while setting up postback URL

  • All parameters are append from our side publisher has to give only path to their postback file.

  • Value of amount passed in postback is converted in your given app currency at your given currency rate in exchange of 1$.

Last updated