forked from eversign/eversign-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocument_operations.py
54 lines (40 loc) · 1.6 KB
/
document_operations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import sys
import config
from pprint import pprint
sys.path.append("..")
import eversign
client = eversign.Client(config.access_key)
# client.set_selected_business_by_id(1534)
# businesses = client.fetch_businesses()
# client.set_selected_business(businesses[1])
documents = client.get_all_documents()
print(str(len(documents)) + ' all_documents found')
documents = client.get_canceled_documents()
print(str(len(documents)) + ' canceled_documents found')
documents = client.get_action_required_documents()
print(str(len(documents)) + ' action_required_documents found')
documents = client.get_waiting_for_others_documents()
print(str(len(documents)) + ' waiting_for_others_documents found')
documents = client.get_templates()
print(str(len(documents)) + ' templates found')
documents = client.get_archived_templates()
print(str(len(documents)) + ' archived_templates found')
documents = client.get_draft_templates()
print(str(len(documents)) + ' draft_templates found')
document = client.get_document_by_hash(config.document_hash)
print(document.document_hash)
client.download_final_document_to_path(document, './final.pdf', True)
client.download_raw_document_to_path(document, './raw.pdf')
for signer in document.signers:
try:
client.send_reminder_for_document(document, signer)
except Exception as e:
print('could not send reminder for ' + signer.email + ': ' + str(e))
try:
client.cancel_document(document)
except Exception as e:
print('could not cancel document: ' + str(e))
try:
client.delete_document(document)
except Exception as e:
print('could not delete document: ' + str(e))