But for some reason, I keep getting the following annoying error:
We couldn't authenticate web form provider. Please contact web form provider for any additional information.
I read in a post on Method that the "timezonerouter.aspx" might cause some problems. So I tried submitting my test form (web2lead.asp) using it and not using it. The same issue arises.
Now, yes, ASP.NET certainly would be easier by using the Method API's web service. But unfortunately, I have not delved enough into ASP.NET to appreciate if I require code behind pages or a GUI on my page. So while it's ironic that I"m a present-day C# and .NET user, I still use good old classic ASP to get my data stuff done.
Here is my code. Hopefully someone at Method can give me some insight as to what I'm doing wrong here. It should work.
<% @LANGUAGE="VBScript" %>
<% Response.buffer = true %>
'on error resume next
' TRIED USING THE TIME ZONE ROUTER -> DOES NOT WORK.
'destURL = "https://www.methodintegration.com/method/timezonerouter.aspx?url=https://www.methodintegration.com/MethodWebForms/submit.aspx"
' SO WE'RE USING THIS INSTEAD AND ACCEPTING TIMESTAMPS IN EST
destURL = "https://www.methodintegration.com/MethodWebForms/submit.aspx"
'Construct the Post Data
payload = "oid=xxxxxxxxxxxxxxxxxxxxxxxx" ' note: THE XXXX's here are put here just for my post to Method Forum
payload = payload & "&formName=" & server.URLencode("Web-To-Lead")
payload = payload & "&redUrl=" & server.URLencode("http://")
payload = payload & "&BillAddressAddr3_Step2=" & server.URLencode("101 Some Street")
payload = payload & "&BillAddressCity_Step2=" & server.URLencode("Toronto")
payload = payload & "&BillAddressState_Step2=" & server.URLencode("Ontario")
payload = payload & "&BillAddressPostalCode_Step2=" & server.URLencode("M5N 2T3")
payload = payload & "&BillAddressCountry_Step2=" & server.URLencode("CA")
payload = payload & "&CompanyName_Step2=" & server.URLencode("ACME CORPORATION")
payload = payload & "&FirstName_Step2=" & server.URLencode("John")
payload = payload & "&LastName_Step2=" & server.URLencode("Doe")
payload = payload & "&Email_Step2=" & server.URLencode("firstname.lastname@example.org")
payload = payload & "&Phone_Step2=" & server.URLencode("9051234567")
payload = payload & "&Description_Step3=" & server.URLencode("these are my comments")
'Construct the useragent and send
set http_obj = server.CreateObject("MSXML2.ServerXMLHTTP")
http_obj.Open "POST", destURL , false
http_obj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Grab the response
strResponse = http_obj.ResponseText
IT SURE WOULD BE NICE TO GET THIS WORKING :)