Open alexmac05 opened 6 years ago
This is a workaround using the RestSharp request library:
static void RestsharpSignatureRequestAttachments(string apiKey)
{
var key = apiKey;
var httpClient = new RestClient("https://:@api.hellosign.com/v3");
httpClient.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(key, "");
var request = new RestRequest("signature_request/create_embedded");
request.AddParameter("title", "Our agreement");
request.AddFile("testing", "testing.pdf");
string prefix = String.Format("signers[{0}]", "0");
request.AddParameter(prefix + "[email_address]", "james@example.com");
request.AddParameter(prefix + "[name]", "James");
string attachments_prefix = String.Format("attachments[{0}]", "0");
request.AddParameter(attachments_prefix + "[name]", "Driver's License");
request.AddParameter(attachments_prefix + "[instructions]", "Must not be expired");
request.AddParameter(attachments_prefix + "[signer_index]", 0);
request.AddParameter(attachments_prefix + "[required]", true);
IRestResponse response = httpClient.Execute(request);
var content = response.Content;
Console.WriteLine(content);
}
Add attachment parameters when sending a signature request