Giter VIP home page Giter VIP logo

hellosign-dotnet-sdk's Introduction

⚠ This SDK has been deprecated ⚠

This SDK is now deprecated and will no longer receive feature updates or bug fixes. Security fixes will still be applied as needed.

The new Dropbox.Sign SDK can be found at hellosign/dropbox-sign-dotnet!

The new SDK and this legacy SDK are not backwards-compatible!

Please see here for a comprehensive migration guide.


HelloSign .NET SDK

Build status

An official library for using the HelloSign API written in C#.NET and powered by RestSharp.

Getting Help

  • Use the Issue Tracker to report bugs or missing functionality in this library.
  • Send an email to [email protected] to request help with our API or your account.

Installation

The HelloSign .NET SDK can be installed using the NuGet package manager, under the package name HelloSign (package details).

If you prefer not to use NuGet, you can download a ZIP archive containing the built .dll files from the Releases page, or clone this repository and build the project yourself (see "Build from Source" below).

Usage

First, use our namespace:

using HelloSign;

Create a client object:

// Using your account's API Key
var client = new Client("ACCOUNT API KEY HERE");

// Or, using an OAuth 2.0 Access Token:
var client = new Client();
client.UseOAuth2Authentication("OAUTH ACCESS TOKEN HERE");

Error Handling

Most methods will throw a relevant exception if something goes wrong. This includes when our server returns an error message documented here.

You should always be prepared to catch these exceptions and handle them appropriately. Refer to HelloSign/Exceptions.cs in this repository for information about the custom exception classes this library defines.

Warnings

Some API responses include one or more warnings if there was a non-fatal problem with your request. At any time, you may inspect the contents of client.Warnings (a List of HelloSign.Warning objects) and output them as you see fit.

Callback Event Parsing

If you're implementing a server that will receive callbacks from HelloSign, this library can parse the received JSON into a native object and perform the hash-based integrity check for you.

String eventJson = ...; // Get this string from the 'json' POST parameter in the HTTP request
Event myEvent = client.ParseEvent(eventJson);

// The Event object contains accessors for all related data.
Console.WriteLine("Received event with type: " + event.EventType);
SignatureRequest request = myEvent.SignatureRequest;

Injecting Custom Request Parameters

In cases where this SDK might not directly support specifying a particular API request parameter that needs to be passed, there is now a way to inject your own custom parameters into the request before the SDK performs it.

Client.AdditionalParameters is a Dictionary object you can add these extra keys and values to. These parameters will be injected into all following API calls made by the SDK until you remove them. Here's an example:

client.AdditionalParameters.Add("white_labeling_options", "{'primary_button_color':'#00b3e6'}");
var app = new ApiApp { Name = "Foo", Domain = "example.com" };
app = client.CreateApiApp(app)
client.AdditionalParameters.Remove("white_labeling_options");

Account Methods

Get your Account details

var account = client.GetAccount();
Console.WriteLine("My Account ID is: " + account.AccountId);

Update your Account Callback URL

var account = client.UpdateAccount(new Uri("https://example.com/hellosign.asp"));
Console.WriteLine("Now my Callback URL is: " + account.CallbackUrl);

Create a new Account

// Throws exception if account already exists
var account = client.CreateAccount("[email protected]");
Console.WriteLine("The new Account's ID is: " + account.AccountId);

Signature Request Methods

Send Signature Request using files (non-Embedded)

var request = new SignatureRequest();
request.Title = "NDA with Acme Co.";
request.Subject = "The NDA we talked about";
request.Message = "Please sign this NDA and then we can discuss more. Let me know if you have any questions.";
request.AddSigner("[email protected]", "Jack");
request.AddSigner("[email protected]", "Jill");
request.AddCc("[email protected]");
request.AddFile("c:\users\me\My Documents\nda.txt");
request.AddFile("c:\users\me\My Documents\AppendixA.txt");
request.Metadata.Add("custom_id", "1234");
request.Metadata.Add("custom_text", "NDA #9");
request.TestMode = true;
var response = client.SendSignatureRequest(request);
Console.WriteLine("New Signature Request ID: " + response.SignatureRequestId);

Note: You can optionally pass an API App client ID as a second parameter to SendSignatureRequest.

Send Signature Request using files and text tags with custom fields (non-Embedded)

This example uses custom fields and text tags, using the AdditionalParamaters.add method:

var request = new SignatureRequest();
request.Title = "Sokovia Accords as discussed";
request.Subject = "Sokovia Accords - Please Sign";
request.Message = "Please sign ASAP";
request.AddSigner("[email protected]", "Anthony Stark");
request.AddSigner("[email protected]", "Steven Rogers");
request.AddCc("[email protected]");
request.AddFile("sokovia_accords.PDF");
client.AdditionalParameters.Add("custom_fields", "[{\"name\": \"Address\", \"value\": \"123 Main Street\"}, {\"name\": \"Phone\", \"value\": \"555-5555\"}]");
request.UseTextTags = true;
request.HideTextTags = true;
request.TestMode = true;
var response = client.SendSignatureRequest(request);
Console.WriteLine("New Signature Request ID: " + response.SignatureRequestId);

Send Signature Request using files and form fields (non-Embedded)

var request = new SignatureRequest();
request.Title = "NDA with Acme Co.";
request.Subject = "The NDA we talked about";
request.Message = "Please sign this NDA and then we can discuss more. Let me know if you have any questions.";
request.AddSigner("[email protected]", "Jack");
request.AddFile("c:\users\me\My Documents\nda.pdf").WithFields(
    //            id      type                     page    x    y    w   h   req signer
    new FormField("chk1", FormField.TypeCheckbox,     1, 140,  72,  36, 36, true,     0),
    new FormField("txt1", FormField.TypeText,         1, 140, 144, 225, 20, true,     0),
    new FormField("dat1", FormField.TypeDateSigned,   1, 140, 216, 225, 52, true,     0),
    new FormField("sig1", FormField.TypeSignature,    1, 140, 288, 225, 52, true,     0),
);
request.TestMode = true;
var response = client.SendSignatureRequest(request);
Console.WriteLine("New Signature Request ID: " + response.SignatureRequestId);

Send Signature Request using a template (non-Embedded)

var request = new TemplateSignatureRequest();
request.AddTemplate("TEMPLATE ID HERE");
request.Subject = "Purchase Order";
request.Message = "Glad we could come to an agreement.";
request.AddSigner("Client", "[email protected]", "George");
request.AddCc("Accounting", "[email protected]");
request.AddCustomField("Cost", "$20,000");
request.TestMode = true;
var response = client.SendSignatureRequest(request);
Console.WriteLine("New Template Signature Request ID: " + response.SignatureRequestId);

Note: You can optionally pass an API App client ID as a second parameter to SendSignatureRequest.

Create Embedded Signature Request using files

var request = new SignatureRequest();
request.Title = "NDA with Acme Co.";
request.Subject = "The NDA we talked about";
request.Message = "Please sign this NDA and then we can discuss more. Let me know if you have any questions.";
request.AddSigner("[email protected]", "Jack");
request.AddSigner("[email protected]", "Jill");
request.AddCc("[email protected]");
request.AddFile("c:\users\me\My Documents\nda.txt");
request.AddFile("c:\users\me\My Documents\AppendixA.txt");
request.Metadata.Add("custom_id", "1234");
request.Metadata.Add("custom_text", "NDA #9");
request.TestMode = true;
var response = client.CreateEmbeddedSignatureRequest(request, "CLIENT ID HERE");
Console.WriteLine("New Embedded Signature Request ID: " + response.SignatureRequestId);

Create Embedded Signature Request using a template

var request = new TemplateSignatureRequest();
request.AddTemplate("TEMPLATE ID HERE");
request.Subject = "Purchase Order";
request.Message = "Glad we could come to an agreement.";
request.AddSigner("Client", "[email protected]", "George");
request.AddCc("Accounting", "[email protected]");
request.AddCustomField("Cost", "$20,000");
request.TestMode = true;
var response = client.CreateEmbeddedSignatureRequest(request, "CLIENT ID HERE");
Console.WriteLine("New Template-based Embedded Signature Request ID: " + response.SignatureRequestId);

Get info about an existing Signature Request

var request = client.GetSignatureRequest("SIGNATURE REQUEST ID HERE");
Console.WriteLine("Signature Request title: " + request.Title);

List Signature Requests

var allRequests = client.ListSignatureRequests();
Console.WriteLine("Found this many signature requests: " + allRequests.NumResults);
foreach (var result in allRequests)
{
    Console.WriteLine("Signature request: " + result.SignatureRequestId);

    if (result.IsComplete) == true)
    {
        Console.WriteLine("Signature request is complete.");
    }
    else
    {
        Console.WriteLine("Signature request is not complete");
    }
}

If you want to add an additional filter for account_id, you can add this line:

client.AdditionalParameters.Add("account_id", "ACCOUNT_ID_HERE");

Cancel a Signature Request

client.CancelSignatureRequest("SIGNATURE REQUEST ID HERE");

Remind a Signer to Sign

client.RemindSignatureRequest("SIGNATURE REQUEST ID HERE", "EMAIL ADDRESS HERE");

Update a Signature Request

client.UpdateSignatureRequest("SIGNATURE REQUEST ID HERE", "SIGNATURE ID HERE", "NEW EMAIL ADDRESS HERE");

Download a Signature Request (in its current state) and save to disk

// Download a merged PDF
client.DownloadSignatureRequestFiles("SIGNATURE REQUEST ID HERE", "/path/to/output.pdf");
// Or download a ZIP containing individual unmerged PDFs
client.DownloadSignatureRequestFiles("SIGNATURE REQUEST ID HERE", "/path/to/output.pdf", SignatureRequest.FileType.ZIP);

Download a Signature Request (in its current state) as bytes

// Download a merged PDF
var bytes = client.DownloadSignatureRequestFiles("SIGNATURE REQUEST ID HERE");
// Or download a ZIP containing individual unmerged PDFs
var bytes = client.DownloadSignatureRequestFiles("SIGNATURE REQUEST ID HERE", SignatureRequest.FileType.ZIP);

Get a temporary URL to download a Signature Request

var url = client.GetSignatureRequestDownloadUrl("SIGNATURE REQUEST ID HERE");
Console.WriteLine("The download URL is: " + url.FileUrl);
Console.WriteLine("The URL expires at: " + url.ExpiresAt);

Release an On-Hold Signature Request

client.ReleaseSignatureRequest("SIGNATURE REQUEST ID HERE");

Embedded Methods

Retrieve Embedded Signing URL for a particular signer

var response = client.GetSignUrl("SIGNATURE ID HERE");
Console.WriteLine("Signature URL for HelloSign.open(): " + response.SignUrl);

Retrieve Embedded Templates Editing URL

var response = client.GetEditUrl("EMBEDDED TEMPLATE ID HERE");
Console.WriteLine("Editing URL for HelloSign.open(): " + response.EditUrl);

Unclaimed Draft Methods (for Embedded Requesting)

Create Unclaimed Draft with a file (non-Embedded)

var draft = new SignatureRequest();
draft.AddFile("DOCUMENT 1.pdf");
draft.AddFile("LEASE.pdf");
draft.TestMode = true;
draft.AllowDecline = true;
var response = client.CreateUnclaimedDraft(draft, UnclaimedDraft.Type.SendDocument);
Console.WriteLine("Unclaimed Draft Signature Request ID: " + response.SignatureRequestId);
Console.WriteLine("Claim URL: " + response.ClaimUrl);

Create Embedded Unclaimed Draft with a file

var draft = new SignatureRequest();
draft.AddFile("DOCUMENT A.pdf");
draft.RequesterEmailAddress = "EMAIL HERE";
draft.TestMode = true;
var response = client.CreateUnclaimedDraft(draft, myClientId);
Console.WriteLine("Embedded Unclaimed Draft Signature Request ID: " + response.SignatureRequestId);
Console.WriteLine("Claim URL: " + response.ClaimUrl);

Create Embedded Unclaimed Draft with a template

var request = new TemplateSignatureRequest();
request.AddTemplate("TEMPLATE ID HERE");
request.RequesterEmailAddress = "REQUESTER EMAIL HERE";
request.TestMode = true;
request.AddSigner("Client", "CLIENT EMAIL", "CLIENT NAME");
request.AddSigner("Witness", "WITNESS EMAIL", "WITNESS NAME");
var response = client.CreateUnclaimedDraft(request, myClientId);
Console.WriteLine("Embedded Unclaimed Draft w/ Template, Signature Request ID: " + response.SignatureRequestId);
Console.WriteLine("Claim URL: " + response.ClaimUrl);

Edit & resend Unclaimed Draft

Not implemented

Template Methods

Get Template details

var template = client.GetTemplate("TEMPLATE ID HERE");

Add an Account to a Template

var template = client.AddAccountToTemplate("TEMPLATE ID HERE", "ACCOUNT ID HERE");
// Or...
var template = client.AddAccountToTemplate("TEMPLATE ID HERE", null, "EMAIL ADDRESS HERE");

Remove an Account from a Template

var template = client.RemoveAccountFromTemplate("TEMPLATE ID HERE", "ACCOUNT ID HERE");
// Or...
var template = client.RemoveAccountFromTemplate("TEMPLATE ID HERE", null, "EMAIL ADDRESS HERE");

Download a Template as a PDF and save to disk

client.DownloadTemplateFiles("TEMPLATE ID HERE", "/path/to/output.pdf");

Download a Template as a PDF, as bytes

var bytes = client.DownloadTemplateFiles("TEMPLATE ID HERE");

Get a temporary URL to download a Template's files

var url = client.GetTemplateFilesDownloadUrl("TEMPLATE ID HERE");
Console.WriteLine("The download URL is: " + url.FileUrl);
Console.WriteLine("The URL expires at: " + url.ExpiresAt);

Delete a Template

client.DeleteTemplate("TEMPLATE ID HERE");

Create a new Embedded Template Draft

var draft = new EmbeddedTemplateDraft();
draft.TestMode = true;
draft.AddFile(file1, "NDA.txt");
draft.Title = "Test Template";
draft.Subject = "Please sign this document";
draft.Message = "For your approval.";
draft.AddSignerRole("Client", 0);
draft.AddSignerRole("Witness", 1);
draft.AddCcRole("Manager");
draft.AddMergeField("Full Name", MergeField.FieldType.Text);
draft.AddMergeField("Is Registered?", MergeField.FieldType.Checkbox);
var response = client.CreateEmbeddedTemplateDraft(draft, "CLIENT ID HERE");

Reports Methods

var reportRequest = new Report();
reportRequest.StartDate = DateTime.Now.AddYears(-1);
reportRequest.EndDate = DateTime.Now;
reportRequest.ReportType = "user_activity, document_status";
var reportResponse = client.CreateReport(reportRequest);
Console.WriteLine($"Status for Report ({reportResponse.ReportType}) between {reportResponse.StartDate} - {reportResponse.EndDate}: {reportResponse.Success}");

Team Methods

Get your Team details

var team = client.GetTeam();

Create a new Team

var team = client.CreateTeam("NAME HERE");

Update your Team name

var team = client.UpdateTeamName("NAME HERE");

Delete your Team

var team = client.DeleteTeam();

Add a member to your Team

var team = client.AddMemberToTeam("ACCOUNT ID HERE");
// Or...
var team = client.AddMemberToTeam(null, "EMAIL ADDRESS HERE");

Remove a member from your Team

var team = client.RemoveMemberFromTeam("ACCOUNT ID HERE");
// Or...
var team = client.RemoveMemberFromTeam(null, "EMAIL ADDRESS HERE");

App Methods

Get information about an API app

var app = client.GetApiApp(client_id);
Console.WriteLine("API APP: " + app.ClientId);
Console.WriteLine("This app is approved: " + app.IsApproved);
Console.WriteLine("This app has callback URL: " + app.CallbackUrl);

List all API apps

var apiApps = client.ListApiApps();
Console.WriteLine("Found this many API apps: " + apiApps.NumResults);
foreach (var result in apiApps)
    {
        Console.WriteLine("API app: " + result.Name + " (" + result.ClientId + ")");
    }

Create a new API app

var capp = new ApiApp();
capp.Name = "App for Production";
capp.Domain = "yourwebsite.com";
var cresponse = client.CreateApiApp(capp);
Console.WriteLine("This API app was just created: " + cresponse.ClientId);
Console.WriteLine("App name: " + cresponse.Name);

Delete an API app

client.DeleteApiApp("CLIENT_ID_HERE");
Console.WriteLine("API app was just deleted!");

Build from Source

Windows

Use Visual Studio (Express) 2017 or newer.

Linux (and OSX?) using DotNet SDK + Mono

To create Debug builds for both the library (HelloSign.dll) and the test application (HelloSignTestApp.dll), run:

dotnet build

Or, to create Release builds:

dotnet build -c Release

Note: The .NET Framework build target will not be used when running this on a non-Windows system. Only .NET Standard 2.0 artifacts will be created.

Packaging for NuGet

  1. cd HelloSign
  2. nuget pack HelloSign.csproj -Prop Configuration=Release

License

The MIT License (MIT)

Copyright (C) 2015 hellosign.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

hellosign-dotnet-sdk's People

Contributors

alexmac05 avatar angelafield avatar bhspitmonkey avatar collinwheeler avatar durgeshpatel-hs avatar erkkinen avatar expoe-codebuild avatar freddyrangel avatar janetanne avatar jspaetzel avatar jtreminio-dropbox avatar mattoosterbaan avatar shuyck avatar tappcontributor avatar thatquan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hellosign-dotnet-sdk's Issues

Add support for FormFields

If you're using embedded templates and offering merge_fields, the only way to see which merge_fields the sender actually chose to include is to extract the form_fields from the template object.

I need to change the custom branding in c# SDK

Using Embedded Signing, I am creating a template programatically. I dont see any option to update or add custom branding. Is there a method missing? or am I missing something. Please tell me how to change custom logo.
Thanks

Update HelloSign.nuspec with actual range of allowed dependencies

You currently have just a single version number for your dependencies (Newtonsoft.Json and RestSharp). This forces versions of these dependencies to be at least that version. Instead you should specify the range of allowed versions e.g. "". We are using HelloSign 0.5.5. with Newtonsoft.Json version 6.0.3 without problems but we have to go through a big pain to make sure nuget doesn't try to replace our Newtonsoft.Json with a more recent version which breaks other dependencies.

Unclaimed Draft response object missing signatureRequestID

The UnclaimedDraft response object is missing the signatureRequestId parameter in the C# SDK.
https://app.hellosign.com/api/reference#UnclaimedDraft

var request = new SignatureRequest();
request.AddFile(@"/Users/userid/NDA.pdf");
request.TestMode = true;
var response = client.CreateUnclaimedDraft(request, UnclaimedDraft.Type.SendDocument);
// Console.WriteLine(response.SignatureRequestId);

Workarounds while this issue is open:

  1. use http://restsharp.org/ instead of this SDK
  2. Listen for the server side callbacks to get the signatureRequestID

Signature class is missing Error property

The HelloSign .net SDK Signature class is missing the Error property - is it supposed to be the DeclineReason property instead of Error? I assume the text in the 'error' tag should be deserialized into the DeclineReason property?

The value from 'error' is not being deserialized into the object (probably due to the name mismatch).

Add ux_version parameter

ux_version is a new optional parameter that can be set to either 1 or 2 (integer). The following endpoints need a way of passing it:

  • GET /signature_request/[:signature_request_id]
  • GET /signature_request/list
  • POST /signature_request/send
  • POST /signature_request/send_with_template
  • POST /signature_request/create_embedded
  • POST /signature_request/create_embedded_with_template

Add support for Decline to Sign

The following changes have been made to the API:

  • There is a new parameter allow_decline for declining to sign signature requests
  • There is a new API status_code for declined requests
  • There is a new API variable is_declined on SignatureRequest objects
  • There is a new API variable decline_reason on Signature objects

Could not load type 'HelloSign.Client'

I have created a new MVC application targeting .Net 4.7.1 and added the HelloSign NuGet package v0.5.7. On running the application I get:

Could not load type 'HelloSign.Client' from assembly 'HelloSign, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Strongly name the assembly

RestSharp dependency needs to be updated to signed version.
Add .snk file and update .csproj file to sign.

Custom fields for text tags

I'm trying to use a text tag with a preset value

In the document I have
[text-merge|req|sender|client_name|client_name]

in the C# SDK I do not see an AddCustomField method on the SignatureRequest object like I do with TemplateSignatureRequest

Instead I'm adding the fields to the CustomFields List

request.CustomFields.Add(new CustomField { Name = "client_name", Value = "My Test", ApiId = "client_name" });

However the value is not rendered in the final document

Add in the C# SDK the required parameter for custom fields (Workaround from a customer documented here)

Add in the C# SDK the required parameter for custom fields (Workaround from a customer documented here)

For signature requests that send the request using a template:
v3/signature_request/send_with_template is one example

The API Supports making an editable custom field with a required requirement

This issue is to request the ability to add the required parameter to the SDK. This is only required if there is an editor.

Potential workaround provided by a customer:

List customFields = new List();
foreach (var entry in signatureRequest.CustomFields)
{
CustomFieldParam fld = new CustomFieldParam();
fld.name = entry.Name;
fld.value = entry.Value;
fld.editor = entry.Editor;
fld.required = entry.Required.ToString().ToLower();
customFields.Add(fld);
}
request.AddParameter("custom_fields",
JsonConvert.SerializeObject(customFields.ToArray()));

Perhaps there is a more elegant solution, but this got the customer to where they needed
to be.

Please add the get_url functionality for the GET files endpoint

For the
GET /signature_request/files/[:signature_request_id] endpoint under the section “Obtain a copy of the current documents specified by the signature_request_id parameter.”

There is an optional parameter “get_url”. That is the functionality that I would like, but I don’t think this version of the sdk supports it.

Target NETStandard

Greetings! I'm evaluating integrating Hellosign into a new solution. Are there plans to target NETStandard to support those of us running on .NET Core?

Allow setting client id for non-embedded signature requests

I need to be able to create signature requests where the user signs the document through your website, but the endpoint notified of any views/signs etc is an individual client app. Currently you can only get app callbacks by calling CreateEmbeddedSignatureRequest

Add Editable Merge Fields support

When updating the SDKs to include editable merge fields, please also update the SDK git repos README examples (if necessary) and the following in the API docs:

  • "Send with Template" endpoint example
  • "Send Embedded Signature Request with Template" endpoint example
  • Templates Walkthrough
  • Signature Request Walkthrough -> Using Templates

Add support for editing custom fields on the TemplateSignatureRequest

CHANGE FROM:
var request = new TemplateSignatureRequest();
request.AddTemplate(template_withBasicCustomFields);
request.Subject = "Template test";
request.Message = "Template message";
request.AddSigner("Client", "[email protected]", "George");
request.AddCustomField("newline", "$20,000");
request.TestMode = true;

CHANGE TO:
Being able to support the parameters Editor and Required also in Adding CustomField

like this, which was created using RestSharp (because the SDK does not support currently editor and required:

request.AddParameter("custom_fields", "[{"name":"newline", "value":"$20,000", "editor":"Client", "required":true}]");

CHANGE AREAS:
https://github.com/HelloFax/hellosign-dotnet-sdk/blob/v3/HelloSign/HelloSign.cs#L603
https://github.com/HelloFax/hellosign-dotnet-sdk/blob/v3/HelloSign/HelloSign.cs#L1238

Add in the C# SDK the editor parameter for custom fields (Workaround documented here)

Add in the C# SDK the editor parameter for custom fields (Workaround documented here)

For signature requests that send the request using a template:
v3/signature_request/send_with_template is one example

The API Supports making an editable custom field

https://faq.hellosign.com/hc/en-us/articles/216599897-How-do-I-use-Editable-Merge-Fields-aka-Custom-Fields-

in the case where there is only one signer.

This issue is to request the ability to add the editor parameter to the SDK. A workaround is to use RestSharp directly

example code:
`try
{
var hslogin = "your EMAIL ADDRESS";
var hspassword = "Your Password";
var apiKey = "API KEY";

var restClient = new RestClient();

string buildTheRequest = "https://" + apiKey + ":@api.hellosign.com";
Console.WriteLine(buildTheRequest);

restClient.BaseUrl = new Uri(buildTheRequest);
restClient.Authenticator = new HttpBasicAuthenticator(hslogin, hspassword);

var request = new RestRequest();
request.Resource = "v3/signature_request/send_with_template";
request.Method = Method.POST;
request.AddParameter("template_id", "TEMPLATE ID HERE");

request.AddParameter("title", "test");
request.AddParameter("message", "testing");
request.AddParameter("signers[Client][name]", "George");
request.AddParameter("signers[Client][email_address]", "[email protected]");

request.AddParameter("custom_fields", "[{"name":"fName","value":"alex","editor":"Client"}]");

request.AddParameter("test_mode", 1);

IRestResponse response = restClient.Execute(request);

Console.WriteLine(response.Content);

if (response.ErrorException != null)
{
const string message = "Error retrieving response. Check inner details for more info.";
var helloSignException = new ApplicationException(message, response.ErrorException);
throw helloSignException;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message, ex.InnerException.Message);
}

            }`

Add Document Model and Documents list to Template Model

The SDK does not include an implementation for the Document Model nor its corresponding Form Fields. Our company is evaluating purchasing a subscription to HelloSign. One of the features we are looking for is the ability to use Form Fields pulled from a Template object, but sent with varying PDFs. Similar to the scenario described on the developer site, Template Walkthroughs, titled, "Using Files and Form Fields"

Make merge fields optional for the create_embedded_template_draft

https://app.hellosign.com/api/reference#create_embedded_template_draft

The C# Sample code from the above endpoint if the following two lines are removed results in an exception.
Merge field is missing "name" parameter

If these lines are removed, the exception is thrown:
//draft.AddMergeField("Full Name", MergeField.FieldType.Text);
//draft.AddMergeField("Is Registered?", MergeField.FieldType.Checkbox);

Sample code from https://app.hellosign.com/api/reference#create_embedded_template_draft
var client = new Client("SIGN_IN_AND_CONFIRM_EMAIL_TO_SEE_YOUR_API_KEY_HERE");
var draft = new EmbeddedTemplateDraft();
draft.TestMode = true;
draft.AddFile(@"NDA.pdf");
draft.Title = "Test Template";
draft.Subject = "Please sign this document";
draft.Message = "For your approval.";
draft.AddSignerRole("Client");
draft.AddSignerRole("Witness");
draft.AddCcRole("Manager");
//draft.AddMergeField("Full Name", MergeField.FieldType.Text);
//draft.AddMergeField("Is Registered?", MergeField.FieldType.Checkbox);
var response = client.CreateEmbeddedTemplateDraft(draft, "clientID");

However, merge fields should be optional.

GetEmbeddedTemplateEditUrl with skipSignerRoles and skipSubjectMessage true

Hi,

HelloSignClient#getEmbeddedTemplateEditUrl(String templateId, boolean skipSignerRoles, boolean skipSubjectMessage) with both skipSignerRoles and skipSubjectMessage set to true doesn't seem to work.
Currently skipSignerRoles workes, but skipSubjectMessage not - if it set to true then step with SubjectMessage appears. Could you please fix it?

Thanks

Allow for multiple template IDs in C# SDK TemplateSignatureRequest

Does the C# SDK support passing in multiple Template IDs on the TemplateSignatureRequest object that you pass into CreateEmbeddedSignatureRequest?

It seems as though TemplateSignatureRequest.TemplateId is just a string.

If not, is there any other easy way to do this. I am doing everything right now using the C# SDK.

cannot connect

I have the api key installed and am using the demo I pulled off Git. I keep getting the following error:

{"No connection could be made because the target machine actively refused it 184.168.221.47:443"}

stack trace = at System.Net.HttpWebRequest.GetResponse()
at RestSharp.Http.GetRawResponse(HttpWebRequest request)
at RestSharp.Http.GetResponse(HttpWebRequest request)

Are there any plans to add async support?

The project I'm working on has a custom implementation using HttpClient and is all async. I'd like to switch over to this instead but without async support I can't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.