-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetAgreementsForUser_V5.py
More file actions
23 lines (22 loc) · 930 Bytes
/
Copy pathgetAgreementsForUser_V5.py
File metadata and controls
23 lines (22 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Gets agreements available to a user in account (same data as 'manage page' in webUI)
Usage:
token_string = '3AAABLblqZhC2YTAO******* Your integration key or access token ************ohF9DaLV-4GKbLuiM-0lmTtSq'
sender_email = 'skaboy71@gmail.com'
user_agreement_list = list_agreements(token_string, sender_email)
pprint(user_agreement_list)
pprint(user_agreement_list[0]['displayUserSetInfos'][0]['displayUserSetMemberInfos'][0]['email'])
"""
import requests
import json
from pprint import pprint # if needed for pprint
def list_agreements(token_string, sender_email):
shard = 'na1'
baseUrl = 'https://api.' + shard + '.echosign.com/api/rest/v5'
agUrl = baseUrl + '/agreements'
headers = {
'Access-Token': token_string, # Your access token or integration key here.
'x-user-email': sender_email
}
url = agUrl
return requests.get(url, headers=headers).json().get('userAgreementList')