Web Services - Ws - GetPDocPageClassificationNc

9/6/2019


Sample C# code to use the web service:

private const string myUserName="myemail@mydomain.com";
private const string myPassword = "password";
string myUrlPrefix = "https://documentvacuum.com/";

public ActionResult GetPDocPageClassificationNc()
{
   string version = "0";
   int pDocId = 1681; //make sure this is a valid PDocId running in normal/ref mode
   //no support for entityId based call
   string myUrlSuffix = "api/PDocPageClassificationNcApi/GetPDocPageClassification?version=" + version +
       "&id=" + pDocId +
       "&identityColumn=PDocId";
   string myUrl = myUrlPrefix + myUrlSuffix;

var buffer = System.Text.Encoding.ASCII.GetBytes(myUserName + ":" +myPassword);
   var authHeader = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic",
       ConvertToBase64String(buffer));
   client.DefaultRequestHeaders.Authorization = authHeader;
   client.DefaultRequestHeaders.Accept.Add(new
       System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

try
{
   var task = client.GetAsync(myUrl);
   HttpStatusCode statusCode = task.Result.StatusCode;
   var output = taskResult.Content.ReadAsStringAsync().Result;

   if (statusCode == HttpStatusCode.OK)
   {
       string outcome = "Success";
       List<PDocPageClassificationNc> pdpcNcList =
       Newtonsoft.Json.JsonConvert.DeserializeObject<List<PDocPageClassificationNc>>(output);
   }

   else if (statusCode == HttpStatusCode.Unauthorized)
   {
       string outcome = "Bad login credentials or insufficient account permissions";
   }

else if (statusCode == HttpStatusCode.InternalServerError)
   {
       string outcome = "Something else went wrong";
   }
}
catch (Exception e)

{
   string s = e.Message;
   }
   return RedirectToAction("Index");
}


Other articles:
Billing - DocVacBasic & DocVacGold
Web Services - Ws - GetPDocPageClassificationNc
Web Services - Usage Charges
Postman
Web Services - Class - PDocDetailNc
Web Services - Class - PDocPageNc
Web Services - Class - PDocRowClassificationNc
Web Services - Class - PDocRowXmlNc
Web Services - Class - PdrxDataTypeNc
Web Services - Class - PdrxstnMappingNc
more