Method PostSearchDescription

Summary

Search Projects by Description

Input Parameters

NameTypeLengthDescription
Description System.String 50 [Required] Project description
Year numeric 4 Project Year. 4 digit year

Example

POST http://localhost/FusionServices/v3/Naviline/PlanningEngineering/SearchDescription

Return Values

NameDescription
ErrorCode 0000=Success
ErrorMessage Message returned with error code
AddressFormatted Address
StreetName Street Name
StreetNumber Street Number
StreetDirection Street Direction
StreetSuffix Street Suffix
ZipCode ZipCode
ParcelFormatted formatted Parcel number
ParcelNumber01 Parcel Number section 01
ParcelNumber02 Parcel Number section 02
ParcelNumber03 Parcel Number section 03
ParcelNumber04 Parcel Number section 04
ParcelNumber05 Parcel Number section 05
ParcelNumber06 Parcel Number section 06
ParcelNumber07 Parcel Number section 07
ParcelNumber08 Parcel Number section 08
ParcelNumber09 Parcel Number section 09
ParcelNumber10 Parcel Number section 10
Year Year
Name Name
Description Description
NameType Name Type
DescriptionType Description Type
LocationID Location ID
ApplicationID Application ID
ControlNumber Control Number
TAPLCK0
TAPLCK2
TAPLCK3
TAPLCK6
TAPLCK7
TAPLCKC
TAPLCKF
LandKey01 Land Key section 01
LandKey02 Land Key section 02
LandKey03 Land Key section 03
LandKey04 Land Key section 04
LandKey05 Land Key section 05
LandKey06 Land Key section 06
LandKey07 Land Key section 07
LandKey08 Land Key section 08
LandKey09 Land Key section 09
LandKey10 Land Key section 10
PageNumber Page Number
Rows Rows
MoreYN More rows available? Y/N
LastLocationID Last Location ID returned. Pass this in to the then next call for paging.
LastApplicationID Last Application ID returned. Pass this in to the next call for paging.
TotalRows Total Rows returned
WErrorCode
WErrorMessage

Sample Responses

Sample Code

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

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/PlanningEngineering/SearchDescription";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("Description",System.Web.HttpUtility.UrlEncode("fus"));
   postParms.Add("Year",System.Web.HttpUtility.UrlEncode("16"));

   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 AddressFormatted = row["AddressFormatted"].ToString();
             string StreetName = row["StreetName"].ToString();
             string StreetNumber = row["StreetNumber"].ToString();
             string StreetDirection = row["StreetDirection"].ToString();
             string StreetSuffix = row["StreetSuffix"].ToString();
             string ZipCode = row["ZipCode"].ToString();
             string ParcelFormatted = row["ParcelFormatted"].ToString();
             string ParcelNumber01 = row["ParcelNumber01"].ToString();
             string ParcelNumber02 = row["ParcelNumber02"].ToString();
             string ParcelNumber03 = row["ParcelNumber03"].ToString();
             string ParcelNumber04 = row["ParcelNumber04"].ToString();
             string ParcelNumber05 = row["ParcelNumber05"].ToString();
             string ParcelNumber06 = row["ParcelNumber06"].ToString();
             string ParcelNumber07 = row["ParcelNumber07"].ToString();
             string ParcelNumber08 = row["ParcelNumber08"].ToString();
             string ParcelNumber09 = row["ParcelNumber09"].ToString();
             string ParcelNumber10 = row["ParcelNumber10"].ToString();
             string Year = row["Year"].ToString();
             string Name = row["Name"].ToString();
             string Description = row["Description"].ToString();
             string NameType = row["NameType"].ToString();
             string DescriptionType = row["DescriptionType"].ToString();
             string LocationID = row["LocationID"].ToString();
             string ApplicationID = row["ApplicationID"].ToString();
             string ControlNumber = row["ControlNumber"].ToString();
             string TAPLCK0 = row["TAPLCK0"].ToString();
             string TAPLCK2 = row["TAPLCK2"].ToString();
             string TAPLCK3 = row["TAPLCK3"].ToString();
             string TAPLCK6 = row["TAPLCK6"].ToString();
             string TAPLCK7 = row["TAPLCK7"].ToString();
             string TAPLCKC = row["TAPLCKC"].ToString();
             string TAPLCKF = row["TAPLCKF"].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 PostSearchDescription
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,50}$).*", ErrorMessage = "Must be 50 characters or less. ")]
       public string Description{get; set;}

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

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

@{
   ViewBag.Title = "PostSearchDescription";
}

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

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

// 
// POST: /MyController/PostSearchDescription
[HttpPost]
public ActionResult PostSearchDescription(FormCollection collection)
{
   string url = "v3/Naviline/PlanningEngineering/SearchDescription";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("Description", collection["Description"]);
   inputParms.Add("Year", collection["Year"]);

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