Anybody used REST with WinBatch?

Started by steeld, September 02, 2013, 07:49:23 AM

Previous topic - Next topic

steeld

I am trying to use a REST (Representational state transfer) API with a workflow tool called Target Process. I'm not sure where to start. Anybody any clues or pointers about using REST with WinBatch scripts?

Thanks

David

JTaylor

I normally use MSXML.  Here is a starting point for the retrieval.  Several examples in the Tech Database for reading it after you get it.

Jim

Code (winbatch) Select

  ; Create MSXML Object
  MSXML = ObjectOpen("MSXML.DOMDocument")
  ; Set MSXML Options
  MSXML.Async = 'False'
  MSXML.preserveWhiteSpace = 'False'
  MSXML.validateOnParse = 'True'
  MSXML.resolveExternals = 'False'

  XMLURL =  "YOUR_API_URL"

  ; Issue the request and wait for it to be honored
  Loaded = MSXML.Load(XMLURL)
 
  If !Loaded Then
    Display(2,"Warning","The service is not available.")
    ObjectClose(MSXML)
    Exit
  EndIf
  ; Get root of document
  XML_Root = MSXML.documentElement
  xtxt = XML_Root.xml

  Message("HI",xtxt)

  ;PARSE XML ******************************


  ObjectClose(MSXML)

stanl

Quote from: steeld on September 02, 2013, 07:49:23 AM
I am trying to use a REST (Representational state transfer) API

Like Jim said. I would troll the Tech Database. You can use MSXML like Jim posted, XMLHttp, or the never Powershell rest cmdlet.

steeld

Thanks guys. I'll start with that and see what I can come up with.

David