Home

PHP

Postback

Receive real time notifications

Receive real time notifications for programs


Step 1 . Go to My Account >> Tools
Step 2 . Fill in Postback Url and Postback Password ( Postback Url must be a public url from your side which will be called by our platform every time when a program state is changed to not_join)
Step 3 . Prepare your Postback Url to receive the data according with the following format we send

{
 "notification_type":"not_joined",
 "token":"97ef5cc129d8e2a804c081164d6150b5",
 "notification_data":[{"program_id":"12345"},{"program_id":"23456"}]
} 

{
 "notification_type":"commission",
 "token":"bc24d9b2d5b0dfddb6959a93bab2c021",
 "notification_data":{
  "program_id":11,
  "status":
  "pending",
  "statistics_date":"2015-01-01 23:56:01",
  "click_date":"2015-01-01 23:56:01",
  "tracking_id":"fre234DD23",
  "user_member_id":"23",
  "sales":245.2,
  "commission_confirmed":0,
  "commission_unconfirmed":2,
  "currency_id":1}
} 

The data is json encoded and sent through the POST method using parameter "notification"

              
              
              
              

<?php                  
$notification = (isset($_POST['notification']) && $_POST['notification'] <> '') ? $_POST['notification'] : FALSE;

if ($notification)
{
	$data = json_decode($notification);	
	if (json_last_error() == JSON_ERROR_NONE && $data->token == MD5(YOUR_PASSWORD))
	{
		
		print_r($data);				
		
	}
}                  
                  
?>