Post HTTP Using VBScript

Posted on 2014-04-03
Last Modified: 2014-04-03

I am trying to send an SMS using an HTTP Post method from a VBScript, but it doesn't work - I do get a 'SMS Sent' message so no error is being returned, however the SMS actually isn't sent - no credits are used up and no SMS is received... I'm sure it's something to do with my code though - I have tried both POST & GET and neither works:

  Set objSrvHTTP = CreateObject("Msxml2.ServerXMLHTTP.6.0")
   url = "[UserID]&password=[password]&api_id=[API_ID]&to=[phone_number]&text=Test Message" "GET", url
   Set objXML = objSrvHTTP.responseXML
   If objXML.parseError.errorCode <> 0 Then
                WScript.ECHO "Error Found"
     WScript.ECHO "SMS Sent"
   End If

Open in new window

Thanks in advance
Question by:Nico2011
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 39974715
shouldnt you be using POST method when sending data. "POST", url

Author Comment

ID: 39974719
As I mentioned above - I tried both POST & GET - neither work
LVL 32

Assisted Solution

by:Robberbaron (robr)
Robberbaron (robr) earned 150 total points
ID: 39974723
yeah sorry,. re-read original.... but it still should be a post method i think.

what XML do you get back ?
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

ID: 39974733
have changed to post - sorry but I don't know how to get the XML back - this is all new to me!
LVL 52

Accepted Solution

Carl Tawn earned 350 total points
ID: 39974778
Change your code to the following and see what message you get:
  Set objSrvHTTP = CreateObject("Msxml2.ServerXMLHTTP.6.0")
   url = "[UserID]&password=[password]&api_id=[API_ID]&to=[phone_number]&text=Test Message" "GET", url

   objXML = objSrvHTTP.responseText   

   WScript.Echo objXml

Open in new window


Author Closing Comment

ID: 39974830
Thanks Carl - the XML feedback told all - it was an IP lockdown... I shared the points as best I could as both were headed in the right direction, but Carl gave me the whole code!

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question