SOAP API
From Documentation
Contents |
Overview
The mylkBroadcast API makes the mylkBroadcast applicatioin into a web service, exposing the SMS outbound functionality through a SOAP interface so that it can be integrated into external applications.
The functions calls are not language specific and they'll be available in Java, .Net, Perl, PHP etc. as long as user has a SOAP Client in that language.
The SOAP Client needs to point to the WSDL file @ https://broadcast.mylkmessage.com.au/SmsSoap.wsdl
The function calls available are listed below.
boolean verify(string username, string password)
Attempts to log on to this system. This must be called each time a new SOAP client is created.
- @username: the username
- @password: the password
- @return: true if the user/pass verification was successful
void setDeliveryUrl(string url)
- Set a URL to have any send reports delivered too.
- This is optional and not required.
@url: The url to deliver to. The format for the URL is:
http://myhost.com.au/myfile.php?id=YOURID&status=%s
where %s will be replaced by SUCCESS or FAILURE
string sendSms(string from,string to,string message,boolean dont_send_long)
Sends a group of SMSs
- @from: phone number this message is from
- @to: an XML string in the following format:
<recipients>
<recipient number="0424261976" [merge_fields="field1,field2"] />
<recipient number="0424261977" [merge_fields="field1,field2"] />
</recipients>
- @message: a string containing zero or more merge fields (merge fields expressed as %%):
"hi folks, how are you today" <pre> <pre> "hi %%, get a great deal on %% at %%"
- @dont_send_long: flag, which if set will not send any messages > 160 characters
- @return: the report key for this batch of messages
string getStatus(string report_key,string recipient)
Get the status of a message sent to a single phone number (a message instance)
- @report_key: the report_key this message belongs to
- @recipient: the phone number of the recipient
- @return: an XML report in the following format:
<report>
<recipient number="0424261977" status="0|1" date-sent="2008-09-15 13:24:13" date-finalised="2008-09-15 13:25:17" />
</report>
string getReport(string report_key)
Get the status of a group of messages sent (a group of message instances belonging to one message)
- @report_key: the report_key of this message group
- @return: an XML report in the following format:
<report>
<recipient number="0424261977" status="0|1" date-sent="2008-09-15 13:24:13" date-finalised="2008-09-15 13:25:17" />
<recipient number="0434891941" status="0|1" date-sent="2008-09-15 13:24:13" date-finalised="2008-09-15 13:25:18" />
<recipient number="0434891812" status="0|1" date-sent="2008-09-15 13:24:13" date-finalised="2008-09-15 13:25:19" />
</report>
Exaples
A sample implementation of a C# application, and a PHP example, which uses our SOAP webservice is available from http://broadcast.mylkmessage.com.au/mylkmessage_webservice.zip.
