hellosign / hellosign-python-sdk

A Python SDK for HelloSign's API
MIT License
29 stars 48 forks source link

v3/unclaimed_draft/create_embedded is defaulting to 1 not 0 for is_for_embedded_signing #33

Closed alexmac05 closed 6 years ago

alexmac05 commented 6 years ago

v3/unclaimed_draft/create_embedded is defaulting to 1 not 0.

-F 'is_for_embedded_signing=0' \

And it will not set is_for_embedded_signing = 0 no matter under any set of conditions.

This is just for create_embedded response = client.create_embedded_unclaimed_draft

alexmac05 commented 6 years ago

tested and https://app.hellosign.com/api/reference#create_embedded_unclaimed_draft_with_template does not share this issue

This issue is isolated to /create_embedded (without using a template)

thisjustin commented 6 years ago

@alexmac05 is this something that will be fixed by the HelloSign team? (forgive me if you're not a part of their team, it's hard to tell)

It appears that the root of the issue stems from _boolean (https://github.com/HelloFax/hellosign-python-sdk/blob/v3/hellosign_sdk/hsclient.py#L1282) returning a string which is definitely a bad idea in general and is bound to lead to errors like below sooner or later.

Assuming that is a larger refactoring, this specific issue seems to be solved by changing https://github.com/HelloFax/hellosign-python-sdk/blob/v3/hellosign_sdk/hsclient.py#L1638 to be:

'is_for_embedded_signing': '1' if is_for_embedded_signing and is_for_embedded_signing != '0' else '0',
BHSPitMonkey commented 6 years ago

This has been fixed in 3.8.7. Thanks for the report!