hellosign / hellosign-ruby-sdk

A Ruby SDK for HelloSign's API
MIT License
52 stars 61 forks source link

Error sending signature request #122

Open 7200rpm opened 3 years ago

7200rpm commented 3 years ago

I"m trying to send a signature request with the SDK and hitting an errors. I took the code directly from the getting started section:

client = HelloSign::Client.new api_key: 'API_KEY'
    client.send_signature_request(
      test_mode: 1,
      title: 'NDA with Acme Co.',
      subject: 'The NDA we talked about',
      message: 'Please sign this NDA and then we can discuss more.',
      signers: [
        {
          email_address: 'myname@gmail.com',
          name: 'Joe Brown'
        }
      ],
      files: ['NDA.pdf', 'AppendixA.pdf']
    )

Throws a ArgumentError (wrong number of arguments (given 1, expected 2..3))

Also, it's strange that the send signature request isn't documented on the wiki and only documented on the website. Am I doing something wrong?

jonahgolden commented 3 years ago

+1 for this, I'm hitting the same issue. Any resolution?

ConorFischer commented 3 years ago

Ran into this today. In my case, it was a bug when passing the :files options. Looks like there hasn't been a gem release within 2 years.

I could suggest pinning a more recent commit. Ruby gems has latest is 3.7.7 and it seems like d47266cd39a7bbc9d08ed364e817213081d3ce5c would probably resolve the issue. Or at the very least help you figure out what options are wrong / being raised.

Side thought -- These errors feel like they should inherit from StandardError or something other than the base Error, since these errors look to be unrelated to the actual response of the HelloSign api. https://github.com/HelloFax/hellosign-ruby-sdk/blob/f5b3cb187873d1be7588c6da775012636f8d90a9/lib/hello_sign/error.rb#L90-L94