Advanced Services - SMS Connectivity

ASP JScript Sample application using HTTP to send a UCS2 or Unicode message

HSL Mobile Messaging

The following sample application written in ASP JScript sends a UCS2 or Unicode message to a single mobile telephone. The application uses HTTP to communicate with HSL's systems. To send to more than one mobile telephone at a time, separate each mobile number in the destaddr field by a comma (e.g. "447968000111,447720000111,3378100100").

<%@ Language = JScript%>

<html>
<head>
    <title>Simple JScript (ASP) example for access to the HSL HTTP interface</title>
</head>
<body>

<%
// These variables fill out the various parts described in the
// interface specification
var host = "sms.haysystems.com";
var port = "80";
var action = "senducs";
var client_id = "<your client_id>";
var ucs2 = "06450631062d0628064b06270020063906270644064500200021";
var destaddr = "<some fully-qualified MSISDN>";
var password = "<your secret>";

// Build and encode the URL.
var url = "http://" + host + ":" + port + "/" + action + "/";
var query = "client_id=" + client_id + "&destaddr="+ destaddr + "&message="
    + ucs2 + "&password=" + password;

// Create instance of the Inet control
var xml = Server.CreateObject("Microsoft.XMLHTTP");

xml.Open("POST", url, false);
xml.Send(query);

// Make the request and print the result
Response.Write("<p>Submission result: ");
Response.Write(xml.responseText);
Response.Write("</p>");
%>

</body>
</html>

super_simple_ucs2_http_example_jscript.asp


Copyright © Hay Systems Ltd 2004

Owner: support@haysystems.com 20 September 2004

Sample code link | Developers section link