def get(self, request, envelope_id): envelopes_api = EnvelopesApi(get_api_client()) context = { 'envelope_recipients': envelopes_api.list_recipients(ACCOUNT_ID, envelope_id), 'envelope': envelopes_api.get_envelope(ACCOUNT_ID, envelope_id) } return render(request, 'envelopes/envelope_detail.html', context=context)
def get(self, request, envelope_id): envelopes_api = EnvelopesApi(get_api_client()) envelope = envelopes_api.get_envelope(ACCOUNT_ID, envelope_id) envelope.status = 'voided' envelope.voided_reason = 'changed my mind' envelope.purge_state = None envelopes_api.update(ACCOUNT_ID, envelope_id, envelope=envelope) SigEnvelope.objects.get(envelope_id=envelope_id).delete() return redirect('esign:envelope_list')
def worker(args): """ 1. Call the envelope get method """ # Exceptions will be caught by the calling function api_client = create_api_client(base_path=args["base_path"], access_token=args["access_token"]) envelope_api = EnvelopesApi(api_client) # 1. Call the envelope get method results = envelope_api.get_envelope(account_id=args["account_id"], envelope_id=args["envelope_id"]) return results
def testListTabs(self): # For this the template Role should be manager template_role_name = 'Manager' # Set properties and create an envelope later on email_subject = 'Please Sign my Python SDK Envelope' email_blurb = 'Hello, Please sign my Python SDK Envelope.' # assign template information including ID and role(s) template_id = TemplateId # create a template role with a valid templateId and roleName and assign signer info role_name = template_role_name name = 'Pat Developer' email = Username t_role = docusign.TemplateRole(role_name=role_name, name=name, email=email) # create a list of template roles and add our newly created role # assign template role(s) to the envelope template_roles = [t_role] # send the envelope by setting |status| to "sent". To save as a draft set to "created" status = 'sent' # create the envelope definition with the properties set envelope_definition = docusign.EnvelopeDefinition( email_subject=email_subject, email_blurb=email_blurb, template_id=template_id, template_roles=template_roles, status=status) try: envelopes_api = EnvelopesApi() # Create Envelope with the new role envelope_summary = envelopes_api.create_envelope( self.user_info.accounts[0].account_id, envelope_definition=envelope_definition) # Read the new Envelope created_envelope = envelopes_api.get_envelope( account_id=self.user_info.accounts[0].account_id, envelope_id=envelope_summary.envelope_id) recipients = envelopes_api.list_recipients( account_id=self.user_info.accounts[0].account_id, envelope_id=created_envelope.envelope_id) tabs = envelopes_api.list_tabs( account_id=self.user_info.accounts[0].account_id, envelope_id=created_envelope.envelope_id, recipient_id=recipients.signers[0].recipient_id) list_tabs = tabs.list_tabs assert list_tabs is not None except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception except Exception as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception