Method PostSearchByOwnerName

Summary

Search for Location by Owner Name

Input Parameters

NameTypeLengthDescription
ownerName System.String 30 Owner Name. Can be partial name.
mode System.String 1 Search mode. F=New Search, N=Continue Previous Search. Use N with paging.
rows numeric 4 Rows. Used for paging
firstRec numeric 4 First row number to return. Used for paging
lastRec numeric 4 Last row number to return. Used for paging

Example

POST http://localhost/FusionServices/v3/Naviline/CodeEnforcement/OwnerName/Search

Return Values

NameDescription
OwnerName Owner
StreetName Street name of the matching address returned
StreetDirection Street direction code. See GetStreetDirCodes
StreetSuffix Street suffix code. See GetStreetSuffixes
RTPDR
StreetNumber Street Number
RTPRQ
RTPSQ
ApartmentNumber Apartment number
StreetAddress Combined street address with name, number, direction, and suffix
LocationID Location ID number for address
ErrorCode 2004 = Records found, no more records to retrieve
ErrorMessage Message from search
ROWS Number of rows returned
FirstRecord First row returned
LastRecord Last row returned
MOREYN Y/N More records to return

Sample Responses

Sample Code

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

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/CodeEnforcement/OwnerName/Search";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("ownerName",System.Web.HttpUtility.UrlEncode("D"));
   postParms.Add("mode",System.Web.HttpUtility.UrlEncode("F"));
   postParms.Add("rows",System.Web.HttpUtility.UrlEncode(""));
   postParms.Add("firstRec",System.Web.HttpUtility.UrlEncode(""));
   postParms.Add("lastRec",System.Web.HttpUtility.UrlEncode(""));

   WebClient req = new WebClient();
   wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
   wc.Headers.Set("X-APPID", "YOURID");
   wc.Headers.Set("X-APPKEY", "YOURKEY");

   byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
   string stringResult = Encoding.UTF8.GetString(responseBytes); 
   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 OwnerName = row["OwnerName"].ToString();
             string StreetName = row["StreetName"].ToString();
             string StreetDirection = row["StreetDirection"].ToString();
             string StreetSuffix = row["StreetSuffix"].ToString();
             string RTPDR = row["RTPDR"].ToString();
             string StreetNumber = row["StreetNumber"].ToString();
             string RTPRQ = row["RTPRQ"].ToString();
             string RTPSQ = row["RTPSQ"].ToString();
             string ApartmentNumber = row["ApartmentNumber"].ToString();
             string StreetAddress = row["StreetAddress"].ToString();
             string LocationID = row["LocationID"].ToString();
             // TODO - YOUR CODE HERE
        }
   }
}

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 PostSearchByOwnerName
   {
       // 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;}

       [RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
       public string mode{get; set;}

       [RegularExpression("[0-9]{0,4}", ErrorMessage = "Numeric values only. Must be 4 digits or less. ")]
       public string rows{get; set;}

       [RegularExpression("[0-9]{0,4}", ErrorMessage = "Numeric values only. Must be 4 digits or less. ")]
       public string firstRec{get; set;}

       [RegularExpression("[0-9]{0,4}", ErrorMessage = "Numeric values only. Must be 4 digits or less. ")]
       public string lastRec{get; set;}

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

@{
   ViewBag.Title = "PostSearchByOwnerName";
}

<h2>PostSearchByOwnerName</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostSearchByOwnerName</legend>
       <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>
       <div class="editor-label">
           @Html.LabelFor(model => model.mode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mode)
           @Html.ValidationMessageFor(model => model.mode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.rows)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.rows)
           @Html.ValidationMessageFor(model => model.rows)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.firstRec)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.firstRec)
           @Html.ValidationMessageFor(model => model.firstRec)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.lastRec)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.lastRec)
           @Html.ValidationMessageFor(model => model.lastRec)
       </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/PostSearchByOwnerName
public ActionResult PostSearchByOwnerName()
{
   // Create a new instance of the model to pick up any default values.
   PostSearchByOwnerName model =  new PostSearchByOwnerName();

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

// 
// POST: /MyController/PostSearchByOwnerName
[HttpPost]
public ActionResult PostSearchByOwnerName(FormCollection collection)
{
   string url = "v3/Naviline/CodeEnforcement/OwnerName/Search";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("ownerName", collection["ownerName"]);
   inputParms.Add("mode", collection["mode"]);
   inputParms.Add("rows", collection["rows"]);
   inputParms.Add("firstRec", collection["firstRec"]);
   inputParms.Add("lastRec", collection["lastRec"]);

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

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