def download_email_original_file(self, email_id, certificate_id, path): connection = Connection(self.token) connection.set_url(self.production, self.EMAILS_ORIGINAL % (email_id, certificate_id)) response, headers = connection.file_request() if headers['content-type'] == 'application/json': return response f = open(path, 'w') f.write(response) f.close()
def download_audit_trail(self, signature_id, document_id, path): """ Get the audit trail of concrete document @signature_id: Id of signature @document_id: Id of document @path: Path where the document will be stored """ connection = Connection(self.token) connection.set_url(self.production, self.SIGNS_DOCUMENTS_AUDIT_URL % (signature_id, document_id)) response, headers = connection.file_request() if headers['content-type'] == 'application/json': return response f = open(path, 'w') f.write(response) f.close()