hellosign / hellosign-ruby-sdk Goto Github PK
View Code? Open in Web Editor NEWA Ruby SDK for HelloSign's API
License: MIT License
A Ruby SDK for HelloSign's API
License: MIT License
It would be nice to have the different Webhook event types defined as constants in this SDK.
Add the form_fields_per_document parameter to the #create_embedded_unclaimed_draft method
version: v3
mime_type is missing the assignment operator.
Here is the line.
https://github.com/BradWheel/hellosign-ruby-sdk/blob/v3/lib/hello_sign/client.rb#L228
Unclaimed Draft endpoints need to handle custom_fields correctly
Allow custom_fields parameter for sending signature requests using a local file, when using text tags
The Template::get_template_files method is currently missing support for the _ file_type_ and get_url parameters supported by the API.
This is preventing use of those options via the Ruby SDK.
Right now errors are fairly useless except as a development tool. It's formatted as a big unparsable string you can't really do anything with.
It would be ideal if errors could be parsed, like getting the response body, the request uri, and the status code.
The documentation in https://github.com/HelloFax/hellosign-ruby-sdk/blob/v3/lib/hello_sign/api/signature_request.rb is indecisive about whether custom_fields should be a Hash or an Array (search the file for custom_fields
) to see what I mean.
From using the API, the correct answer (this version) is a Hash.
We are using ROR to integrate with you guys, and it keeps on saying we are using the erroring:
App yourClientId does not exist
although i'm copying the exact one from the admin
I have followed this tutorial:
http://blog.hellosign.com/getting-started-with-hellosign-embedded-signing-with-ruby-on-rails-2/
and I'm using ngrok (that's why I have set up the app with ngrok)
Here is my code:
client = HelloSign::Client.new :api_key => 'API KEY'
client.create_embedded_signature_request(
:test_mode => 1,
:client_id => 'CLIENT ID',
:subject => 'Embedded signature request',
:message => 'Fill this in.',
:signers => [
{
:email_address => params[:email],
:name => params[:name]
}
],
files: [uploaded_file]
)
Thanks!
client = HelloSign::Client.new :api_key => 'SIGN_IN_AND_CREATE_API_KEY_FIRST', :client_id => 'cc91c61d00f8bb2ece1428035716b', :client_secret => '1d14434088507ffa390e6f5528465'
client.oauth_create_account :email_address => '[email protected]'
Should return a similar response:
{
"account": {
"account_id": "b4680b45053c7601ca1eee3b126eca6b2b0a0219",
"email_address": "[email protected]",
"callback_url": null,
"role_code": null
},
"oauth_data": {
"access_token": "NWNiOTMxOGFkOGVjMDhhNTAxZN2NkNjgxMjMwOWJiYTEzZTBmZGUzMjMThhMzYyMzc=",
"token_type": "Bearer",
"refresh_token": "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3",
"expires_in": 86400 // in seconds
}
}
Confirmed to only return the email address returned in the response shows the app owner's email address NOT the newly created OAuth account as expected.
This ruby gem did not work to get the signed document URL
I've scoured through the https://www.hellosign.com/api/reference website, but can't seem to find the ruby-specific documentation. It's clearly available (given the formatted comments) but I can't seem to see an easy way to view it without generating it myself.
Signature Request Get Files API supports get_url
parameter which returns URL to file instead of the file itself but it's impossible to pass this parameter to this method:
When running the create_embedded_signature_request method, the prepare(opts,key) method in client.rb is taking opts[:signers] and somehow converting it to a String. It's then attempting to run the each_with_index method on opts[key], which isn't available for a String.
Have had a report that a successful cancel of a signature request results in an exception due to the response being returned from HelloSign (no response).
Let's verify that this is indeed happening and fix it if so.
TypeError: no implicit conversion of Symbol into Integer
Need some help.
Please add requester_email_address parameter to the endpoint below. https://app.hellosign.com/api/reference#unclaimed_draft_edit_and_resend
Add attachment parameters when sending a signature request
If I try to create an Unclaimed Draft I get the error:
Message: {"error":{"error_msg":"Cannot specify form_fields_per_document unless you also specify signers","error_name":"bad_request"}}
Even though I am supplying the signers
parameter. Code below.
my_name = "My Name"
my_email = "[email protected]"
files = ["your_file.pdf"]
# The following will fail
# Error message: "Cannot specify form_fields_per_document unless you also specify signers"
unclaimed_draft = HelloSign.create_unclaimed_draft(
:test_mode => 1,
:type => 'send_document',
:files => files,
:form_fields_per_document => "[[{\"name\":\"\",\"type\":\"date_signed\",\"signer\":0,\"x\":224,\"y\":108,\"width\":105,\"height\":16,\"required\":true,\"api_id\":\"e1c525_9\"}]]",
:signers => [
{
:email_address => my_email,
:name => my_name,
:order => 0,
}
]
)
Moreover, if I use the same syntax to create a new signature request, rather than an unclaimed_draft it works.
# This works
signature_request = HelloSign.send_signature_request(
:test_mode => 1,
:files => files,
:form_fields_per_document => "[[{\"name\":\"\",\"type\":\"date_signed\",\"signer\":0,\"x\":224,\"y\":108,\"width\":105,\"height\":16,\"required\":true,\"api_id\":\"e1c525_9\"}]]",
:signers => [
{
:email_address => my_email,
:name => my_name,
:order => 0,
}
]
)
Similar to New Relic's ruby gem (https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration#general), need to be able to pass several proxy-related options to Faraday, including proxy_uri (encompasses host, port, scheme, etc.), proxy_user, and proxy_pass.
New feature for bulk send so these endpoints need to be added:
/signature_request/bulk_send_with_template
/bulk_send_job/[:bulk_send_job_id]
/bulk_send_job/list
This commit in release 3.7.7 changes the data return format from a raw data hash to a pre-processed object tree:
ecb5b8b#diff-42ab48678d64732c1f5f3ba54c8a4d88
This can be a breaking change for users who are processing return data as a json hash.
I am using the ruby gem for hellosign and trying to search through the signature requests. I can't, no matter what parameters I give, sort through and find one by title.
We're using the create_embedded_signature_request_with_template
without issue in version 3.5.4. However, when we tried bumping up to v3.6, we noticed that sending in this:
signers: [{
name: "John Doe",
email_address: "[email protected]",
role: "Applicant",
order: 0
}]
was being turned into a request in which our signers
key was a Hash and not a URL. E.g.
"signers[Applicant]": {
"email_address": "jdoe@mail.com",
"name": "John Doe",
"order": "0"
},
It feels like this should be an Array, correct?
It'd be helpful to have something built-in that allows us to extract the response header information, which would allow us to track rate limit usage.
When I don't use 'request_signature' type in create_embedded_unclaimed_draft, I get error that signer name is not set. I think you recently started supporting signer_names in 'send_document' type, but in SDK, inside create_embedded_unclaimed_draft
method, prepare_signers
method is called only for request_signature but not in other case leading to this error
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:
Perhaps a noob user error. I am trying to follow the quick start example using my trial account and display embedded signature iframe on my web page following this guide:
https://app.hellosign.com/api/documentation#QuickStart
I successfully pass steps 1 and 2, but step 3 returns
Request URI: https://api.hellosign.com/v3/embedded/sign_url/29a1dde12cc9a390219992f12408292a32aadfc1
Message: {"error":{"error_msg":"Signature not found","error_name":"bad_request"}}
When I check the API console in my account, it seems that the client.get_embedded_sign_url
seems to execute against the live, not test environment of my account. I've tried to add test_mode=1
to the client.get_embedded_sign_url
call to no avail.
Your help would be greatly appreciated as it would allow me to continue evaluation without switching to the paid account.
EDIT #1:
I also tried the non-embedded example using client.get_signature_request
: it worked perfectly. Unfortunately, it is the embedded flow that I am very interested in.
EDIT #2:
I just tried the curl example for getting the embedded URL: same result. I also tried to add -F 'test_mode=1'
with no results. Therefore, the issue is most likely with the API endpoint itself.
The get_signature_requests method for the signature_request/list endpoint doesn't return the list_info parameters as listed in the API docs
Hi there,
My team updated the hellosign-ruby-sdk
gem in our bundle from 3.6.4
to 3.7.1
and started experiencing the following error each time a signature_request_all_signed
callback was received:
Zip::Error Zip end of central directory signature not found
When checking out the files that are downloaded, what we get is a corrupted .zip file, causing the error above.
It is unclear to me whether there is anything we need to change to get this working again between these two versions, but it's consistent in all of our environments. We have downgraded the gem to 3.6.4
for now.
The "file_url" appears to be a parameter on the base API, but when used in place of "files" in the Ruby SDK, returns the following error:
{"error":{"error_msg":"Error when transferring file: ","error_name":"bad_request"}}):
It does this for both client.create_embedded_unclaimed_draft
and for client.create_embedded_signature_request
.
Thanks!
Skimming the source code, I couldn't find a way to set a timeout on any HelloSign requests. It would be handy to have a little more control over the request when using the HelloSign wrapper.
The ability to set a timeout on each request would probably be optimal, but something as simple as this would go a long way:
client = HelloSign::Client.new(api_key: 'myapikey', read_timeout: 10) # Set timeout in seconds
custom_fields
do not currently take an array. You have to use the deprecated format (passing in a hash) for it to work.
Fails:
options = {
:test_mode=>true,
:template_id=>"my-template-id",
:signers=>[
{ :email_address=>"[email protected]",
:name=>"fasdfa asdfasdf",
:role=>"signer_1"
}
],
:requester_email_address=>"[email protected]",
:is_for_embedded_signing=>true,
:custom_fields=>[{ name: "Business Name", value: "My Biz"}]
}
client.create_embedded_unclaimed_draft_with_template(options)
HelloSign::Error::BadRequest: Server responded with code 400
Request URI: https://api.hellosign.com/v3/unclaimed_draft/create_embedded_with_template
Message: {"error":{"error_msg":"Invalid custom field","error_name":"bad_request"}}
Works:
options = {
:test_mode=>true,
:template_id=>"my-template-id",
:signers=>[
{ :email_address=>"[email protected]",
:name=>"fasdfa asdfasdf",
:role=>"signer_1"
}
],
:requester_email_address=>"[email protected]",
:is_for_embedded_signing=>true,
:custom_fields=>{"Business Name"=>"My Biz"}
}
client.create_embedded_unclaimed_draft_with_template(options)
My current workaround is to manually convert the array to hash for this specific call so you guys might have to do something like this in HelloSign::Client#prepare_custom_fields or handle it on the server.
custom_fields.reduce({}) { |h, ele| h[ele[:name]] = ele[:value]; h }
I'm getting responses with status 429 when rate limit is exceeded, which isn't in ERRORS in HelloSign::Client, and thusly raises HelloSign::Error::UnknownError.
The documentation here https://app.hellosign.com/api/reference#WarningsAndErrors suggests this should return 403 and raise HelloSign::Error::Forbidden.
I'm wondering if this is intentional, or if ERRORS and documentation just haven't been updated to match the actual api responses.
There seems to be the bug of the latest version.
This is my ruby codes:
response =
HelloSign.create_embedded_signature_request_with_template(
:test_mode => 1,
:client_id => 'e83be85a783e79d3093269486aa98540',
:template_id => 'f674cfb4a0053a792adcae3bc5f7e0375630b91d',
:subject => 'Embedded signature request',
:message => 'Fill this in.',
:signers => [
{
:email_address => '[email protected]',
:name => 'Jack',
:role => 'subject'
}
]
)
I keep getting the following error:
Request URI: https://api.hellosign.com/v3/signature_request/create_embedded_with_template
Message: {"error":{"error_msg":"No recipients specified","error_name":"bad_request"}}
Add signer groups to non-embedded signature request endpoints
#send_signature_request and #send_signature_request_with_template methods
Need support for the file[] param on create_embedded_with_template -- to allow you to append a file to a templated document and get a sig request.
Referenced here:
https://app.hellosign.com/api/reference#send_embedded_signature_request_with_template
The verification of a given event hash through HMAC could be added to this SDK as a nice utility method.
def trusted_event?(event_data)
calculated_digest = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha256'), HelloSign.api_key, (event_data[:event_time] + event_data[:event_type]))
return calculated_digest == event_data[:event_hash]
end
Our parse method in client.rb
only checks for application/pdf
and treats everything else as json. We should add logic to make sure that
a) text/html responses don't hit the json parser
b) zip files are properly handled
It might look something like this ( from Issue #20 ):
def parse(response)
if response['content-type'] == 'application/pdf'
response.body
elsif response.body.strip.empty?
{}
elsif response['content-type'] == 'application/json'
MultiJson.load response.body.strip
else
response.body
end
end
HelloSign.get_signature_requests is supposed to take an array of signature_ids and return the status of those. But the actual behavior is that it returns the status of all documents in my hellosign account.
For eg: Following code fails since I do not have '42383e7327eda33f4b8b91217cbe95408cc1285f' in my account. This is from example in the documentation. But if I use HelloSign.get_signature_requests it returns all data in my account.
pry(main)> signature_request = HelloSign.get_signature_request :signature_request_id => '42383e7327eda33f4b8b91217cbe95408cc1285f'
HelloSign::Error::NotFound: Server responded with code 404
Request URI: https://api.hellosign.com/v3/signature_request/42383e7327eda33f4b8b91217cbe95408cc1285f
See: https://github.com/tyrbo/hellosign-ruby-sdk/blob/v3/lib/hello_sign/api/embedded.rb#L50-L64
Will open a pull request as well. A project I'm currently working on requires these options. I didn't see any specs for #get_embedded_template_edit_url
.
Unfortunately hellosign-ruby-sdk
is not really a good gem name, hellosign
or hello_sign
would be much better. ๐
Currently one needs to add gem 'hellosign-ruby-sdk', require: 'hello_sign'
to the Gemfile, since Bundler tries to load lib/GEM_NAME.rb
and can't find lib/hellosign-ruby-sdk.rb
. If the gem was named hello_sign
, lib/hello_sign.rb
would be loaded automatically.
An alternative to changing the gem name would be adding a lib/hellosign-ruby-sdk.rb
file that requires lib/hello_sign.rb
.
Embedded Unclaimed Draft endpoints need to default to type: request_signature if it's not included but this causes an error that says signers aren't included
workaround is to include type: request_signature
In my experience, 'role' is mandatory, and you use it in your examples (https://www.hellosign.com/api/embeddedSigningExample), but it's not included in the comments above the function description.
Also, it would be nice to have a better sense of which of those fields are optional and which are not (for example, client_id is optional but the comment doesn't document it, only the code).
I'm getting a crash when passing an invalid path for the files
parameter in create_embedded_signature_request
:
ArgumentError: wrong number of arguments (given 1, expected 2..3)
from /Users/danieldehaas/.rvm/gems/ruby-2.4.4@duco/gems/hellosign-ruby-sdk-3.7.7/lib/hello_sign/error.rb:30:in `initialize'
The problem seems to be in these two places:
The Error
initializer expects 2 to 3 arguments but is only getting 1.
Thanks!
Hi, Our team had recently run into an issue where we updated some templates unintentionally in production, while we were developing a new feature locally - in development mode.
Looking over the code, I would expect to be able to configure the client to run in test mode during the initial client setup / configuration and have that apply for all relevant api calls. I would expect this code to live on the configuration object here: https://github.com/HelloFax/hellosign-ruby-sdk/blob/v3/lib/hello_sign/configuration.rb#L60-L75, but I do not see it.
Perhaps there is a technique to fake this sort of test_mode operation by specifying a non verified client id?
Does anyone have a good workaround pattern to set test_mode on a per client basis? If not, would this be a worthwhile feature to add?
I'd really like to be able to do this:
HelloSign.configure do |config|
config.api_key = ENV['HELLOSIGN_API_KEY']
config.test_mode = true
end
Thanks!
I'm getting the following error on trying to startup my rails server:
/Users/alexey/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- pry (LoadError)
Looking through your code, it looks like you use Pry for debugging (and maybe documentation) - pry is required in lib/hello_sign/resource/resource_array.rb
but as far as I can tell is not used there directly.
Please either include pry
explicitly in your Gemfile or remove the dependency.
The following changes have been made to the API:
Hi,
I found issue on updating API App
https://github.com/HelloFax/hellosign-ruby-sdk/blob/e97b07995d5e1c59e0d771cdebf17ff8b73493a9/lib/hello_sign/api/api_app.rb#L100
The trace :
HelloSign::Error::MethodNotAllowed: Server responded with code 405
Request URI: https://api.hellosign.com/v3/api_app/838b002f8814bb2febe3175d565931bc
Message: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL /v3/api_app/838b002f8814bb2febe3175d565931bc.</p>
</body></html>
from /Users/maxime/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hellosign-ruby-sdk-3.2.11/lib/hello_sign/client.rb:179:in `validate'
I follow the documentation https://www.hellosign.com/api/reference#ApiApp and I can see using a POST to update resource.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.