pyEchosign.classes package

Submodules

class EchosignAccount(access_token: str, **kwargs)

Bases: object

Saves OAuth Information for connecting to Echosign

access_token

The OAuth Access token to use for authenticating to Echosign

user_id

The ID of the user to specify as the API caller, if not provided the caller is inferred from the token

user_email

The email of the user to specify as the API caller, if not provided the caller is inferred from the token

api_access_point

The API endpoint used as a base for all API calls

access_token = None
get_agreements()

Gets all agreements for the EchosignAccount

Returns: A list of Agreement objects

get_library_documents()

Gets all Library Documents for the EchosignAccount

Returns: A list of Agreement objects

classes.agreement module

class Agreement

Bases: object

Represents either a created agreement in Echosign, or one built in Python which can be sent through, and created in Echosign.

Parameters:

account (EchosignAccount) – An instance of EchosignAccount. All Agreement actions will be conducted under this account.

Keyword Arguments:
 
  • fully_retrieved (bool) – Whether or not the agreement has all information retrieved, or if only the basic information was pulled (such as when getting all agreements instead of requesting the specific agreement)
  • echosign_id (str) – The ID assigned to the agreement by Echosign, used to identify the agreement via the API
  • name (str) – The name of the document as specified by the sender
  • status (Agreement.Status) – The current status of the document (OUT_FOR_SIGNATURE, SIGNED, APPROVED, etc)
  • users (list[DisplayUser]) – The users associated with this agreement, represented by EchosignAccount
  • files (list) – A list of TransientDocument instances which will become the documents within the agreement. This information is not provided when retrieving agreements from Echosign.
account

EchosignAccount – An instance of EchosignAccount. All Agreement actions will be conducted under this account.

fully_retrieved

bool – Whether or not the agreement has all information retrieved, or if only the basic information was pulled (such as when getting all agreements instead of requesting the specific agreement)

echosign_id

str – The ID assigned to the agreement by Echosign, used to identify the agreement via the API

name

str – The name of the document as specified by the sender

status

Agreement.Status – The current status of the document (OUT_FOR_SIGNATURE, SIGNED, APPROVED, etc)

users

list[DisplayUser] – The users associated with this agreement, represented by EchosignAccount

files

list – A list of TransientDocument instances which will become the documents within the agreement. This information is not provided when retrieving agreements from Echosign.

class Status

Bases: enum.Enum

Possible status of agreements

Note

Echosign provides ‘WAITING_FOR_FAXIN’ in their API documentation, so pyEchosign has also included ‘WAITING_FOR_FAXING’ in case that’s just a typo in their documentation. Once it’s determined which is used, the other will be removed.

ACCEPTED = ‘ACCEPTED’
APPROVED = ‘APPROVED’
ARCHIVED = ‘ARCHIVED’
DELIVERED = ‘DELIVERED’
EXPIRED = ‘EXPIRED’
FORM = ‘FORM’
FORM_FILLED = ‘FORM_FILLED’
OTHER = ‘OTHER’
OUT_FOR_ACCEPTANCE = ‘OUT_FOR_ACCEPTANCE’
OUT_FOR_APPROVAL = ‘OUT_FOR_APPROVAL’
OUT_FOR_DELIVERY = ‘OUT_FOR_DELIVERY’
OUT_FOR_FORM_FILLING = ‘OUT_FOR_FORM_FILLING’
OUT_FOR_SIGNATURE = ‘OUT_FOR_SIGNATURE’
RECALLED = ‘RECALLED’
SIGNED = ‘SIGNED’
WAITING_FOR_AUTHORING = ‘WAITING_FOR_AUTHORING’
WAITING_FOR_FAXIN = ‘WAITING_FOR_FAXIN’
WAITING_FOR_FAXING = ‘WAITING_FOR_FAXING’
WAITING_FOR_MY_ACCEPTANCE = ‘WAITING_FOR_MY_ACCEPTANCE’
WAITING_FOR_MY_ACKNOWLEDGEMENT = ‘WAITING_FOR_MY_ACKNOWLEDGEMENT’
WAITING_FOR_MY_APPROVAL = ‘WAITING_FOR_MY_APPROVAL’
WAITING_FOR_MY_DELEGATION = ‘WAITING_FOR_MY_DELEGATION’
WAITING_FOR_MY_FORM_FILLING = ‘WAITING_FOR_MY_FORM_FILLING’
WAITING_FOR_MY_SIGNATURE = ‘WAITING_FOR_MY_SIGNATURE’
WIDGET = ‘WIDGET’
cancel()

Cancels the agreement on Echosign. Agreement will still be visible in the Manage page.

delete()

Deletes the agreement on Echosign. Agreement will not be visible in the Manage page.

Warning

This action requires the ‘agreement_retention’ scope, which doesn’t appear to be actually available via OAuth

send_agreement(agreement_name: str, recipients: typing.List[pyEchosign.classes.users.Recipient], ccs=None, days_until_signing_deadline=0, external_id=”, sender_signature_required=False, merge_fields: typing.List[typing.Dict[str, str]] = None, message=”)

Sends this agreement to Echosign for signature

Parameters:
  • agreement_name – A string for the document name which will appear in the Echosign Manage page, the email to recipients, etc.
  • recipients – A list of Recipients. The order which they are provided in the list determines the order in which they sign.
  • ccs – (optional) A list of email addresses to be CC’d on the Echosign agreement emails (document sent, document fully signed, etc)
  • days_until_signing_deadline – (optional) “The number of days that remain before the document expires. You cannot sign the document after it expires” Defaults to 0, for no expiration.
  • external_id – (optional) “A unique identifier for your transaction… You can use the ExternalID to search for your transaction through [the] API”
  • sender_signature_required – (optional) (bool) Whether or not a sender signature is required. Defaults to False. If true, the signer will sign first. The additional options of the signer signing last, or sequentially isn’t currently supported (because I haven’t thought of a clean way to handle providing that info).
  • merge_fields – (optional) A list of dictionaries, with each one providing the ‘fieldName’ and ‘defaultValue’ keys. The field name maps to the field on the document, and the default value is what will be placed inside.
  • message – (optional) A message which will be displayed to recipients of the agreement
Returns:

agreement_id

”The unique identifier that can be used to query status and download signed documents”

embedded_code

”Javascript snippet suitable for an embedded page taking a user to a URL”

expiration

”Expiration date for autologin. This is based on the user setting, API_AUTO_LOGIN_LIFETIME”

url

”Standalone URL to direct end users to”

Return type:

A namedtuple representing the information received back from the API. Contains attributes

Raises:

ApiError – If the API returns an error, such as a 403. The exact response from the API is provided.

class AgreementEndpoints

Bases: object

An internal class to handle making calls to the endpoints associated with Agreements.

Parameters:account – An instance of EchosignAccount to be used for all API calls
base_api_url = None
create_agreement(request_body)
get_agreements()

Gets all agreements for the EchosignAccount - making the API call from the first iteration, and then yielding each agreement thereafter.

classes.documents module

class AgreementCreator

Bases: object

class DocumentCreationInfo

Bases: object

callback_info = None
cc = []
days_until_signing_deadline = None
external_id = None
files_info = []
locale = None
message = None
name = None
reminder_frequency = None
signature_flow = None
signature_type = ‘ESIGN’
class FileInfo(*args, **kwargs)

Bases: object

Used with DocumentCreationInfo to specify which documents should be used in an agreement. One of the following arguments must be provided.

library_document_id

“The ID for a library document that is available to the sender”

library_document_name

“The name of a library document that is available to the sender”

transient_document

A TransientDocument (or ID) to use in the agreement

library_document_id = None
library_document_name = None
transient_document = None
web_file = None
class RecipientInfo

Bases: object

ACCEPTOR = ‘ACCEPTOR’
APPROVER = ‘APPROVER’
CERTIFIED_RECIPIENT = ‘CERTIFIED_RECIPIENT’
DELEGATE_TO_ACCEPTOR = ‘DELEGATE_TO_ACCEPTOR’
DELEGATE_TO_APPROVER = ‘DELEGATE_TO_APPROVER’
DELEGATE_TO_CERTIFIED_RECIPIENT = ‘DELEGATE_TO_CERTIFIED_RECIPIENT’
DELEGATE_TO_FORM_FILLER = ‘DELEGATE_TO_FORM_FILLER’
DELEGATE_TO_SIGNER = ‘DELEGATE_TO_SIGNER’
FORM_FILLER = ‘FORM_FILLER’
SIGNER = ‘SIGNER’
email = None
fax = None
private_message = None
role = None
signing_order = None
class TransientDocument

Bases: object

A document which can be used in Agreements - is deleted by Echosign after 7 days. The TransientDocument is created in Echosign on instantiation.

Parameters:
  • account – The EchosignAccount to be associated with this document
  • file_name (str) – The name of the file
  • file – The actual file object to upload to Echosign, accepts a stream of bytes.
  • mime_type – The MIME type of the file
file_name

The name of the file

file

The actual file object to upload to Echosign

mime_type

The MIME type of the file

document_id

The ID provided by Echosign, used to reference it in creating agreements

expiration_date

The date Echosign will delete this document (not provided by Echosign, calculated for convenience

classes.users module

class DisplayUser(email: str, **kwargs)

Bases: object

Maps to the DisplayUserInfo provided by Echosign for agreements fetched in bulk

class Recipient(email: str, **kwargs)

Bases: pyEchosign.classes.users.DisplayUser

Provides additional attributes to facilitate sending documents to recipients, such as Security Options.

authentication_method

str – “The authentication method for the recipients to have access to view and sign the document” (Echosign API Docs). Available options are ‘NONE’ (string), ‘INHERITED_FROM_DOCUMENT’ or ‘PASSWORD’ or ‘WEB_IDENTITY’ or ‘KBA’ or ‘PHONE’.

password

str – Optional - “The password required for the recipient to view and sign the document”

Module contents

class EchosignAccount(access_token: str, **kwargs)

Bases: object

Saves OAuth Information for connecting to Echosign

access_token

The OAuth Access token to use for authenticating to Echosign

user_id

The ID of the user to specify as the API caller, if not provided the caller is inferred from the token

user_email

The email of the user to specify as the API caller, if not provided the caller is inferred from the token

api_access_point

The API endpoint used as a base for all API calls

access_token = None
get_agreements()

Gets all agreements for the EchosignAccount

Returns: A list of Agreement objects

get_library_documents()

Gets all Library Documents for the EchosignAccount

Returns: A list of Agreement objects