An API wrapper written in Python to interact with HelloSign's API (http://www.hellosign.com)
Note: This is not the final Readme, and the package is not ready yet. It will be ready when it's ready (of course).
Install using easy_install
:
easy_install hellosign-python-sdk
Install using pip
:
pip install hellosign-python-sdk
In your application, import HSClient
:
from hellosign_python_sdk.hsclient import HSClient
Then create a HSClient object and pass authentication information to initialize it:
# Initialize HSClient using email and password
client = HSClient(api_email="[email protected]", api_password="your_password")
# Initialize HSClient using api key
client = HSClient(api_key="your_api_key")
# Initialize HSClient using api token
client = HSClient(api_accesstoken="your_api_access_token", api_accesstokentype="your_api_access_token_type")
Note: In case you initialize the HSClient with all the above credentials, the priority order is as follow: api_accesstoken & api_accesstokentype, api_key, then api_email and api_password
For more information about the API, please refer to this link
client.get_account_info()
The account information is then stored in client.account
. For example, to print the email_address
of your account:
print client.account.email_address
client.account.callback_url = "https://www.example.com/callback"
client.update_account_info()
new_account = client.create_account("[email protected]", "aL0ngL0ngPa55w0rd")
sr = client.get_signature_request("fa5c8a0b0f492d768749333ad6fcc214c111e967")
print sr.requester_email_address
print sr.signature_request_id
sr_list = client.get_signature_request_list()
# Print out the name of the signers in every signature request
for sr in sr_list:
print sr.signatures[0]['signer_name']
files = ["NDA.pdf", "AppendixA.pdf"]
signers = [{"name": "Jack", "email_address": "[email protected]"}, {"name": "Jill", "email_address": "[email protected]"}]
cc_email_addresses = ["[email protected]", "[email protected]"]
# Send a signature request with uploaded files
signature_request = client.send_signature_request(test_mode="1", files=None, file_urls=["http://www.example.com/download/sample.pdf"], title="NDA with Acme Co.", subject="The NDA we talked about", message="Please sign this NDA and then we can discuss more. Let me know if you have any questions.", signing_redirect_url="", signers=signers, cc_email_addresses=cc_email_addresses)
# Send a signature request with remote files
signature_request = client.send_signature_request(test_mode="1", files=files, file_urls=None, title="NDA with Acme Co.", subject="The NDA we talked about", message="Please sign this NDA and then we can discuss more. Let me know if you have any questions.", signing_redirect_url="", signers=signers, cc_email_addresses=cc_email_addresses)
signers = [{"name": "Jack", "email_address": "[email protected]"}, {"name": "Jill", "email_address": "[email protected]"}]
cc_email_addresses = ["[email protected]", "[email protected]"]
ccs = [{'email_address': '[email protected]', 'role_name': 'Lawyer 1'},
{'email_address': '[email protected]', 'role_name': 'Lawyer 2'}]
custom_fields = [{"Field 1": 'Value 1'}, {'Field 2': 'Value 2'}]
# Send a signature request with uploaded files
signature_request = client.send_signature_request_with_rf(test_mode="1", reusable_form_id="fa5c8a0b0f492d768749333ad6fcc214c111e967", title="NDA with Acme Co.", subject="The NDA we talked about", message="Please sign this NDA and then we can discuss more. Let me know if you have any questions.", signing_redirect_url="", signers=signers, ccs=ccs, custom_fields=custom_fields)