无效客户机
signrequest的Python项目详细描述
signrequest的api的非官方python客户端。
目前只支持我需要的两个特性 概念:
- 从base64编码的文件内容创建文档
- 发送文档的签名请求
如果我继续用这个我会包括测试和其他 特征。
功能
从base64编码的文档内容创建文档:
importbase64fromsignrequestimportSignRequestsr=SignRequest('API_KEY')withopen('/tmp/pdf-sample.pdf','rb')asfile:file_encoded_string=base64.b64encode(file.read())doc=sr.create_document(file=file_encoded_string,document_id='pdf_sample',document_name='pdf-sample.pdf')
为第一步中创建的文档发送签名请求:
sr.send_sign_request(from_email='john@johnssohn.com',message='Please sign this thing.',signers='james@jamessohn.com')# Can also be an array of emails
如果您有 url,在调用发送 签名请求:
fromsignrequestimportSignRequestdocument='https://signrequest.com/api/v1/documents/c27f3e0b-616a-4a74-9182-c00d4e3aa16a/'sr=SignRequest('API_KEY').send_sign_request(document=document,from_email='john@johnssohn.com',message='Please sign this thing.',signers=['a@eiou.com','z@yz.com'])