SHARE
TWEET

YotiSign multiple recipients

darker-chris Jul 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         email = {
  2.             'invitation': {
  3.                 'message': 'Please sign the test document', #email message
  4.             },
  5.         }
  6.  
  7.         recipients = [
  8.             {
  9.                 'name': 'Chris',
  10.                 'email': 'chris@taylor.name', #email here
  11.                 'role': 'Signee', #can specify any role
  12.                 'auth_type': 'sign-auth',
  13.                 'yoti_attributes': ['full_name','postal_address','selfie','phone_number','date_of_birth','gender','nationality'],
  14.                 'tags': [
  15.                     {
  16.                         'page_number': '1',
  17.                         'x': '0.3',
  18.                         'y': '0.4',
  19.                         'type': 'signature', #currently only signature is supported, x,y is the location on the pdf, page_number is page
  20.                     },
  21.                 ],
  22.             },
  23.             {
  24.                 'name': 'Chris (Alternate)',
  25.                 'email': 'chris@plumbingadvisory.com', #email here
  26.                 'role': 'Signee', #can specify any role
  27.                 'auth_type': 'no-auth',
  28.                 'tags': [
  29.                     {
  30.                         'page_number': '1',
  31.                         'x': '0.3',
  32.                         'y': '0.4',
  33.                         'type': 'signature', #currently only signature is supported, x,y is the location on the pdf, page_number is page
  34.                     },
  35.                 ],
  36.             }
  37.         ]
  38.         headers = {'authorization': "Bearer {0}".format(darkersign)}
  39.         files = {
  40.             'file': ('example', open ('s3://assets.pichow.cloud/cast-15.pdf', 'rb', transport_params=transport_params))
  41.             #'file': ('example', open ('cast-15.pdf', 'rb'))
  42.         }
  43.         payload = {
  44.             'file_name': 'Test S3 Stream', #name to call file
  45.             'email': json.dumps(email), #parsed from email object
  46.             'recipients': json.dumps(recipients), #parsed from recipients array
  47.         }
  48.         print ('YOTI CREATE SIGN REQUEST')
  49.         try:
  50.             r = requests.post(url, files=files, headers=headers, data=payload)
  51.             print(r)
  52.             print('response json')
  53.             print(r.json())
  54.             r.raise_for_status()
  55.         except Exception as e:
  56.             print ('ERROR MAKING REQUEST')
  57.             print (e)
  58.         print ('YOTI CREATE SIGN REQUEST DONE')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top