Single Push Messages

This endpoint is used to send single push notification. The request method of this call needs to be "POST".


https://api2.pushassist.com/single-push-messages/


Request Parameters
Parameter Name Description
subscriber_key Subscriber Key.
title Notification title.
message Notification message
redirect_url Target url to be associated with the notification (Optional).
image https:// OR http://target-url image (250px X 250px) (Optional).
big_image https:// OR http://target-url Banner image (400px X 400px) (Optional).
Example
 function send_single_push_notification($response_array){
				
	$url = 'https://api2.pushassist.com/single-push-messages/';
	
	$headers = array(
		'X-Auth-Token: Your API Key',
		'X-Auth-Secret: Your SECRET Key',
		'Content-Type: application/json'
	);
   
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($response_array));
	curl_setopt($ch, CURLOPT_SSLVERSION, 4);
	$result = curl_exec($ch);

	if ($result === FALSE) {
		die('Curl failed: ' . curl_error($ch));
	}
	
	curl_close($ch);

	$result_arr = json_decode($result, true);
	
	return $result_arr;
} 
Request Array
 $response_array = array("subscriber_key" => "Da77gae8G88a20yRH53he6Uagh",
	"title" => "Notification Test",
	"message" => "Notification Test Message",
	"redirect_url" => "",
	"image" => "",	// full image path / local image path will not work
	"big_image" => "",	// full image path / local image path will not work
	"utm_params" => array("utm_source" => "",	// optional
		"utm_medium" => "",
		"utm_campaign" => ""),
	"segments" => array('YourSegmentName')
);
		
$response = send_single_push_notification($response_array); 
Response
 if($response['status'] == 'Success'){

	echo $response['response_message'];

} else if($response['status'] == 'Error') {

	echo $response['error_message'];

} else if($response['error'] != ''){
	
	echo $response['error'];
} else {

	echo $response['errors'];
}