GetDocumentValues - C#
Copy
// DocumentNOW V2 GetDocumentValues example
// force TLS 1.2 if .net < 4.6
ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
Guid accountContextID = new Guid(<fromYourAccount>);
Guid documentID = new Guid(<savedFromYourSubmission>);
Guid authToken = new Guid(<savedFromYourSubmission>);
// assuming we set the namespace on the service proxy to DocNow ...
DocNow.GetDocumentValuesServiceClient client = new DocNow.GetDocumentValuesServiceClient();
DocNow.DocumentValuesQuery query = new DocNow.DocumentValuesQuery();
query.Id = documentID;
query.AuthToken = authToken;
query.ContextIdentifier = accountContextID;
DocNow.DocumentValuesQueryResult result = client.GetDocumentValues(query);
if (result.Exceptions != null)
{
StringBuilder sb = new StringBuilder();
foreach (DocNow.DocumentValuesException exception in result.Exceptions)
{
sb.AppendFormat("{0} : {1}{2}", exception.Severity.ToString(), exception.Value, Environment.NewLine);
}
Console.WriteLine(sb.ToString());
}
else
{
// JotBlock values
foreach (DocNow.JotBlockInfo1 jb in result.DocumentValues.JotBlocks)
{
Console.WriteLine($"jotblock [{jb.Name}] = [{jb.Value}]");
}
// Template parameter values
foreach (DocNow.ParameterInfo1 parameters in result.DocumentValues.Parameters)
{
Console.WriteLine($"parameter [{parameters.Name}] = [{parameters.Value}]");
}
}