Textlocal Logo

API Documentation

Cancel Scheduled Messages

This command will cancel a scheduled message job.

Resource URL

https://api.textlocal.in/cancel_scheduled/

Sample Request

<?php
	// Account details
	$apiKey = urlencode('Your apiKey');
	
	// Message details
	$sentId = urlencode('136150216');

	// Prepare data for POST request
	$data = array('apikey' => $apiKey, 'sent_id' => $sentId);
 
	// Send the POST request with cURL
	$ch = curl_init('https://api.textlocal.in/cancel_scheduled/');
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);
	
	// Process your response here
	echo $response;
?>
<?php
	// Account details
	$apiKey = urlencode('Your apiKey');
	
	// Message Details
	$sentId = urlencode('136150216');

	// Prepare data for POST request
	$data = 'apikey=' . $apiKey . '&sent_id=' . $sentId;
 
	// Send the GET request with cURL
	$ch = curl_init('https://api.textlocal.in/cancel_scheduled/?' . $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);
	
	// Process your response here
	echo $response;
?>
<?php
	require('Textlocal.class.php');
	
	$Textlocal = new Textlocal(false, false, 'your apiKey');
	
	$sent_id = '1234';
	
	$response = $Textlocal->cancelScheduledMessage($sent_id);
	print_r($response);
?>

Parameters

sent_id The ID for the scheduled message found in get_scheduled.
Login Parameters (Additional Information)
apiKey You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address.

Caution: This will delete the scheduled message. Once deleted, it cannot be recovered.

Sample Response

{
	"success":{
		"message":"Success"
	}
}
<?xml version="1.0" encoding="UTF-8" ?>
<response>
	<success>
		<message>Success</message>
	</success>
	<status>success</status>
</response>

Errors

Error Codes
59 No sent ID specified.
60 Invalid sent ID.