Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update an envelope and change it's status from 'sent' to 'voided' #99

Open
maaqib121 opened this issue Feb 1, 2021 · 4 comments

Comments

@maaqib121
Copy link

maaqib121 commented Feb 1, 2021

I want to implement an option to delete envelope in my application. For that I want to alter the envelope's status from 'send' to 'voided', but currently I haven't found any suitable method to do this. Is there any?

@InbarGazit
Copy link
Member

@InbarGazit
Copy link
Member

# You would need to obtain an accessToken using your chosen auth flow 
api_client = ApiClient()
api_client.host = base_path
api_client.set_default_header('Authorization', 'Bearer ' + access_token)
envelopes_api = EnvelopesApi(api_client)
env = Envelope()
env.status = 'voided'
env.voided_reason = 'changed my mind'
envelopes_api.update(account_id, envelope_id, env)

@InbarGazit
Copy link
Member

Let me know if you need further assistance.

@maaqib121
Copy link
Author

maaqib121 commented Feb 2, 2021

Thanks, the issue is resolved.

Before calling the update method, we also have to change the purge_state of envelope to None, otherwise it return 400 Bad Request response. My issue is resolved by using the following code:

env = Envelope()
env.status = 'voided'
env.voided_reason = 'changed my mind'
env.purge_state = None
envelopes_api.update(account_id, envelope_id, envelope=env)

I have another question that when I send an envelope to bulk recipients, I get the following response from bulk_envelopes_api.create_bulk_send_list(ACCOUNT_ID, bulk_sending_list=bulk_sending_list) method:

{'bulk_copies': [{'custom_fields': [],
                  'email_blurb': None,
                  'email_subject': None,
                  'recipients': [{'access_code': None,
                                  'client_user_id': None,
                                  'custom_fields': None,
                                  'delivery_method': None,
                                  'email': '[email protected]',
                                  'email_notification': None,
                                  'embedded_recipient_start_url': None,
                                  'fax_number': None,
                                  'id_check_configuration_name': None,
                                  'id_check_information_input': None,
                                  'identification_method': None,
                                  'name': 'Aaqib 1',
                                  'note': None,
                                  'phone_authentication': None,
                                  'recipient_id': '1',
                                  'recipient_signature_providers': None,
                                  'role_name': None,
                                  'sms_authentication': None,
                                  'social_authentications': None,
                                  'tabs': None}]},
                 {'custom_fields': [],
                  'email_blurb': None,
                  'email_subject': None,
                  'recipients': [{'access_code': None,
                                  'client_user_id': None,
                                  'custom_fields': None,
                                  'delivery_method': None,
                                  'email': '[email protected]',
                                  'email_notification': None,
                                  'embedded_recipient_start_url': None,
                                  'fax_number': None,
                                  'id_check_configuration_name': None,
                                  'id_check_information_input': None,
                                  'identification_method': None,
                                  'name': 'Aaqib 2',
                                  'note': None,
                                  'phone_authentication': None,
                                  'recipient_id': '2',
                                  'recipient_signature_providers': None,
                                  'role_name': None,
                                  'sms_authentication': None,
                                  'social_authentications': None,
                                  'tabs': None}]}],
 'list_id': '20e7d94d-5c21-4b5f-9c92-5b8d1c793dda',
 'name': 'employee_contract'}

And the following response from batch = bulk_envelopes_api.create_bulk_send_request(ACCOUNT_ID, bulk_list_id, bulk_send_request=bulk_send_request) method:

{'batch_id': 'e6a604dd-c965-4c4c-9eb9-d7f58e8b58c4',
 'batch_name': 'employee_contract',
 'batch_size': '2',
 'envelope_or_template_id': 'a40b8d8d-1125-42e5-b476-281339e72dc8',
 'error_details': None,
 'errors': None,
 'queue_limit': '2000',
 'total_queued': '2'}

How can I get the envelope_id for each envelope sent to each recipient? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants