Method GetBusinessByOwnerName

Summary

Get Business by Owner Name

Remarks

Search for business by owner name

Input Parameters

NameTypeLengthDescription
ownerName System.String 30 Owner Name

Example

GET http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByOwnerName/{ownerName}

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/BusinessByOwnerName/boyd";
    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/BusinessByOwnerName/boyd', 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 GetBusinessByOwnerName
   {
       // Add property for each input param in order to map a field to it
       [RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
       public string ownerName{get; set;}

       public GetBusinessByOwnerName()
       {
           //Set any defaults here
           ownerName = DefaultData.Get("ownerName");
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetBusinessByOwnerName 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.GetBusinessByOwnerName

@{
   ViewBag.Title = "GetBusinessByOwnerName";
   string myUrl = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/BusinessByOwnerName/" + Model.ownerName;
}

<h2>GetBusinessByOwnerName</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>GetBusinessByOwnerName</legend>
       <div class="editor-label">Use the fields below to change the values and resubmit.</div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerName)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerName)
           @Html.ValidationMessageFor(model => model.ownerName)
       </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/GetBusinessByOwnerName
public ActionResult GetBusinessByOwnerName()
{
   // Create a new instance of the model to pick up any default values.
   GetBusinessByOwnerName model =  new GetBusinessByOwnerName();

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

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

   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", "GetBusinessByOwnerName");
       return View("Error", info);
   }
}