Get License Review
Name | Type | Length | Description |
---|---|---|---|
inspectionNumber | numeric | 9 | [Required] Inspection Number |
GET http://localhost/FusionServices/v3/Naviline/OccupationalLicense/LicenseReview/{inspectionNumber}
Name | Description |
---|---|
ErrorCode | 0000=Success |
ErrorMessage | Message returned with error code |
SequenceNumber | Sequence number for comments added to inspection |
SequenceComment | Comment added to inspection |
LicenseYear | License Year |
LicenseNumber | License Number |
Path | Inspection Path, used for prioritizing one set of inspectons over another |
Step | Step numer in Inspection Path |
AgencyCode | Agency Code |
AgencyName | Agency Name. The agency responsible for performing the inspection |
ResultDate | Result Date. Date inpsection was performed |
ResultCode | Result Code. Indicates inspection status. A=Approved, D=Disapproved, W=Waived, H=On Hold, Blank=Leave Open |
ResultDescription | Result Description. Inspection status: Approved,Disapproved, Waived, On Hold, Leave Open |
ROWS | Number of sequential comments returned |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/OccupationalLicense/LicenseReview/256";
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 SequenceNumber = row["SequenceNumber"].ToString();
string SequenceComment = row["SequenceComment"].ToString();
// TODO - YOUR CODE HERE
}
}
}
$.get('http://localhost/FusionServices/v3/Naviline/OccupationalLicense/LicenseReview/256', function(response) {
$('#resultDiv).html(response);
});
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 GetLicenseReview
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string inspectionNumber{get; set;}
public GetLicenseReview()
{
//Set any defaults here
inspectionNumber = DefaultData.Get("inspectionNumber");
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetLicenseReview 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.GetLicenseReview
@{
ViewBag.Title = "GetLicenseReview";
string myUrl = "http://localhost/FusionServices/v3/Naviline/OccupationalLicense/LicenseReview/" + Model.inspectionNumber;
}
<h2>GetLicenseReview</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>GetLicenseReview</legend>
<div class="editor-label">Use the fields below to change the values and resubmit.</div>
<div class="editor-label">
@Html.LabelFor(model => model.inspectionNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.inspectionNumber)
@Html.ValidationMessageFor(model => model.inspectionNumber)
</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/GetLicenseReview
public ActionResult GetLicenseReview()
{
// Create a new instance of the model to pick up any default values.
GetLicenseReview model = new GetLicenseReview();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/GetLicenseReview.cshtml", model);
}
//
// POST: /MyController/GetLicenseReview
[HttpPost]
public ActionResult GetLicenseReview(FormCollection collection)
{
string url = "v3/Naviline/OccupationalLicense/LicenseReview/{inspectionNumber}";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("inspectionNumber", collection["inspectionNumber"]);
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", "GetLicenseReview");
return View("Error", info);
}
}