Method PostSearchByAddress

Summary

Searches permits by Street Number, Street Name and Return Type

Remarks

This searches for open building permits by the street address. It will match any address that contains the street name.

Input Parameters

NameTypeLengthDescription
StreetName System.String 30 [Required] Match street names beginning with this name.
StreetNumber numeric 7 House or building number to search for.
StreetDirection System.String 2 2 digit code indicating street direction: N, S, E, W, NE, NW, SE, SW
StreetSuffix System.String 4 4 character street suffix. I.e. Bay, Dr, Lane, Rd, Way
ReturnType System.String 1 Default="O" BLANK(" ")=Both Open/Closed, O=Open Only, C=Closed

Example

POST http://localhost/FusionServices/v3/Naviline/Permit/Application/Search/ByAddress

Return Values

NameDescription
ApplicationYear Year permit application was submitted. This is the first part of the application number
ApplicationNumber Number assigned to the application.
StreetNumber Street address number
StreetDirectionCode 2 digit code indicating street direction: N,S,E,W,NE,NW,SE,SW
StreetName Street name portion of the address
StreetSuffix 4 character street suffix. I.e. Bay, Dr, Lane, Rd, Way
Name Name found for the application
NameTypeCode Indicates whose name was returned. AC=Alternate Contact AP=Applicant CT=Contractor OW=Owner PC=Primary Contact SC=Subcontractor. Other values may be defined.
ParcelCrossRef
ParcelNo1-10 Set of digits in the Parcel ID. I.e. 1111-222-33-444-5 up to 10 sets of numbers.
ApplicationTypeDesc Description for what type of permit application this is.
UserStatusCodeDesc Application status. Description is maintained by the city.

Sample Responses

Sample Code

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

public void MethodName(parms){
   string uri = "http://localhost/FusionServices/v3/Naviline/Permit/Application/Search/ByAddress";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("streetName",System.Web.HttpUtility.UrlEncode("Ma"));

   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")
   {
       // 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 PostSearchByAddress
   {
       // 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 StreetName{get; set;}

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

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

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

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

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

@{
   ViewBag.Title = "PostSearchByAddress";
}

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

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

// 
// POST: /MyController/PostSearchByAddress
[HttpPost]
public ActionResult PostSearchByAddress(FormCollection collection)
{
   string url = "v3/Naviline/Permit/Application/Search/ByAddress";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("StreetName", collection["StreetName"]);
   inputParms.Add("StreetNumber", collection["StreetNumber"]);
   inputParms.Add("StreetDirection", collection["StreetDirection"]);
   inputParms.Add("StreetSuffix", collection["StreetSuffix"]);
   inputParms.Add("ReturnType", collection["ReturnType"]);

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