Lead Validation C# Rest Code Snippet

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ContactInternational response = null;
//In the event that a production key is purchased, the primary url should point to sws.serviceobjects.com and the backupURL should be pointing to swsbackup.serviceobjects.com
try
{
string primaryURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text;
string backupURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text;
try
{
//Make Call to primary URL
response = httpGet(primaryURL);
if (response == null || (response.Error != null && response.Error.TypeCode == "3"))
{
throw new Exception();
}
}
catch
{
response = httpGet(backupURL);
}
catch (Exception ex)
{
//Deal with Errors Appropriately
}
ContactInternational response = null; //In the event that a production key is purchased, the primary url should point to sws.serviceobjects.com and the backupURL should be pointing to swsbackup.serviceobjects.com try { string primaryURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text; string backupURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text; try { //Make Call to primary URL response = httpGet(primaryURL); if (response == null || (response.Error != null && response.Error.TypeCode == "3")) { throw new Exception(); } } catch { response = httpGet(backupURL); } catch (Exception ex) { //Deal with Errors Appropriately }
ContactInternational response = null;
//In the event that a production key is purchased, the primary url should point to sws.serviceobjects.com and the backupURL should be pointing to swsbackup.serviceobjects.com
try
{
    string primaryURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text;
    string backupURL = "https://trial.serviceobjects.com/lv/api.svc/XML/ValidateLead_V3?FullName=" + FullName.Text + "&Salutation=" + Salutation.Text + "&FirstName=" + FirstName.Text + "&LastName=" + LastName.Text + "&BusinessName=" + BusinessName.Text + "&BusinessDomain=" + BusinessDomain.Text + "&BusinessEIN=" + BusinessEIN.Text + "&Address1=" + Address1.Text + "&Address2=" + Address2.Text + "&Address3=" + Address3.Text + "&Address4=" + Address4.Text + "&Address5=" + Address5 + "&Locality=" + Locality.Text + "&AdminArea=" + AdminArea.Text + "&PostalCode=" + PostalCode.Text + "&Country=" + Country.Text + "&Phone1=" + Phone1.Text + "&Phone2=" + Phone2.Text + "&Email=" + Email.Text + "&IPAddress=" + IPAddress.Text + "&Gender=" + Gender.Text + "&DateOfBirth=" + DateOfBirth.Text + "&UTCCaptureTime=" + UTCCaptureTime.Text + "&OutputLanguage=" + OutputLanguage.Text + "&TestType=" + TestType.Text + "&LicenseKey=" + LicenseKey.Text;
    try
    {
        //Make Call to primary URL
        response = httpGet(primaryURL);
        if (response == null || (response.Error != null && response.Error.TypeCode == "3"))
        {
            throw new Exception();
        }
    }
    catch
    {
        response = httpGet(backupURL);
    }
catch (Exception ex)
{
    //Deal with Errors Appropriately
}

Lead Validation Java Rest Code Snippet

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ContactInternational Response = null;
String Request = TrialURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey;
String BackupRequest = FailoverURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey;
try {
Response = DoHttpRequest(Request);
if (Response == null ||(Response.getError() != null && Response.getError().getTypeCode().equals("3")))
{
throw new Exception();
}
} catch (Exception e) {
// TODO Auto-generated catch block
Response = DoHttpRequest(BackupRequest);
e.printStackTrace();
}
ContactInternational Response = null; String Request = TrialURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey; String BackupRequest = FailoverURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey; try { Response = DoHttpRequest(Request); if (Response == null ||(Response.getError() != null && Response.getError().getTypeCode().equals("3"))) { throw new Exception(); } } catch (Exception e) { // TODO Auto-generated catch block Response = DoHttpRequest(BackupRequest); e.printStackTrace(); }
ContactInternational Response = null;
String Request = TrialURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey;
String BackupRequest = FailoverURL + "FullName=" + FullName +"&Salutation=" + Salutation +"&FirstName=" + FirstName +"&LastName=" + LastName +"&BusinessName=" + BusinessName +"&BusinessDomain=" + BusinessDomain +"&BusinessEIN=" + BusinessEIN +"&Address1=" + Address1 +"&Address2=" + Address2 +"&Address3=" + Address3 +"&Address4=" + Address4 +"&Address5=" + Address5 +"&Locality=" + Locality +"&AdminArea=" + AdminArea +"&PostalCode=" + PostalCode +"&Country=" + Country +"&Phone1=" + Phone1 +"&Phone2=" + Phone2 +"&Email=" + Email +"&IPAddress=" + IPAddress +"&Gender=" + Gender +"&DateOfBirth=" + DateOfBirth +"&UTCCaptureTime=" + UTCCaptureTime +"&OutputLanguage=" + OutputLanguage +"&TestType=" + TestType +"&LicenseKey=" + LicenseKey;
try {
      
    Response = DoHttpRequest(Request);
    if (Response == null ||(Response.getError() != null && Response.getError().getTypeCode().equals("3")))
    {
        throw new Exception();
    }
      
} catch (Exception e) {
    // TODO Auto-generated catch block
    Response = DoHttpRequest(BackupRequest);
    e.printStackTrace();
}