Skip Navigation

VBScript

dim objXMLDoc, strPayload, strSdkUrl, strPid, strSdkUser, strSdkPass Set objXmlDoc = CreateObject("MSXML2.DOMDocument") objXmlDoc.async = false 'Config variables strSdkUrl = "http://athoc.server.com/sdk/listener/listen.asp" strPid = "2010110" strSdkUser = "SDK Username" strSdkPass = "SDK Password" 'Form AtHoc XML payload strPayload = "<AtHocSdk>" &_ "<client>" & strPid & "</client>" &_ "<validation>" &_ "<username>" & strSdkUser & "</username>" &_ "<password>" & strSdkPass & "</password>" &_ "</validation>" &_ "<payload type='USER-SYNC'>" &_ "<userSynchronization>" &_ "<mid>joesmith</mid>" &_ "<enabled>N</enabled>" &_ "</userSynchronization>" &_ "</payload>" &_ "</AtHocSdk>" 'Post XML payload to AtHoc listener web page objXmlDoc.load(strSdkUrl & "?data=" & Escape(strPayload)) 'Check for errors and echo status If objXmlDoc.parseError.errorCode <> 0 Then WScript.Echo "Error: Could Not Connect to Server: " & Now() ElseIf Not objXmlDoc.selectSingleNode("//ok") Is Nothing Then WScript.Echo "API Call Successful: " & Now() Else WScript.Echo "ERROR in API call. Error Was: " & objXmlDoc.selectSingleNode("//error").text & " " & Now() End If 'Close out variables Set strPayload = Nothing Set strSdkUrl = Nothing Set strPid = Nothing Set strSdkUser = Nothing Set strSdkPass = Nothing