Documente Academic
Documente Profesional
Documente Cultură
Suite/NETCAST
Web Service/API Guide
Table of Contents
1 | Introduction ............................................................................................................................................ 1
About This Document....................................................................................................................... 1
Process Flow Diagram ..................................................................................................................... 1
2 | Features .................................................................................................................................................. 2
IP White-List via Web UI .................................................................................................................. 2
Conditions and Rules .......................................................................................................... 2
Connection ....................................................................................................................................... 2
Function .............................................................................................................................. 2
Parameters .......................................................................................................................... 2
Example .............................................................................................................................. 3
Return ................................................................................................................................. 3
XML Request ...................................................................................................................... 3
XML Response .................................................................................................................... 3
Send SMS ........................................................................................................................................ 4
Function .............................................................................................................................. 4
Parameters .......................................................................................................................... 4
Example .............................................................................................................................. 4
Return ................................................................................................................................. 4
XML Request ...................................................................................................................... 4
XML Response .................................................................................................................... 5
Send SMS with Opt-Out Message ................................................................................................... 5
Function .............................................................................................................................. 5
Parameters .......................................................................................................................... 5
Standard Opt-Out Message ................................................................................................ 5
Example .............................................................................................................................. 6
Return ................................................................................................................................. 6
XML Request ...................................................................................................................... 6
XML Response .................................................................................................................... 6
Request Sent SMS Status ............................................................................................................... 7
Function .............................................................................................................................. 7
Parameters .......................................................................................................................... 7
Example .............................................................................................................................. 7
Return ................................................................................................................................. 7
XML Request ...................................................................................................................... 8
XML Response .................................................................................................................... 8
Download and Request Logs ........................................................................................................... 8
Function .............................................................................................................................. 8
Parameters .......................................................................................................................... 8
Log Formats ........................................................................................................................ 8
Example .............................................................................................................................. 9
Return ................................................................................................................................. 9
XML Request ...................................................................................................................... 9
XML Response .................................................................................................................. 10
Download Incoming Messages from Smart Subscribers ............................................................... 11
Function ............................................................................................................................ 11
Parameters ........................................................................................................................ 11
Example ............................................................................................................................ 11
Return ............................................................................................................................... 11
XML Request .................................................................................................................... 11
XML Response .................................................................................................................. 12
Download Incoming Messages ...................................................................................................... 12
Function ............................................................................................................................ 12
Parameters ........................................................................................................................ 12
Example ............................................................................................................................ 12
Return ............................................................................................................................... 13
XML Request .................................................................................................................... 13
XML Response .................................................................... Error! Bookmark not defined.
3 | Error Code Per Function ..................................................................................................................... 13
4 | Error Code and Description ................................................................................................................ 15
5 | SOAP Server and Functions ............................................................................................................... 16
Server Endpoint ............................................................................................................................. 16
Full WSDL Documentation ............................................................................................................. 16
Generic Client Script ...................................................................................................................... 16
Revision History
In the development of this new version, the Web Service or API (Application Program
Interface) will be enhanced. Web Service allows you to use your own system or
application and be able to send SMS to target recipients. The said service can be
integrated to any system using HTTP-SOAP or Simple Object Access Protocol.
This API Guide discusses the features of the Smart Messaging Suite Web Service. This
document aims to help you familiarize with the functions you can use in the API.
Connection
This function is used to test the connection between your application with the Web
Service.
Function
GET_CONNECT
Parameters
Assigned SmartMS ID to Client
$method = 'GETCONNECT';
$parameters = array(
array(
'token' => $token
)
);
$return = $client->__call($method, $parameters);
?>
Return
"Welcome to Smart Messaging Suite Web Service. You are now connected to
our SOAP API Server.”
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:GETCONNECT>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
</urn:GETCONNECT>
</soapenv:Body>
</soapenv:Envelope>
XML Response
<senv:Envelope xmlns:tns="urn:netcast_web_service"
xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
<senv:Body>
<tns:GETCONNECTResponse>
<tns:GETCONNECTResult>Welcome to Smart Messaging Suite Web Service.
You are now connected to our SOAP API Server.</tns:GETCONNECTResult>
</tns:GETCONNECTResponse>
</senv:Body>
</senv:Envelope>
Function
SENDSMS
Parameters
Destination mobile number
Message
SmartMS ID
Example
<?php
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = "samplesmartmsid";
$method = 'SENDSMS';
$parameters = array(
array(
'token' => $token,
'msisdn' => '09191234567',
'message' => 'Sample message here.'
)
);
$return = $client->__call($method, $parameters)
?>
Return
Transaction Reference Number
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:SENDSMS>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
<!--Optional:-->
XML Response
<senv:Envelope xmlns:tns="urn:netcast_web_service"
xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
<senv:Body>
<tns:SENDSMSResponse>
<tns:SENDSMSResult>1422</tns:SENDSMSResult>
</tns:SENDSMSResponse>
</senv:Body>
</senv:Envelope>
Function
SENDSMSOPT
Parameters
Destination mobile number
Message
SmartMS ID
$method = 'SENDSMSOPT';
$parameters = array(
array(
'token' => $token,
'msisdn' => '09191234567',
'message' => 'Sample message here.'
)
);
$return = $client->__call($method, $parameters);
?>
Return
Transaction Reference Number
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:SENDSMSOPT>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
<!--Optional:-->
<urn:msisdn>09191234567</urn:msisdn>
<!--Optional:-->
<urn:message>Sample message here.</urn:message>
</urn:SENDSMSOPT>
</soapenv:Body>
</soapenv:Envelope>
XML Response
<senv:Envelope xmlns:tns="urn:netcast_web_service"
xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
Function
GETMSGSTATUS
Parameters
Transaction reference number
SmartMS ID
Example
<?php
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = "samplesmartmsid";
$method = 'GETMSGSTATUS';
$parameters = array(
array(
'token' => $token,
'transaction_id' =>'30384'
)
);
$return = $client->__call($method, $parameters);
?>
Return
Status of referenced message (please see Summary section for further
details)
XML Response
<senv:Envelope xmlns:tns="urn:netcast_web_service"
xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
<senv:Body>
<tns:GETMSGSTATUSResponse>
<tns:GETMSGSTATUSResult>RETGMS02</tns:GETMSGSTATUSResult>
</tns:GETMSGSTATUSResponse>
</senv:Body>
</senv:Envelope>
Function
GETLOGS
Parameters
Transaction date
SmartMS ID
Log Formats
SENDSMS - datetime|ip_address|SENDSMS|params|result
SENDSMSOPT - datetime|ip_address|SENDSMS|params|result
Example
<?php
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = "samplesmartmsid";
$method = 'GETLOGS';
$parameters = array(
array(
'token' => $token
)
);
$return = $client->__call($method, $parameters);
?>
Return
Transaction logs (format: datetime|ip_address|function_call|parmsid|result)
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:GETLOGS>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
<!--Optional:-->
<urn:transaction_date>20150120</urn:transaction_date>
</urn:GETLOGS>
</soapenv:Body>
</soapenv:Envelope>
Note Once the logs have been pulled already, it will no longer be shown
when the methods are called again.
Function
GETSMART
Parameters
SmartMS ID
Example
<?php
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = "samplesmartmsid";
$method = 'GETSMART';
$parameters = array(
array(
'token' => $token
)
);
$return = $client->__call($method, $parameters);
?>
Return
Array containing sender number and message: Array('timestamp'=>'
2015/01/20 13:50:46', 'min'=>'639191234567', 'msg'=>'Sample
reply msg.' )
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:GETSMART>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
</urn:GETSMART>
</soapenv:Body>
</soapenv:Envelope>
Function
GETINCOMING
Parameters
SmartMS ID
Example
<?php
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = "samplesmartmsid";
$method = 'GETINCOMING';
$parameters = array(
array(
'token' => $token
)
);
$return = $client->__call($method, $parameters);
?>
XML Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:netcast_web_service">
<soapenv:Header/>
<soapenv:Body>
<urn:GETINCOMING>
<!--Optional:-->
<urn:token>samplesmartmsid</urn:token>
</urn:GETINCOMING>
</soapenv:Body>
</soapenv:Envelope>
XML Response
<senv:Envelope xmlns:tns="urn:netcast_web_service" xmlns:s0="apps.core.utils"
xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
<senv:Body>
<tns:GETINCOMINGResponse>
<tns:GETINCOMINGResult>
<s0:Transaction>
<s0:timestamp>2015/01/20 13:50:46</s0:timestamp>
<s0:min>639191234567</s0:min>
<s0:msg>Sample reply msg.</s0:msg>
</s0:Transaction>
</tns:GETINCOMINGResult>
</tns:GETINCOMINGResponse>
</senv:Body>
</senv:Envelope>
Server Endpoint
https://ws.smartmesssaging.com.ph/soap/
$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
$client = new soapclient($URL);
$token = " <WS TOKEN> ";
//Sample:
//$URL = "https://ws.smartmessaging.com.ph/soap/?wsdl";
//$client = new soapclient($URL);
//$token = "samplesmartmsid";
//$method = 'GETCONNECT';
//$parameters = array(
// array(
// 'token' => $token
// )
// );
//$return = $client->__call($method, $parameters);
?>