hellosign_sdk.hsclient.
HSClient
(email_address=None, password=None, api_key=None, access_token=None, access_token_type='Bearer', env='production')¶Bases: object
Client object to interact with the API urls
Most of the operations of the SDK is made through this object. Please refer to the README.rst file for more details on how to use the client object.
ACCOUNT_CREATE_URL
= ''¶ACCOUNT_INFO_URL
= ''¶ACCOUNT_UPDATE_URL
= ''¶ACCOUNT_VERIFY_URL
= ''¶API_URL
= ''¶API_VERSION
= 'v3'¶EMBEDDED_OBJECT_GET_URL
= ''¶EMBEDDED_TEMPLATE_EDIT_URL
= ''¶OAUTH_TOKEN_URL
= ''¶SIGNATURE_REQUEST_CANCEL_URL
= ''¶SIGNATURE_REQUEST_CREATE_EMBEDDED_URL
= ''¶SIGNATURE_REQUEST_CREATE_EMBEDDED_WITH_TEMPLATE_URL
= ''¶SIGNATURE_REQUEST_CREATE_URL
= ''¶SIGNATURE_REQUEST_CREATE_WITH_TEMPLATE_URL
= ''¶SIGNATURE_REQUEST_DOWNLOAD_PDF_URL
= ''¶SIGNATURE_REQUEST_INFO_URL
= ''¶SIGNATURE_REQUEST_LIST_URL
= ''¶SIGNATURE_REQUEST_REMIND_URL
= ''¶TEAM_ADD_MEMBER_URL
= ''¶TEAM_CREATE_URL
= ''¶TEAM_DESTROY_URL
= ''¶TEAM_INFO_URL
= ''¶TEAM_REMOVE_MEMBER_URL
= ''¶TEAM_UPDATE_URL
= ''¶TEMPLATE_ADD_USER_URL
= ''¶TEMPLATE_CREATE_EMBEDDED_DRAFT_URL
= ''¶TEMPLATE_DELETE_URL
= ''¶TEMPLATE_GET_FILES_URL
= ''¶TEMPLATE_GET_LIST_URL
= ''¶TEMPLATE_GET_URL
= ''¶TEMPLATE_REMOVE_USER_URL
= ''¶UNCLAIMED_DRAFT_CREATE_EMBEDDED_URL
= ''¶UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URL
= ''¶UNCLAIMED_DRAFT_CREATE_URL
= ''¶add_team_member
(account_id=None, email_address=None)¶Add or invite a user to your Team
Args:
account_id (str): The id of the account of the user to invite to your team.
email_address (str): The email address of the account to invite to your team. The account id prevails if both account_id and email_address are provided.
add_user_to_template
(template_id, account_id=None, email_address=None)¶Gives the specified Account access to the specified Template
Args:
template_id (str): The id of the template to give the account access to
account_id (str): The id of the account to give access to the template. The account id prevails if both account_id and email_address are provided.
email_address (str): The email address of the account to give access to.
cancel_signature_request
(signature_request_id)¶Cancels a SignatureRequest
Cancels a SignatureRequest. After canceling, no one will be able to sign or access the SignatureRequest or its documents. Only the requester can cancel and only before everyone has signed.
Args:
signing_request_id (str): The id of the signature request to cancel
create_account
(*args, **kwargs)¶Make a Resource instance
create_embedded_template_draft
(client_id, signer_roles, test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, cc_roles=None, merge_fields=None, use_preexisting_fields=False)¶Creates an embedded Template draft for further editing.
Args:
test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to 1. Defaults to 0.
client_id (str): Client id of the app you’re using to create this draft.
files (list of str): The file(s) to use for the template.
file_urls (list of str): URLs of the file for HelloSign to use for the template. Use either files or file_urls, but not both.
title (str, optional): The template title
subject (str, optional): The default template email subject
message (str, optional): The default template email message
signer_roles (list of dict): A list of signer roles, each of which has the following attributes:
name (str): The role name of the signer that will be displayed when the template is used to create a signature request. order (str, optional): The order in which this signer role is required to sign.cc_roles (list of str, optional): The CC roles that must be assigned when using the template to send a signature request
merge_fields (list of dict, optional): The merge fields that can be placed on the template’s document(s) by the user claiming the template draft. Each must have the following two parameters:
name (str): The name of the merge field. Must be unique. type (str): Can only be “text” or “checkbox”.use_preexisting_fields (bool): Whether to use preexisting PDF fields
create_embedded_unclaimed_draft
(test_mode=False, client_id=None, is_for_embedded_signing=False, requester_email_address=None, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, requesting_redirect_url=None, form_fields_per_document=None, metadata=None, use_preexisting_fields=False)¶Creates a new Draft to be used for embedded requesting
Args:
test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False.
client_id (str): Client id of the app used to create the embedded draft.
is_for_embedded_signing (bool, optional): Whether this is also for embedded signing. Defaults to False.
requester_email_address (str): Email address of the requester.
files (list of str): The uploaded file(s) to send for signature.
file_urls (list of str): URLs of the file for HelloSign to download to send for signature. Use either files or file_urls
draft_type (str): The type of unclaimed draft to create. Use “send_document” to create a claimable file, and “request_signature” for a claimable signature request. If the type is “request_signature” then signers name and email_address are not optional.
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signer order (str, optional): The order the signer is required to sign incc_email_addresses (list of str, optional): A list of email addresses that should be CC’d
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
requesting_redirect_url (str, optional): The URL you want the signer to be redirected to after the request has been sent.
form_fields_per_document (str, optional): The fields that should appear on the document, expressed as a serialized JSON data structure which is a list of lists of the form fields. Please refer to the API reference of HelloSign for more details (https://www.hellosign.com/api/reference#SignatureRequest)
metadata (dict, optional): Metadata to associate with the draft
use_preexisting_fields (bool): Whether to use preexisting PDF fields
create_embedded_unclaimed_draft_with_template
(test_mode=False, client_id=None, is_for_embedded_signing=False, template_id=None, template_ids=None, requester_email_address=None, title=None, subject=None, message=None, signers=None, ccs=None, signing_redirect_url=None, requesting_redirect_url=None, metadata=None, custom_fields=None)¶Creates a new Draft to be used for embedded requesting
Args:
test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False.
client_id (str): Client id of the app you’re using to create this draft. Visit our embedded page to learn more about this parameter.
template_id (str): The id of the Template to use when creating the Unclaimed Draft. Mutually exclusive with template_ids.
template_ids (list of str): The ids of the Templates to use when creating the Unclaimed Draft. Mutually exclusive with template_id.
requester_email_address (str): The email address of the user that should be designated as the requester of this draft, if the draft type is “request_signature.”
title (str, optional): The title you want to assign to the Unclaimed Draft
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signerccs (list of str, optional): A list of email addresses that should be CC’d
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
requesting_redirect_url (str, optional): The URL you want the signer to be redirected to after the request has been sent.
is_for_embedded_signing (bool, optional): The request created from this draft will also be signable in embedded mode if set to True. The default is False.
metadata (dict, optional): Metadata to associate with the draft. Each request can include up to 10 metadata keys, with key names up to 40 characters long and values up to 500 characters long.
custom_fields (list of dict, optional): A list of custom fields. Required when a CustomField exists in the Template. An item of the list should look like this: {‘name: value’}
create_team
(*args, **kwargs)¶Make a Resource instance
create_unclaimed_draft
(test_mode=False, files=None, file_urls=None, draft_type=None, subject=None, message=None, signers=None, cc_email_addresses=None, signing_redirect_url=None, form_fields_per_document=None, metadata=None, use_preexisting_fields=False)¶Creates a new Draft that can be claimed using the claim URL
Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the “Sign and send” or the “Request signature” page with the Draft loaded. Subsequent access to the claim URL will result in a 404. If the type is “send_document” then only the file parameter is required. If the type is “request_signature”, then the identities of the signers and optionally the location of signing elements on the page are also required.
Args:
test_mode (bool, optional): Whether this is a test, the signature request created from this draft will not be legally binding if set to True. Defaults to False.
files (list of str): The uploaded file(s) to send for signature
file_urls (list of str): URLs of the file for HelloSign to download to send for signature. Use either files or file_urls
draft_type (str): The type of unclaimed draft to create. Use “send_document” to create a claimable file, and “request_signature” for a claimable signature request. If the type is “request_signature” then signers name and email_address are not optional.
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signer order (str, optional): The order the signer is required to sign incc_email_addresses (list of str, optional): A list of email addresses that should be CC’d
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
form_fields_per_document (str, optional): The fields that should appear on the document, expressed as a serialized JSON data structure which is a list of lists of the form fields. Please refer to the API reference of HelloSign for more details (https://www.hellosign.com/api/reference#SignatureRequest)
metadata (dict, optional): Metadata to associate with the draft
use_preexisting_fields (bool): Whether to use preexisting PDF fields
delete_template
(template_id)¶Deletes the specified template
Args:
template_id (str): The id of the template to delete
destroy_team
()¶Delete your Team
Deletes your Team. Can only be invoked when you have a team with only one member left (yourself).
get_account_info
()¶Get current account information
The information then will be saved in self.account so that you can access the information like this:
>>> hsclient = HSClient()
>>> acct = hsclient.get_account_info()
>>> print acct.email_address
get_embedded_object
(*args, **kwargs)¶Make a Resource instance
get_last_warnings
()¶Return the warnings associated with the last request
get_oauth_data
(code, client_id, client_secret, state)¶Get Oauth data from HelloSign
Args:
code (str): Code returned by HelloSign for our callback url
client_id (str): Client id of the associated app
client_secret (str): Secret token of the associated app
get_signature_request
(*args, **kwargs)¶Make a Resource instance
get_signature_request_file
(signature_request_id, path_or_file=None, file_type=None, filename=None)¶Download the PDF copy of the current documents
Args:
signature_request_id (str): Id of the signature request
path_or_file (str or file): A writable File-like object or a full path to save the PDF file to.
filename (str): [DEPRECATED] Filename to save the PDF file to. This should be a full path.
file_type (str): Type of file to return. Either “pdf” for a single merged document or “zip” for a collection of individual documents. Defaults to “pdf” if not specified.
get_signature_request_list
(*args, **kwargs)¶Make a ResourceList instance
get_team_info
(*args, **kwargs)¶Make a Resource instance
get_template
(*args, **kwargs)¶Make a Resource instance
get_template_edit_url
(*args, **kwargs)¶Make a Resource instance
get_template_files
(template_id, filename)¶Download a PDF copy of a template’s original files
Args:
template_id (str): The id of the template to retrieve.
filename (str): Filename to save the PDF file to. This should be a full path.
get_template_list
(*args, **kwargs)¶Make a ResourceList instance
refresh_access_token
(refresh_token)¶Refreshes the current access token.
Gets a new access token, updates client auth and returns it.
Args:
refresh_token (str): Refresh token to use
remind_signature_request
(*args, **kwargs)¶Make a Resource instance
remove_team_member
(account_id=None, email_address=None)¶Remove a user from your Team
Args:
account_id (str): The id of the account of the user to remove from your team.
email_address (str): The email address of the account to remove from your team. The account id prevails if both account_id and email_address are provided.
remove_user_from_template
(template_id, account_id=None, email_address=None)¶Removes the specified Account’s access to the specified Template
Args:
template_id (str): The id of the template to remove the account’s access from.
account_id (str): The id of the account to remove access from the template. The account id prevails if both account_id and email_address are provided.
email_address (str): The email address of the account to remove access from.
request
= None¶response_callback
= None¶send_signature_request
(test_mode=False, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None)¶Creates and sends a new SignatureRequest with the submitted documents
Creates and sends a new SignatureRequest with the submitted documents. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents.
Args:
test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False.
files (list of str): The uploaded file(s) to send for signature
file_urls (list of str): URLs of the file for HelloSign to download to send for signature. Use either files or file_urls
title (str, optional): The title you want to assign to the SignatureRequest
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signer order (str, optional): The order the signer is required to sign in pin (str, optional): The 4- to 12-character access code that will secure this signer’s signature pagecc_email_addresses (list, optional): A list of email addresses that should be CC’d
form_fields_per_document (str): The fields that should appear on the document, expressed as a serialized JSON data structure which is a list of lists of the form fields. Please refer to the API reference of HelloSign for more details (https://www.hellosign.com/api/reference#SignatureRequest)
use_text_tags (bool, optional): Use text tags in the provided file(s) to create form fields
hide_text_tags (bool, optional): Hide text tag areas
metadata (dict, optional): Metadata to associate with the signature request
ux_version (int): UX version, either 1 (default) or 2.
send_signature_request_embedded
(test_mode=False, client_id=None, files=None, file_urls=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, cc_email_addresses=None, form_fields_per_document=None, use_text_tags=False, hide_text_tags=False, metadata=None, ux_version=None)¶Creates and sends a new SignatureRequest with the submitted documents
Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame . If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.
Args:
test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False.
client_id (str): Client id of the app you’re using to create this embedded signature request. Visit the embedded page to learn more about this parameter (https://www.hellosign.com/api/embeddedSigningWalkthrough)
files (list of str): The uploaded file(s) to send for signature
file_urls (list of str): URLs of the file for HelloSign to download to send for signature. Use either files or file_urls
title (str, optional): The title you want to assign to the SignatureRequest
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signer order (str, optional): The order the signer is required to sign in pin (str, optional): The 4- to 12-character access code that will secure this signer’s signature pagecc_email_addresses (list, optional): A list of email addresses that should be CCed
form_fields_per_document (str): The fields that should appear on the document, expressed as a serialized JSON data structure which is a list of lists of the form fields. Please refer to the API reference of HelloSign for more details (https://www.hellosign.com/api/reference#SignatureRequest)
use_text_tags (bool, optional): Use text tags in the provided file(s) to create form fields
hide_text_tags (bool, optional): Hide text tag areas
metadata (dict, optional): Metadata to associate with the signature request
ux_version (int): UX version, either 1 (default) or 2.
send_signature_request_embedded_with_template
(test_mode=False, client_id=None, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None)¶Creates and sends a new SignatureRequest based off of a Template
Creates a new SignatureRequest based on the given Template to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.
Args:
test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False.
client_id (str): Client id of the app you’re using to create this embedded signature request. Visit the embedded page to learn more about this parameter (https://www.hellosign.com/api/embeddedSigningWalkthrough)
template_id (str): The id of the Template to use when creating the SignatureRequest. Mutually exclusive with template_ids.
template_ids (list): The ids of the Templates to use when creating the SignatureRequest. Mutually exclusive with template_id.
title (str, optional): The title you want to assign to the SignatureRequest
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
signers (list of dict): A list of signers, which each has the following attributes:
name (str): The name of the signer email_address (str): Email address of the signer pin (str, optional): The 4- to 12-character access code that will secure this signer’s signature pageccs (list of dict, optional): The email address of the CC filling the role of RoleName. Required when a CC role exists for the Template. Each dict has the following attributes:
role_name (str): CC role name email_address (str): CC email addresscustom_fields (list of dict, optional): A list of custom fields. Required when a CustomField exists in the Template. An item of the list should look like this: {‘name: value’}
metadata (dict, optional): Metadata to associate with the signature request
ux_version (int): UX version, either 1 (default) or 2.
send_signature_request_with_template
(test_mode=False, template_id=None, template_ids=None, title=None, subject=None, message=None, signing_redirect_url=None, signers=None, ccs=None, custom_fields=None, metadata=None, ux_version=None)¶Creates and sends a new SignatureRequest based off of a Template
Creates and sends a new SignatureRequest based off of the Template specified with the template_id parameter.
Args:
test_mode (bool, optional): Whether this is a test, the signature request will not be legally binding if set to True. Defaults to False.
template_id (str): The id of the Template to use when creating the SignatureRequest. Mutually exclusive with template_ids.
template_ids (list): The ids of the Templates to use when creating the SignatureRequest. Mutually exclusive with template_id.
title (str, optional): The title you want to assign to the SignatureRequest
subject (str, optional): The subject in the email that will be sent to the signers
message (str, optional): The custom message in the email that will be sent to the signers
signing_redirect_url (str, optional): The URL you want the signer redirected to after they successfully sign.
signers (list of dict): A list of signers, which each has the following attributes:
role_name (str): Signer role name (str): The name of the signer email_address (str): Email address of the signer pin (str, optional): The 4- to 12-character access code that will secure this signer’s signature pageccs (list of str, optional): The email address of the CC filling the role of RoleName. Required when a CC role exists for the Template. Each dict has the following attributes:
role_name (str): CC role name email_address (str): CC email addresscustom_fields (list of dict, optional): A list of custom fields. Required when a CustomField exists in the Template. An item of the list should look like this: {‘name: value’}
metadata (dict, optional): Metadata to associate with the signature request
ux_version (int): UX version, either 1 (default) or 2.
update_account_info
(*args, **kwargs)¶Make a Resource instance
update_team_name
(*args, **kwargs)¶Make a Resource instance
verify_account
(email_address)¶Verify whether a HelloSign Account exists
Args:
email_address (str): Email address for the account to verify
version
= '3.8.5'¶