Follow

ListParameters - C#

Last updated 2017-08-15 13:45:42 UTC

// DocumentNOW V2 ListParameters example
// assuming we set the namespace on the service proxy to DocNow ...

// force TLS 1.2 if .net < 4.6
ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

Guid accountContextID = new Guid(<fromYourAccount>);
Guid templateId = new Guid(<fromYourAccount>);

DocNow.ListParametersServiceClient client = new DocNow.ListParametersServiceClient();
DocNow.ParameterListQuery query = new DocNow.ParameterListQuery();
query.ContextIdentifier = accountContextID;
query.TemplateId = templateId;
query.UserName = "yourusername@yourdomain.com";

DocNow.ParameterListQueryResult result = client.ListParameters(query);

if(result.Exceptions != null)
{
    StringBuilder sb = new StringBuilder();
    foreach (AssureSign.ParameterListException exception in result.Exceptions)
    {
        sb.AppendFormat("{0}{1} : {2}", Environment.NewLine, exception.Severity.ToString(), exception.Value);
    }
    throw new Exception($"Errors occurred calling ListTemplateParameters:{sb.ToString()}");
}
else
{
    foreach (DocNow.TypedParameterItem item in result.Templates)
    {
	    Console.WriteLine($"{item.Name} : {item.Prompt} : {item.Required} : {item.Tag} : {item.Regex} : {item.ValidationMessage}");
    }
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.