SMSv2 VBScript

From CDYNE Wiki
Jump to: navigation, search

Sending an AdvancedSMSsend request by passing XML with an http object in VBScript

Dim thexml
 
'The xml may look sloppy, but it must be a single line to work.
'Look here http://sms2.cdyne.com/sms.svc/help/operations/AdvancedSMSsend for a sample xml packet in a more readable format.
'For this sample to work, replace all the (your value here) in thexml with the values you wish to use.

thexml = "<SMSAdvancedRequest xmlns=""http://schemas.datacontract.org/2004/07/SmsWS""><LicenseKey>(Your License Key)</LicenseKey><SMSRequests><SMSRequest
xmlns="
"http://sms2.cdyne.com""><AssignedDID></AssignedDID><Message>(Your Message)</Message><PhoneNumbers><string
xmlns="
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"">(Your Number)</string></PhoneNumbers><ReferenceID></ReferenceID><StatusPostBackURL></StatusPostBackURL></SMSRequest></SMSRequests></SMSAdvance
dRequest>"

 
'<ScheduledDateTime>1999-05-31T11:20:00</ScheduledDateTime>
'If you wish for the message to be sent at a future datetime include this parameter.
'Note the ScheduledDateTime must be in UTC format.

dim xmlHttp
 
set xmlHttp = createobject("Microsoft.XMLHTTP")
 
call xmlHttp.open("POST", "http://sms2.cdyne.com/sms.svc/AdvancedSMSsend",false)
call xmlHttp.setRequestHeader("Content-Type","text/xml")
call xmlHttp.send(thexml)
 
document.write(xmlHttp.responseText)
Personal tools
Namespaces

Variants
Actions
Navigation
Tools

Trial Key