Format for outgoing web leads

 

Outgoing Web Leads send configurable Contact information as XML Data to a specified URL. The XML Data is constructed with a root node named “Contact”. This root node contains a sub node for each mapping specified through the UI in Outgoing Web Lead form. Each sub node name is the “Outgoing Field Name” value and it surrounds the data found in the corresponding “VanillaSoft Field” or the “Default Value”.

For example, these mappings:

WebLead Mapping.png

Would produce XML that looked like this:

Outgoing_Weblead2.png

In order to receive this XML at the specified URL and perform an action on it, you must read it from the Body of the HTTP Request. This XML is sent in the HTTP Request body with a mime type of “text/xml”. And in order to let us know that you received the XML you must return the following text in the Body of the HTTP Response: “success”. If there is an error in your processing, you can send the error message in the Body of the HTTP Response and we will log it on our end. The following is an example of an ASP.NET webpage that would receive and process the XML:

 

using System;

using System.Xml;

namespace PMRExample

{

public class WebForm1 : System.Web.UI.Page

{

override protected void OnInit(EventArgs e)

{

try

{

// For example, load the XML into an XML Document

XmlDocument xmlDoc = new XmlDocument();

// The XML could be found in the Body of the HTTP POST

// which is accessed through the InputStream of the Request object

xmlDoc.Load(new System.IO.StreamReader(Request.InputStream));

 

// Parse the XML Document and Save it to your DB

// …

 

// Send the success code

Response.Write(“success”);

}

catch (Exception ex)

{

Response.Write(ex.ToString());

}

}

}

}

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk