Method GetBusinessByName

Summary

Get Business by Name

Remarks

Search for all businesses starting with the given name. Search is not case sensitive

Input Parameters

NameTypeLengthDescription
businessName System.String 30 [Required] Business name to search on

Example

GET http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByName/{businessName}

Return Values

NameDescription
ErrorCode 0000=Success
ErrorMessage Message returned with error code
ControlNumber Business Control number
LocationNumber Location number for business
Name Business name
Address Business Address
CityStateZip Business City, ST Zip line
MailingAddressLine1 Mailing Address line 1
MailingAddressLine2 Mailing Address line 2
MailingCityStateZip Mailing City, ST Zip line
MailingDeliveryPoint Mailing City, ST Zip line
MainAreaCode Area Code on main phone number
MainPhoneNumber Main phone number
BusinessStatusCode Status code
BusinessStatusDescription Status description
OpenDate Date business was opened
ContractorFlag Contractor Y/N
OwnershipTypeCode Ownership Type code
OwnershipTypeDescription Ownership Type description
FedTaxID Federal Tax ID
OWNER Owner name
InternetUseFlag Available for online use
MOREYN More Rows Y/N
ROWS Row count returned
FirstBizControl First Business control number found
FirstLocID First Location ID found
LastBizControl Last Business control number found
LastLocID Last Location ID found

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
    string uri = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByName/britt";
    WebClient wc = new WebClient();
    wc.Headers.Set("X-APPID", "YOURID");
    wc.Headers.Set("X-APPKEY", "YOURKEY");
    string stringResult = wc.DownloadString(new Uri(uri));
    
    JObject response = JObject.Parse(stringResult);
    string error = response["OutputParms"]["ErrorCode"].ToString();
    if (error == "0000")
    {
        JArray jRows = (JArray)response["Rows"];
        foreach (JObject row in jRows)
        {
             string ControlNumber = row["ControlNumber"].ToString();
             string LocationNumber = row["LocationNumber"].ToString();
             string Name = row["Name"].ToString();
             string Address = row["Address"].ToString();
             string CityStateZip = row["CityStateZip"].ToString();
             string MailingAddressLine1 = row["MailingAddressLine1"].ToString();
             string MailingAddressLine2 = row["MailingAddressLine2"].ToString();
             string MailingCityStateZip = row["MailingCityStateZip"].ToString();
             string MailingDeliveryPoint = row["MailingDeliveryPoint"].ToString();
             string MainAreaCode = row["MainAreaCode"].ToString();
             string MainPhoneNumber = row["MainPhoneNumber"].ToString();
             string BusinessStatusCode = row["BusinessStatusCode"].ToString();
             string BusinessStatusDescription = row["BusinessStatusDescription"].ToString();
             string OpenDate = row["OpenDate"].ToString();
             string ContractorFlag = row["ContractorFlag"].ToString();
             string OwnershipTypeCode = row["OwnershipTypeCode"].ToString();
             string OwnershipTypeDescription = row["OwnershipTypeDescription"].ToString();
             string FedTaxID = row["FedTaxID"].ToString();
             string OWNER = row["OWNER"].ToString();
             string InternetUseFlag = row["InternetUseFlag"].ToString();
             // TODO - YOUR CODE HERE
        }
    }
}

$.get('http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByName/britt', function(response) {
    $('#resultDiv).html(response); 
 });

C# Razor MVC Sample Code

using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;

// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
   public class GetBusinessByName
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
       public string businessName{get; set;}

       public GetBusinessByName()
       {
           //Set any defaults here
           businessName = DefaultData.Get("businessName");
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetBusinessByName class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top.  Replace the rest with the lines below.
@model FusionRazor.Models.GetBusinessByName

@{
   ViewBag.Title = "GetBusinessByName";
   string myUrl = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByName/" + Model.businessName;
}

<h2>GetBusinessByName</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>GetBusinessByName</legend>
       <div class="editor-label">Use the fields below to change the values and resubmit.</div>
       <div class="editor-label">
           @Html.LabelFor(model => model.businessName)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.businessName)
           @Html.ValidationMessageFor(model => model.businessName)
       </div>
       <p>
       <input type="submit" value="Submit"/>
       </p>
   </fieldset>

}

@section Scripts {
   @Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;

// NOTE: Replace 'MyController' with the name of your controller.

// 
// GET: /MyController/GetBusinessByName
public ActionResult GetBusinessByName()
{
   // Create a new instance of the model to pick up any default values.
   GetBusinessByName model =  new GetBusinessByName();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/GetBusinessByName.cshtml", model);
}

// 
// POST: /MyController/GetBusinessByName
[HttpPost]
public ActionResult GetBusinessByName(FormCollection collection)
{
   string url = "v2/Naviline/OccupationalLicense/BusinessByName/{businessName}";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("businessName", collection["businessName"]);

   try
   {
       // Send the request
       FusionServiceRequest request = new FusionServiceRequest();
       FusionServiceResult result = request.Get(url, inputParms);

       return View("Result", result);
   }
   catch(Exception e)
   {
       HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "GetBusinessByName");
       return View("Error", info);
   }
}