Solved

Implement JSON via REST interface using a CURL script as a model?

Posted on 2015-01-24
5
137 Views
Last Modified: 2015-01-25
I am trying to access a REST- based API using VBScript.  I have access to a Curl script that does just what I want to do, but don't have Curl on my Windows machine, and really don't know Curl anyway.  So looking for a "translation" from Curl to VBScript.  This is a known good Curl command line:

curl -X GET -H 'ACCEPT: application/json' -H 'X-AUTH-TOKEN: cee8d9a712fd59b18d1ee117' https://api.niftywebsite.com/statusUpdate
0
Comment
Question by:Mike Caldwell
  • 3
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40568934
cURL is a free download.  http://curl.haxx.se/    I've been using the ones from this page:  http://www.paehl.com/open_source/?CURL_7.40.0
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569312
So, if I install Curl, can I make sort of a BAT file of it and call it from a VBScript?  The next step I want to get back is an XML or JSON stream that I can capture and make a screen display based upon the data received.  So the bottom line is, if I install Curl, how do I then run the Curl commands?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40569337
I suggested downloading cURL because duplicating it's functions would be difficult or at the very least, time consuming in VBScript.  You can run the cURL command in a batch file like any other program and receive the data back in a file.  Then you can use the file in your own program.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569342
Thanks Dave.  I'm experimenting with that now.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569360
I have other VBScripts that run a BAT file fine, but not getting anywhere with this.  Thanks for pointing me to Curl, looks like it will work fine once I figure out how to run it with VBS and capture the returning data stream.  So I'll close out this question and make another pointedly re: how to get this done with a VBS.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now