Code sample CreateInstantPosting - Visual Studio C#

<< Click to Display Table of Contents >>

Navigation:  Reference > Code samples >

Code sample CreateInstantPosting - Visual Studio C#

 

 

InstantSignatureServiceClient wsClient = new InstantSignatureServiceClient();
 
InstantPosting post = new InstantPosting();
 
List<InstantPostingRecipient> aRecipients = new List<InstantPostingRecipient>();
 
aRecipients.Add(new InstantPostingRecipient { Name = "Firstname Lastname" });
 
post.Title = "This is the title of the posting";
 
post.AttachmentToSign = new Attachment { ActionType = ActionType.Sign, Description = "this is the description", File = OpenFile(txtFilePath.Text), FileName = @"somefile.pdf" };
 
post.Recipients = aRecipients.ToArray();
post.UseWidget = true;
post.AfterSignAction = InstantPostingAfterSignAction.Redirect;
 
post.AfterSignRedirectCaption = "click here";
post.AfterSignRedirectDelay = 0;
post.AfterSignRedirectUrl = @"https://www.google.no";
post.DistributorSystemID = "DistributorSystemID";
post.CancelUrl = @"https://www.google.no";
post.Description = "this is the description"
 
var wsResult = wsClient.CreateInstantPosting("Contact Signant for DistributorID", "Contact Signant for AccessCode", post);
 
if (wsResult.Success)
 Response.Redirect(wsResult.SignUrls[0].Url, false);