SOAP API Stop message

This command will attempt to stop the delivery of a particular message. This command can only stop messages that have been scheduled for delivery in future or may be queued within our router. It cannot stop messages that have already been delivered to a SMSC.

 

Command

delmsg

 

Parameters

1) You need to supply the authentication parameters that are outlined in Getting started with our APIs

2) You need to pass either apimsgid or climsgid.

 

Parameter

Description

apimsgid

This is the API message ID you get back when you send a message.

climsgid

This is the message ID that you specified when you generated a message.

 

Examples

All examples below are for the document/literal based server.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.clickatell.com/soap/document_literal/webservice">
	<SOAP-ENV:Body>
		<ns1:delmsg>
			<api_id>123456</api_id>
			<user>MyUsername</user>
			<password>MyPassword</password>
			<apimsgid>57809dfd9296c9df57c84c16d69ceeef</apimsgid>
		</ns1:delmsg>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Code samples:

PHP:

<?php
$oClient = new SoapClient(
	'http://api.clickatell.com/soap/document_literal/webservice?wsdl',
	array(
		'trace' => true,
		'keep_alive' => true
	)
);

// Query message
$aResult = $oClient->delmsg(
	array(
		'api_id' => '123456',
		'user' => 'MyUsername',
		'password' => 'MyPassword',
		'apimsgid' => '57809dfd9296c9df57c84c16d69ceeef'
	)
);

echo '<pre>' . print_r($aResult,true) . '</pre>';
?>

 

API responses

Example response

Successful API response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.clickatell.com/soap/document_literal/webservice">
	<SOAP-ENV:Body>
		<ns1:delmsgResponse>
			<return>ID: 57809dfd9296c9df57c84c16d69ceeef Status: 006</return>
		</ns1:delmsgResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Error response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.clickatell.com/soap/document_literal/webservice">
	<SOAP-ENV:Body>
		<ns1:delmsgResponse>
			<return>ERR: 001, Authentication failed</return>
		</ns1:delmsgResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Return format

Successful API response:

ID: <message ID> Status: <status ID>

Error response:

ERR: <error code>, <error description>