Skip to main content
Nintex Community Menu Bar

GetAccessLink - C#

  • January 11, 2022
  • 0 replies
  • 14 views
  • Translate

butlerj
Nintex Employee
Forum|alt.badge.img+20
// DocumentNOW V2 GetAccessLink 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.LinkServiceClient linker = new DocNow.LinkServiceClient("BasicHttpBinding_ILinkService"); DocNow.GetAccessLinkRequest linkrequest = new DocNow.GetAccessLinkRequest();  linkrequest.DocumentId = documentID;             linkrequest.DocumentAuthToken = authToken; linkrequest.ContextIdentifier = accountContextID; // quirk of .net proxy, we are setting this to true to indicate we are NOT passing an envelopeID, but a documentID is present           linkrequest.DocumentIdSpecified = true;              // ditto linkrequest.DocumentAuthTokenSpecified = true;       // this is expiration we would like to set on the life of this link, NOT the document linkrequest.LinkExpirationDate = DateTime.Today.AddHours(24);    linkrequest.LinkExpirationDateSpecified = true;   linkrequest.DocumentType = DocNow.LinkDocumentType.Completed;  DocNow.GetAccessLinkResult linksresult = linker.GetAccessLink(linkrequest);  if (linksresult.Exceptions != null) {     StringBuilder sb = new StringBuilder();     foreach (DocNow.LinkException exception in linksresult.Exceptions)     {         sb.AppendFormat("{0} : {1}{2}", exception.Severity.ToString(), exception.Value, Environment.NewLine);     }     Console.WriteLine(sb.ToString()); } else {     Console.WriteLine(linksresult.Link.Url); }
Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings