Method PostSearchLicenseByRequirements

Summary

Search Licenses by Additional Requirements

Remarks

For paging, send the License year, number, and document number from the last record returned to continue searching.

Input Parameters

NameTypeLengthDescription
addlReqmtCode System.String 7 [Required] Additional Requirement Code
AddlReqmtDocNum System.String 15 Document number
Classification System.String 7 License classification code
rows numeric 4 Number of rows to return by the search. Default is 8.
lastLicYear numeric 2 License Year of last record returned. Used with paging.
lastLicNum numeric 8 License Number of last record returned. Used with paging.
lastDocNum System.String 15 Document Number of last record returned. Used with paging.

Example

POST http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseRequirements

Return Values

NameDescription
ErrorCode 0000=Success
ErrorMessage Message returned with error code
ControlNumber
LicenseYear License Year
LicenseNumber License Number
LicenseClassCode License classification code
LicenseClassDescription Classification description
IssueDate Issue date. Format=MMddyyyy
LicenseStatus License status
LicenseStatusDescription Status description
RenewThruDate License renew Thru date. Format=MMddyyyy
LicenseOpenPeriodFlag License Open Period Flag
AdditionalReqmtCode Requirement code
AdditionalReqmtDocNumber Document number
AdditionalReqmtDescription Requirement description
TagCode Tag code
TagNumber Title number
TagText Tag Text
TagDescription Tag description
InternetUseFlag Internet Use Flag
MOREYN More Rows available Y/N
ROWS Row count returned

Sample Responses

Sample Code

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

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseRequirements";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("addlReqmtCode",System.Web.HttpUtility.UrlEncode("HEALTH"));

   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 ControlNumber = row["ControlNumber"].ToString();
             string LicenseYear = row["LicenseYear"].ToString();
             string LicenseNumber = row["LicenseNumber"].ToString();
             string LicenseClassCode = row["LicenseClassCode"].ToString();
             string LicenseClassDescription = row["LicenseClassDescription"].ToString();
             string IssueDate = row["IssueDate"].ToString();
             string LicenseStatus = row["LicenseStatus"].ToString();
             string LicenseStatusDescription = row["LicenseStatusDescription"].ToString();
             string RenewThruDate = row["RenewThruDate"].ToString();
             string LicenseOpenPeriodFlag = row["LicenseOpenPeriodFlag"].ToString();
             string AdditionalReqmtCode = row["AdditionalReqmtCode"].ToString();
             string AdditionalReqmtDocNumber = row["AdditionalReqmtDocNumber"].ToString();
             string AdditionalReqmtDescription = row["AdditionalReqmtDescription"].ToString();
             string TagCode = row["TagCode"].ToString();
             string TagNumber = row["TagNumber"].ToString();
             string TagText = row["TagText"].ToString();
             string TagDescription = row["TagDescription"].ToString();
             string InternetUseFlag = row["InternetUseFlag"].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 PostSearchLicenseByRequirements
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,7}$).*", ErrorMessage = "Must be 7 characters or less. ")]
       public string addlReqmtCode{get; set;}

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

       [RegularExpression("^(?=.{0,7}$).*", ErrorMessage = "Must be 7 characters or less. ")]
       public string Classification{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,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
       public string lastLicYear{get; set;}

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

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

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

@{
   ViewBag.Title = "PostSearchLicenseByRequirements";
}

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

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

// 
// POST: /MyController/PostSearchLicenseByRequirements
[HttpPost]
public ActionResult PostSearchLicenseByRequirements(FormCollection collection)
{
   string url = "v2/Naviline/OccupationalLicense/LicenseRequirements";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("addlReqmtCode", collection["addlReqmtCode"]);
   inputParms.Add("AddlReqmtDocNum", collection["AddlReqmtDocNum"]);
   inputParms.Add("Classification", collection["Classification"]);
   inputParms.Add("rows", collection["rows"]);
   inputParms.Add("lastLicYear", collection["lastLicYear"]);
   inputParms.Add("lastLicNum", collection["lastLicNum"]);
   inputParms.Add("lastDocNum", collection["lastDocNum"]);

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