Skip to content

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

Open

Description

@maaqib121

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?

Activity

  1. InbarGazit commented on Feb 1, 2021

    @InbarGazit
    Member
  2. InbarGazit commented on Feb 1, 2021

    @InbarGazit
    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)
    
  3. InbarGazit commented on Feb 1, 2021

    @InbarGazit
    Member

    Let me know if you need further assistance.

  4. maaqib121 commented on Feb 2, 2021

    @maaqib121
    Author

    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': 'f168324@nu.edu.pk',
                                      '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': 'm.aaqib@thedevden.co',
                                      '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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions