Giter Site home page Giter Site logo

docusign / docusign-esign-python-client Goto Github PK

View Code? Open in Web Editor NEW
93.0 25.0 88.0 16.92 MB

The Official DocuSign Python Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client. https://www.docusign.com/devcenter

License: MIT License

Python 100.00% Shell 0.01%
docusign-api docusign-python-client docusign docusign-rest electronic-signatures digital-signature esignature sdk

docusign-esign-python-client's Introduction

The Official DocuSign eSignature Python Client SDK

PyPI version

Build status

PyPI module

Documentation about DocuSign APIs

Requirements

Compatibility

  • Python 2.7+

Installation

This SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our code examples from the DocuSign Developer Center, you merely need to install it by following the instructions below.

Path setup:

  1. Locate your Python installation, also referred to as a site-packages folder. This folder is usually labeled in a format of Python{VersionNumber}.
    Examples:

    • Unix/Linux: /usr/lib/python2.7
    • Mac: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
    • Windows: C:\Users{username}\AppData\Local\Programs\Python\Python37
  2. Add your Python folder’s path to your system as an environment variable.
    Unix/Linux:

    1. Type the following command into your console:
      export PYTHONPATH = "${PYTHONPATH}:.:/path/to/site-packages"
    2. Optionally, you can add this command to your system profile, which will run the command each time Python is launched.

    Windows:

    1. Open the Windows Control Panel.
    2. Under the System and Security category, open the System information panel.
    3. Select Advanced System Settings to open the System Properties dialog box.
    4. On the Advanced tab, select the Environment Variables button at the lower-right corner.
      1. Check to see whether PYTHONPATH has been added as a system variable.
      2. If it has not, select New to add it. The variable you add is the path to the site-packages folder.

Note: If you are still unable to reference Python or pip via your command console, you can also add the path to the site-packages folder to the built-in environment variable labeled Path, which will take effect the next time you start your machine.

Install via PIP:

In your command console, type: pip install docusign-esign
Note: This may require the command console to be elevated. You can accomplish this via sudo in Unix/Linux, or by running the command console as an administrator in Windows.

Dependencies

This client has the following external dependencies:

  • certifi v14.05.14+
  • six v1.8.0+
  • python_dateutil v2.5.3+
  • setuptools v21.0.0+
  • urllib3 v1.15.1+
  • jwcrypto v0.4.2+
  • py-oauth2 v0.0.10+

Code examples

You can find on our GitHub a self-executing package of code examples for the eSignature Python SDK, called a Launcher, that demonstrates common use cases. You can also download a version preconfigured for your DocuSign developer account from Quickstart. These examples can use either the Authorization Code Grant or JSON Web Token (JWT) authentication workflows.

OAuth implementations

For details regarding which type of OAuth grant will work best for your DocuSign integration, see Choose OAuth Type in the DocuSign Developer Center.

For security purposes, DocuSign recommends using the Authorization Code Grant flow.

Support

Log issues against this client through GitHub. We also have an active developer community on Stack Overflow.

License

The DocuSign eSignature Python Client SDK is licensed under the MIT License.

Additional resources

docusign-esign-python-client's People

Contributors

asif-docusign avatar dbbrahmbhatt avatar eleanorharris avatar ergin008 avatar garg-mudit avatar gsnavin avatar harsharahul avatar hobbyprojects avatar inbargazit avatar kenharris avatar larryklugerds avatar mattkingds avatar mmallis87 avatar paigesrossi avatar raileendr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docusign-esign-python-client's Issues

Envelope created from template does not fill in data fields

I'm trying to create an envelope via template but I am unable to populate the fields in the documents with data provided. From the docs, I'm assuming that I have to do this via Tabs. My request goes thru without error, but the data never populates. The envelope ID attached is one of my attempts. Also I've attached the dict representation of the Envelope Definition via the Python SDK, if that helps:

{'_lock_information': None, '_brand_id': None, '_created_date_time': None, '_enforce_signer_visibility': None, '_documents_combined_uri': None, '_allow_recipient_recursion': None, '_allow_markup': None, '_accessibility': None, '_is21_cfr_part11': None, '_custom_fields_uri': None, '_composite_templates': None, '_template_id': 'f4113d01-e6b9-423a-b6ba-2139270d2887', '_declined_date_time': None, '_attachments_uri': None, '_brand_lock': None, '_authoritative_copy': None, '_documents_uri': None, '_status': 'sent', '_asynchronous': None, '_recipients_lock': None, '_email_settings': None, '_recipients_uri': None, '_documents': None, '_recipients': None, '_allow_reassign': None, '_envelope_id': None, '_voided_date_time': None, '_email_blurb': None, '_status_changed_date_time': None, '_enable_wet_sign': None, '_initial_sent_date_time': None, '_purge_state': None, '_use_disclosure': None, '_delivered_date_time': None, '_envelope_uri': None, 'swagger_types': {'completed_date_time': 'str', 'allow_markup': 'str', 'enable_wet_sign': 'str', 'created_date_time': 'str', 'message_lock': 'str', 'brand_id': 'str', 'status_changed_date_time': 'str', 'enforce_signer_visibility': 'str', 'authoritative_copy': 'str', 'recipients_lock': 'str', 'use_disclosure': 'str', 'allow_recipient_recursion': 'str', 'template_roles': 'list[TemplateRole]', 'is21_cfr_part11': 'str', 'certificate_uri': 'str', 'delivered_date_time': 'str', 'deleted_date_time': 'str', 'documents_uri': 'str', 'voided_date_time': 'str', 'transaction_id': 'str', 'brand_lock': 'str', 'recipients': 'Recipients', 'custom_fields_uri': 'str', 'composite_templates': 'list[CompositeTemplate]', 'password': 'str', 'envelope_id': 'str', 'allow_reassign': 'str', 'templates_uri': 'str', 'initial_sent_date_time': 'str', 'email_subject': 'str', 'template_id': 'str', 'attachments_uri': 'str', 'attachments': 'list[Attachment]', 'last_modified_date_time': 'str', 'accessibility': 'str', 'asynchronous': 'str', 'email_settings': 'EmailSettings', 'custom_fields': 'CustomFields', 'event_notification': 'EventNotification', 'documents_combined_uri': 'str', 'documents': 'list[Document]', 'sent_date_time': 'str', 'notification': 'Notification', 'notification_uri': 'str', 'recipients_uri': 'str', 'auto_navigation': 'str', 'lock_information': 'LockInformation', 'envelope_id_stamping': 'str', 'signing_location': 'str', 'status': 'str', 'declined_date_time': 'str', 'voided_reason': 'str', 'email_blurb': 'str', 'is_signature_provider_envelope': 'str', 'envelope_uri': 'str', 'purge_state': 'str'}, '_password': None, '_certificate_uri': None, '_envelope_id_stamping': None, '_notification': None, '_is_signature_provider_envelope': None, '_transaction_id': None, '_last_modified_date_time': None, '_email_subject': None, '_auto_navigation': None, '_custom_fields': None, '_completed_date_time': None, 'attribute_map': {'completed_date_time': 'completedDateTime', 'allow_markup': 'allowMarkup', 'enable_wet_sign': 'enableWetSign', 'created_date_time': 'createdDateTime', 'message_lock': 'messageLock', 'brand_id': 'brandId', 'status_changed_date_time': 'statusChangedDateTime', 'enforce_signer_visibility': 'enforceSignerVisibility', 'authoritative_copy': 'authoritativeCopy', 'recipients_lock': 'recipientsLock', 'use_disclosure': 'useDisclosure', 'allow_recipient_recursion': 'allowRecipientRecursion', 'template_roles': 'templateRoles', 'is21_cfr_part11': 'is21CFRPart11', 'certificate_uri': 'certificateUri', 'delivered_date_time': 'deliveredDateTime', 'deleted_date_time': 'deletedDateTime', 'documents_uri': 'documentsUri', 'voided_date_time': 'voidedDateTime', 'transaction_id': 'transactionId', 'brand_lock': 'brandLock', 'recipients': 'recipients', 'custom_fields_uri': 'customFieldsUri', 'composite_templates': 'compositeTemplates', 'password': 'password', 'envelope_id': 'envelopeId', 'allow_reassign': 'allowReassign', 'templates_uri': 'templatesUri', 'initial_sent_date_time': 'initialSentDateTime', 'email_subject': 'emailSubject', 'template_id': 'templateId', 'attachments_uri': 'attachmentsUri', 'attachments': 'attachments', 'last_modified_date_time': 'lastModifiedDateTime', 'accessibility': 'accessibility', 'asynchronous': 'asynchronous', 'email_settings': 'emailSettings', 'custom_fields': 'customFields', 'event_notification': 'eventNotification', 'documents_combined_uri': 'documentsCombinedUri', 'documents': 'documents', 'sent_date_time': 'sentDateTime', 'notification': 'notification', 'notification_uri': 'notificationUri', 'recipients_uri': 'recipientsUri', 'auto_navigation': 'autoNavigation', 'lock_information': 'lockInformation', 'envelope_id_stamping': 'envelopeIdStamping', 'signing_location': 'signingLocation', 'status': 'status', 'declined_date_time': 'declinedDateTime', 'voided_reason': 'voidedReason', 'email_blurb': 'emailBlurb', 'is_signature_provider_envelope': 'isSignatureProviderEnvelope', 'envelope_uri': 'envelopeUri', 'purge_state': 'purgeState'}, '_attachments': None, '_template_roles': [{'access_code': None, 'client_user_id': None, 'default_recipient': None, 'email': u'[email protected]', 'email_notification': None, 'embedded_recipient_start_url': None, 'in_person_signer_name': None, 'name': u'Jeffrey Negro', 'recipient_signature_providers': None, 'role_name': 'Signer 1', 'routing_order': None, 'signing_group_id': None, 'tabs': {'approve_tabs': None, 'checkbox_tabs': None, 'company_tabs': None, 'date_signed_tabs': None, 'date_tabs': None, 'decline_tabs': None, 'email_address_tabs': None, 'email_tabs': None, 'envelope_id_tabs': None, 'first_name_tabs': None, 'formula_tabs': None, 'full_name_tabs': None, 'initial_here_tabs': None, 'last_name_tabs': None, 'list_tabs': None, 'note_tabs': None, 'number_tabs': None, 'radio_group_tabs': None, 'sign_here_tabs': None, 'signer_attachment_tabs': None, 'ssn_tabs': None, 'text_tabs': [{u'tab_label': u'Email', u'value': u'[email protected]'}, {u'tab_label': u'Fee', u'value': '4000'}, {u'tab_label': u'Hotel Name', u'value': u'International House'}, {u'tab_label': u'Hotel Address', u'value': u'221 Camp Street, New Orleans, LA, 70130, USA'}, {u'tab_label': u'Name', u'value': u'Jeffrey Negro'}, {u'tab_label': u'Invoice Number', u'value': u'TP93201811'}, {u'tab_label': u'Privilege 1', u'value': 'Complimentary upgrade upon hotel check-in, based upon availability'}, {u'tab_label': u'Privilege 2', u'value': 'Guaranteed 4pm check-out'}, {u'tab_label': u'Privilege 3', u'value': u'One complimentary clothing press (1 item) during your stay (a value of about $5)'}, {u'tab_label': u'Privilege 4', u'value': u'One complimentary glass of champagne or one cocktail, per guest, upon arrival (depending on drink, a value of about $8 to $15 per drink)'}, {u'tab_label': u'Privilege 5', u'value': u''}, {u'tab_label': u'Privilege 6', u'value': u''}, {u'tab_label': u'Privilege 7', u'value': u''}], 'title_tabs': None, 'view_tabs': None, 'zip_tabs': None}}], '_notification_uri': None, '_deleted_date_time': None, '_signing_location': None, '_templates_uri': None, '_message_lock': None, '_voided_reason': None, '_event_notification': None, '_sent_date_time': None}

configure_jwt_authorization_flow() does not honor the explicit OAuth grants via oauth URL. Throws 'Consent Required" error

Despite granting access by logging in using the URL given by oauth_login_url below, the subsequent "api_client.configure_jwt_authorization_flow" call always results in 'consent_required' error. The corresponding integrator key is set up with right redirect URI and key pair (of which I use the private key as private_key_filename below). However, using the test parameters (user_id, integrator key, etc) from the unit_test works fine. There is some other nuance or detail that is explicitly missing in the example or prerequisites. Note that the account is not associated to any Organization yet. I am not yet there. But I would expect this basic flow to work as is.

oauth_login_url = api_client.get_jwt_uri(integrator_key, redirect_uri, oauth_base_url)

print(oauth_login_url)

       https://account-d.docusign.com/oauth/auth?response_type=code&client_id=<integrator_key>&scope=signature%2Bimpersonation&redirect_uri=https%3A%2F%2Fwww.docusign.com%2Fapi

api_client.configure_jwt_authorization_flow(private_key_filename, oauth_base_url, integrator_key, user_id, 3600)

  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/userme/projects/docudocu/lib/python2.7/site-packages/docusign_esign/api_client.py", line 118, in configure_jwt_authorization_flow
    post_params=self.sanitize_for_serialization({"assertion": assertion, "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer"}))
  File "/Users/userme/projects/docudocu/lib/python2.7/site-packages/docusign_esign/api_client.py", line 418, in request
    body=body)
  File "/Users/userme/projects/docudocu/lib/python2.7/site-packages/docusign_esign/rest.py", line 244, in POST
    body=body)
  File "/Users/userme/projects/docudocu/lib/python2.7/site-packages/docusign_esign/rest.py", line 200, in request
    raise ApiException(http_resp=r)

    docusign_esign.rest.ApiException: (400)
    Reason: Bad Request
    HTTP response headers: HTTPHeaderDict({'X-DocuSign-Node': 'CH1DFE2', 'Content-Length': '28', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'Content-Type': 'application/json; charset=utf-8', 'Expires': '-1', 'Content-Security-Policy-Report-Only': "script-src 'unsafe-inline' 'unsafe-eval' 'self';style-src 'unsafe-inline' 'self';img-src https://docucdn-a.akamaihd.net/ 'self';font-src 'self';connect-src 'self';object-src 'none';media-src 'none';frame-src 'none';frame-ancestors 'none';report-uri /client-errors/csp", 'X-XSS-Protection': '1; mode=block', 'X-DocuSign-TraceToken': 'b009b0a6-19ad-4e58-844e-76fc5b509cbb', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Date': 'Wed, 29 Nov 2017 22:52:10 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'X-AspNetMvc-Version': '5.2'})
    HTTP response body: {"error":"consent_required"}

(Note: Also asked a question here https://stackoverflow.com/questions/47563725/getting-consent-required-error-despite-successful-permission-grant-using-oauth )

Test failure due to undocumented required environmental variable $PRIVATE_KEY

The tests fail due to the following:

File "/home/marshjo/Documents/clarity-docusign/docusign-python-client/test/unit_tests.py", line 22, in <module>
    PrivateKeyBytes = base64.b64decode(os.environ.get("PRIVATE_KEY"))

I suspect that is because your default internal setup includes this. Please add a "Testing" section to the README to cover testing requirements.

Calling EnvelopesApi.list_tabs generates an exception

Calling list_tabs from the EnvelopesApi is generating the following error. When it gets the response from the API and trying to parse the data, it is passing the entire dataTabs object into self._deserialize instead of iterating through it

Traceback (most recent call last):
  File "docu.py", line 60, in <module>
    envelope_data = envelopes_api.list_tabs(account_Id,envelope_id,1)
  File "docusign-python-client-master\docusign_esign\apis\envelopes_api.py", line 6708, in list_tabs
    (data) = self.list_tabs_with_http_info(account_id, envelope_id, recipient_id, **kwargs)
  File "docusign-python-client-master\docusign_esign\apis\envelopes_api.py", line 6804, in list_tabs_with_http_info
    collection_formats=collection_formats)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 389, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 216, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 298, in deserialize
    return self.__deserialize(data, response_type)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 342, in __deserialize
    return self.__deserialize_model(data, klass)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 696, in __deserialize_model
    setattr(instance, attr, self.__deserialize(value, attr_type))
  File "docusign-python-client-master\docusign_esign\api_client.py", line 319, in __deserialize
    for sub_data in data]
  File "docusign-python-client-master\docusign_esign\api_client.py", line 319, in <listcomp>
    for sub_data in data]
  File "docusign-python-client-master\docusign_esign\api_client.py", line 338, in __deserialize
    return self.__deserialize_date(data)
  File "docusign-python-client-master\docusign_esign\api_client.py", line 644, in __deserialize_date
    return parse(string).date()
  File "AppData\Local\Programs\Python\Python37-32\lib\site-packages\dateutil\parser\_parser.py", line 1356, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "AppData\Local\Programs\Python\Python37-32\lib\site-packages\dateutil\parser\_parser.py", line 645, in parse
    res, skipped_tokens = self._parse(timestr, **kwargs)
  File "AppData\Local\Programs\Python\Python37-32\lib\site-packages\dateutil\parser\_parser.py", line 721, in _parse
    l = _timelex.split(timestr)         # Splits the timestr into tokens
  File "AppData\Local\Programs\Python\Python37-32\lib\site-packages\dateutil\parser\_parser.py", line 207, in split
    return list(cls(s))
  File "AppData\Local\Programs\Python\Python37-32\lib\site-packages\dateutil\parser\_parser.py", line 76, in __init__
    '{itype}'.format(itype=instream.__class__.__name__))
TypeError: Parser must be a string or character stream, not dict

in accounts api - update_brand_resources_by_content_type not working

the method receives account id, brand id, and resource content type but there is not option to add the file itself.

according to the REST api documentation:

AccountBrands: updateResource
This method updates a branding resource file.

You pass in the new version of the resource file in the Content-Disposition header. Example:

Content-Disposition: form-data; name="file"; filename="DocuSign_SigningResource_4328673.xml"

but in the SDK there is no option to update the header params

Documents with the same file name can collide when downloaded

Hello!

We ran into an issue where downloading a document using get_document and then reading it sometimes returns the wrong contents if we also downloaded another document with the same name, even if it's for a different envelope. __deserialize_file might be the culprit:

path = os.path.join(os.path.dirname(path), filename)

It looks like the client doesn't use the file name returned from mkstemp and appends the name of our file to the temp file's directory to create the path instead. If the path already exists, open(path, "wb") just truncates it before writing new content.

request_jwt_user_token error that can't decode a string

function request_jwt_user_token

following line gives an error
token = jwt.encode(payload=claim, key=private_key_bytes, algorithm='RS256').decode("utf-8")

"stackTrace": [
"Traceback (most recent call last):\n",
" my_file_that_uses_the_docusign_api line something",
" File "/var/task/docusign_esign/client/api_client.py", line 689, in request_jwt_user_token\n token = jwt.encode(payload=claim, key=private_key_bytes, algorithm='RS256').decode("utf-8")\n",
"AttributeError: 'str' object has no attribute 'decode'\n"

How can I pass a document to the envelopes_api's update_document

It appears to be missing the actual functionality of uploading a document. I might have a misunderstanding of the purpose of this method, but if it is intended for uploading a document, I can't see how. There is no parameter in the method signature which would include a document payload, and the kwargs are filtered for a set of parameters that don't seem to include a document either. At a glance, I can't see any way that the body of the api call in the called method could be set with a document.

move test directory to be inside the docusign_esign directory

This isn't really a bug. But when the docusign package is installed the test directory is placed at the same level as all the other site-packages in a Python installation. If other packages did the same thing and placed their test directories at the same level then I don't know what would happen but it's probably not good.

Trouble adding Custom Field Values to Envelope Definition

I'm having trouble setting the values for the custom fields in my envelope. There isn't an example for the Python SDK, but I have found others doing something similar in the other SDK's. Setting the custom_fields property on the envelope definition still allows the initiation of a signing, but the values are not shown to the signer. I can also see the custom fields when I print the envelope definition. Here is how I'm doing it (the rest of the omitted code is directly from the readme outside of adding some additional roles):

patient_first_name = TextCustomField(name='PatientFirstName', value='Allen', show='true',
                                     required='true')
patient_last_name = TextCustomField(name='PatientLastName', value='Elks', show='true',
                                    required='true')
custom_fields = CustomFields(text_custom_fields=[patient_first_name, patient_last_name])

envelope_definition.custom_fields = custom_fields

Example from the Java SDK

I can obviously provide the rest of the code if needed. Thanks!

Calling EnvelopesApi#update_document_tabs returns an error

Hello!

I'd like to figure out why the following code returns an error from the server:

envelope_tabs = envelopes_api.get_document_tabs(ACCOUNT_ID, document_id, envelope_id)

envelopes_api.update_document_tabs(ACCOUNT_ID, document_id, envelope_id, tabs=envelope_tabs)

The following error gets returned:

{"errorCode":"INVALID_TAB_OPERATION","message":"The Tab specified is not valid for the requested operation. Updated tabs must all be Strikethrough or SmartSection tabs if you\'re not specifying a valid recipient."}

In reality I'm trying to modify some tabs before doing the update, but I removed that code to eliminate that as the source of the issue before reproducing this.

I understand that I can also use EnvelopesApi#update_tabs to separately update tabs for each recipient, but is there a way to call update_document_tabs and update everything at once?

require_id_lookup does nothing

It appears that when id_check_configuation_name is set to a value (ex. ID Check), require_id_lookup does nothing to enable or disable ID check. According to the docs, you need both. The result of seeing ID Check is independent of any value for require_id_lookup when I set id_check_configuration_name, require_id_lookup can be set to "true" or "false" or not appear at all, and I get the same result of having id check. Am I interpreting the documentation wrong? Has the api changed? Is this a bug?

FolderResponse handling from move_envelopes() raises exception

Calling move_envelopes() from the FoldersApi successfully moves the envelopes as desired, but the response generates the exception and traceback below.

The data attribute of the response (FolderResponse) is empty, which I think is okay, but because it is data=b'' instead of data=None, __deserialize_model() (api_client.py) tries to handle it and raises the exception below.

I've also included a screenshot of my debugger where the data attribute is initially populated (to demonstrate that it is coming from the API like this).

  File "ve/app/scripts/main.py", line 116, in process_documents
    data = folders_api.move_envelopes(account_id, processed_folder_id, folders_request=folders_request)
  File "ve/lib/python3.5/site-packages/docusign_esign/apis/folders_api.py", line 333, in move_envelopes
    (data) = self.move_envelopes_with_http_info(account_id, folder_id, **kwargs)
  File "ve/lib/python3.5/site-packages/docusign_esign/apis/folders_api.py", line 420, in move_envelopes_with_http_info
    collection_formats=collection_formats)
  File "ve/lib/python3.5/site-packages/docusign_esign/api_client.py", line 385, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "ve/lib/python3.5/site-packages/docusign_esign/api_client.py", line 216, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "ve/lib/python3.5/site-packages/docusign_esign/api_client.py", line 298, in deserialize
    return self.__deserialize(data, response_type)
  File "ve/lib/python3.5/site-packages/docusign_esign/api_client.py", line 338, in __deserialize
    return self.__deserialize_model(data, klass)
  File "ve/lib/python3.5/site-packages/docusign_esign/api_client.py", line 686, in __deserialize_model
    and instance.attribute_map[attr] in data \
TypeError: a bytes-like object is required, not 'str'

image

unicode bug in envelope_api.get_document

v. 3.4.0

Problem file name had Unicode character in it: Minutes of: Arise & Shine🌤.pdf

our code looks something like this and works for non unicode named documents.

temp_file = self.envelope_api.get_document(
            account_id=self.account_id,
            document_id=(int),
            envelope_id=(int)
        )

/usr/local/lib/python3.6/dist-packages/docusign_esign/client/api_client.py:574 
in __deserialize_file/usr/local/lib/python3.6/dist-packages/docusign_esign/client/api_client.py:256 
in deserialize/usr/local/lib/python3.6/dist-packages/docusign_esign/client/api_client.py:186 
in __call_api/usr/local/lib/python3.6/dist-packages/docusign_esign/client/api_client.py:354 
in call_api/usr/local/lib/python3.6/dist-packages/docusign_esign/apis/envelopes_api.py:5274 
in get_document_with_http_info/usr/local/lib/python3.6/dist-packages/docusign_esign/apis/envelopes_api.py:5157 
in get_document/PROJECT_ROOT/cloud/integrations/signature.py:302 in download_file

--

No documentation on private_key_filename.txt

I'm setting up the python API and I can't see any resources on how to populate the private_key_filename.txt file.

I have a private key, but a private_key_filename.txt file containing just the key will cause errors. Can somebody add some docs on this? Thanks

Default Base url is not working

Hi,

I've tried this SDK on live production Docusign and the host "www.docusign_esign.net" is unable to be accessed. It is hardcoded in the SDK in configuration.py>class Configuration and line 48. My manager checked the PHP SDK and found out there is a different default base url there. So I believe that we are using incorrect default base url for Python and this host is not working.

Could you please kindly review?

Thank you

How to assign SignHere Tabs in Bulk Send Envelope

I have set up every other thing for bulk send and it's working pretty nicely. Following is the placeholder snippet which is being replaced by the original recipients in the bulk list:

        signer = Signer(name='Multi Bulk Recipient::signer', email='[email protected]',
                        role_name='signer', note='', routing_order='1', status='created', delivery_method='email',
                        recipient_id='13', recipient_type='signer')
        sign_here = SignHere(anchor_string='**Employee Signature**', anchor_units='pixels',
                             anchor_y_offset='10', anchor_x_offset='20')
        signer.tabs = Tabs(sign_here_tabs=[sign_here])

       envelope_api.create_recipient(ACCOUNT_ID, envelope_id, recipients=Recipients(signers=[signer]))

But it is not creating the SignHere tab in the document. This same code was working in case of single envelope but that's not the case here. Can anyone help?

Cannot add multiple documents to an envelope

As shown in the tests, I can add a document to an envelope definition

doc = docusign.Document() #base64_doc = base64.b64encode(file_contents).decode("utf-8") doc.document_base64 = f doc.name = 'TestFile.pdf' doc.document_id = '1' envelope_definition.documents = [doc]

However, if I add a second document either by appending the document to the documents list or defining the list with both documents, the second document does not show up.

Is there only one document allowed, is there another way to add a document or is this a bug?

jwt request token issue

docusign version 3.1.0 , pthon version 3.5 and 3.6 in sandbox mode .
getting following error
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //account-d.docusign.com/oauth/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa77f6c8dd8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

i have followed the curl request using following url JSON Web Token (JWT) Grant

i got a access token
got an application token and while passing in auth giving me 401(401 UNAUTHORIZED
) error
postman
token image

>claim = {"iss": '4556e2f7-4a3d-41f9-a0c3-18535a28ab2a', "aud": 'account-d.docusign.com', "iat": now, "exp": later, "scope": " ".join(scopes)} token = jwt.encode(payload=claim, key=pkey, algorithm='RS256').decode("utf-8")
i getting application token using above code but when i pass all the required parameter i got {"error":"invalid_grant","error_description":"no_valid_keys_or_signatures"} but when i pasted my jwt token in jwt.io with my public and privte key its says signature verified.

tonen image
jwt io image

TypeError: the JSON object must be str, bytes or bytearray, not NoneType

File "C:\Users\dofus\OneDrive\Bureau\Athena-master\itemshop.py", line 409, in
Athena.main(Athena)
File "C:\Users\dofus\OneDrive\Bureau\Athena-master\itemshop.py", line 24, in main
initialized = Athena.LoadConfiguration(self)
File "C:\Users\dofus\OneDrive\Bureau\Athena-master\itemshop.py", line 60, in LoadConfiguration
configuration = json.loads(Utility.ReadFile(self, "configuration", "json"))
File "C:\Users\dofus\AppData\Local\Programs\Python\Python38-32\lib\json_init_.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

GET Template calls failing

Template get (a call I've made hundreds of times before with the same code*) is failing deep in the docusign code.

Any suggestions on what is going bump in the night?

*pre-docusign-python-client update

Traceback (most recent call last):
File "/var/task/handler.py", line 117, in get_templates
result = Template(api_client).get(event)
File "/var/task/template.py", line 152, in get
raise ex
File "/var/task/template.py", line 146, in get
Template.accountID, template_id).to_dict()
File "/var/task/docusign_esign/apis/templates_api.py", line 2291, in get
(data) = self.get_with_http_info(account_id, template_id, **kwargs)
File "/var/task/docusign_esign/apis/templates_api.py", line 2378, in get_with_http_info
collection_formats=collection_formats)
File "/var/task/docusign_esign/client/api_client.py", line 354, in call_api
_return_http_data_only, collection_formats, _preload_content, _request_timeout)
File "/var/task/docusign_esign/client/api_client.py", line 184, in __call_api
return_data = self.deserialize(r, response_type)
File "/var/task/docusign_esign/client/api_client.py", line 264, in deserialize
return self.__deserialize(data, response_type)
File "/var/task/docusign_esign/client/api_client.py", line 307, in __deserialize
return self.__deserialize_model(data, klass)
File "/var/task/docusign_esign/client/api_client.py", line 657, in __deserialize_model
setattr(instance, attr, self.__deserialize(value, attr_type))
File "/var/task/docusign_esign/client/api_client.py", line 307, in __deserialize
return self.__deserialize_model(data, klass)
File "/var/task/docusign_esign/client/api_client.py", line 657, in __deserialize_model
setattr(instance, attr, self.__deserialize(value, attr_type))
File "/var/task/docusign_esign/client/api_client.py", line 294, in __deserialize
klass = getattr(client, klass)
AttributeError: module 'docusign_esign.client' has no attribute 'UserInfo'
module 'docusign_esign.client' has no attribute 'UserInfo'

simplified code

from docusign_esign import TemplatesApi
template_api = TemplatesApi(Template.api_client)
def function_in_question():
    return template_api.get(accountID, template_id).to_dict()

Incorrect exception type raised

I had an error where my RSA private key was not being loaded. In api_client.py:679, I would expect an ArgumentException to be raised. However, due to the way the exception is raised, I am getting a TypeError exception pointing to api_exception.py:56 instead. (Note that there are other scenarios that raise exceptions that will similarly cause problems.)

Traceback (most recent call last):
...
File "/usr/local/lib/python3.8/dist-packages/docusign_esign/client/api_client.py", line 679, in request_jwt_user_token
raise ArgumentException("Private key not supplied or is invalid!")
File "/usr/local/lib/python3.8/dist-packages/docusign_esign/client/api_exception.py", line 56, in init
super(Exception).init(*args, **kwargs)
TypeError: super() argument 1 must be type, not str"

Cleanup git tags and branches

Hello,

I'm looking to package this project in guix. It looks like there is some ambiguity in whether v3.1 is in RC2 or for general use between the names between branches and tags. Could someone please clear up what's what with tags and branches? I'm not sure what commit I should be packaging.

Better model constructor for EnvelopeEvent and RecipientEvent

Thanks for this great work!

Just a comment here:
is it possible to change the constructor parameters of RecipientEvent, to match with EnvelopeEvent please?

For example, the RecipientEvent object accepts first include_documents, and then recipient_event_status_code.
Otherwise, the parameters to instanciate an EnvelopeSent object are, first recipient_event_status_code, and then include_documents.

For me, as those objects correspond to the same logic, for a Recipient and for an Envelope, the parameters order should match (I spent maybe 10 minutes in solving a Rest API problem, just because I didn't care about the position of the parameters for RecipientEvent, as I used before the object EnvelopeEvent...).

envelope_api update_recipients recipients The request body is missing or improperly formatted. Could not cast or convert from System.String to API_REST.Models.v2_1.recipients.

Hi all,

Could anyone potentially show an example of how to use the envelope api's update recipients method for updating a recipient? I believe I should be passing an array of dictionaries to recipients but not matter how I format it (from json to a list containing dictionaries) I could an error specifying the body is missing or improperly formatted OR the request body is missing or improperly formatted. Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'API_REST.Models.v2_1.recipients'. Any help would be appreciated as I simply am trying to engineer a way to resend an email if the user has misplaced the original.

MaxRetryError

My first attempt at hitting the sandbox API always generates the following error:

HTTPSConnectionPool(host='www.docusign_esign.net', port=443): Max retries exceeded with url: /restapi/v2/accounts/919570/envelopes (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x113b3f7f0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

If I try again, the connection succeeds as does the subsequent API request. Is this expected in the sandbox (maybe cold starting workers or something behind the scenes)?

Better packaging

The current PyPI page is lacking a lot of very important things, including the long description, and a link to the source code. It doesn't say that this is the official docusign python client.

I'd be glad to make a PR for this, but I wanted to consult with you first.

Need more information on how to delete an envelope

I am trying to delete an envelope via the client.
I saw different solutions on the web, especially to move an envelope to the trash folder (or something like that...) but I prefer for now just to delete all documents in a given envelope_id.

Using delete_documents with the required parameters: account_id and envelope_id, the server returns me a 400 error, with the given message:

(400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache', 'Content-Length': '113', 'Content-Type': 'application/json; charset=utf-8', 'X-DocuSign-TraceToken': 'XXXXX, 'Date': 'Fri, 12 Oct 2018 12:16:18 GMT', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'})
HTTP response body: b'{\r\n  "errorCode": "INVALID_REQUEST_BODY",\r\n  "message": "The request body is missing or improperly formatted."\r\n}'

Does this method needs more arguments?

AuthenticationApi.login() exception - TypeError: the JSON object must be str, not 'bytes'

I followed sample code in README.md and pushed at this commit though it resulted with error as below.

The fix is to edit docusign_esign/api_client.py
from

data = json.loads(response.data)

to

data = json.loads(response.data.decode('utf-8'))

After edited, run again and it succeeded. So do we need a fork for that fix?

I'm new to DocuSign and I don't know if I did something wrong so I raise it here. Please shed light on me.
Regards,
Nam

The error trace

    Traceback (most recent call last):
      File "/home/namgivu/NN/code/_NN_/docusign-start/run00.py", line 66, in <module>
        login_info = auth_api.login(api_password='true', include_account_id_guid='true')
      File "/home/namgivu/NN/code/_NN_/docusign-start/venv3/lib/python3.5/site-packages/docusign_esign/apis/authentication_api.py", line 388, in login
        (data) = self.login_with_http_info(**kwargs)
      File "/home/namgivu/NN/code/_NN_/docusign-start/venv3/lib/python3.5/site-packages/docusign_esign/apis/authentication_api.py", line 472, in login_with_http_info
        collection_formats=collection_formats)
      File "/home/namgivu/NN/code/_NN_/docusign-start/venv3/lib/python3.5/site-packages/docusign_esign/api_client.py", line 373, in call_api
        _return_http_data_only, collection_formats, _preload_content, _request_timeout)
      File "/home/namgivu/NN/code/_NN_/docusign-start/venv3/lib/python3.5/site-packages/docusign_esign/api_client.py", line 208, in __call_api
        return_data = self.deserialize(response_data, response_type)
      File "/home/namgivu/NN/code/_NN_/docusign-start/venv3/lib/python3.5/site-packages/docusign_esign/api_client.py", line 282, in deserialize
        data = json.loads(response.data)
      File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
        s.__class__.__name__))
    TypeError: the JSON object must be str, not 'bytes'    

MaxRetryError

in docusign version 3.1.0 , pthon version 3.5 and 3.6 in sandbox mode .
getting following error
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //account-d.docusign.com/oauth/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa77f6c8dd8>: Failed to establish a new connection: [Errno -2] Name or service not known',))

Version 3.0 - Import error using python versions < 3.7

Using python 3.6.7:
from docusign_esign import ApiClient

The following error occurs originating from line 24 of models/account_settings_information.py
SyntaxError: more than 255 arguments

I note the README still states the required python version is 2.7+

Was this was an oversight in updating the readme, or do plan to continue to support for these python versions?

NOTE: Version 2.1 of the docusign-python-client doesn't have this problem

Module 'Docusign_esign.models' has no attribute 'Date'

Hi all, I'm attempting to use the get_document_tabs method and getting the error in the title. Any idea what could be the cause for this? I've tried a handful of other api calls and they all work fine. The following contains the stack

Traceback (most recent call last): File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\sentry_sdk\integrations\django\views.py", line 67, in sentry_wrapped_callback return callback(request, *args, **kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\django\views\generic\base.py", line 70, in view return self.dispatch(request, *args, **kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception raise exc File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\rest_framework\decorators.py", line 50, in handler return func(*args, **kwargs) File "C:\Users\l3GIT\Desktop\work\onboarding\app\realty_one_onboarding\views.py", line 533, in get_docusign_templates return JsonResponse(Template.get_user_docusign_templates([user.email for user in offices_owners]), safe=False) File "C:\Users\l3GIT\Desktop\work\onboarding\app\realty_one_onboarding\docusign\template.py", line 23, in get_user_docusign_templates cls.verify_fields_exist("test", "test") File "C:\Users\l3GIT\Desktop\work\onboarding\app\realty_one_onboarding\docusign\template.py", line 62, in verify_fields_exist tabs = template_api.get_document_tabs( File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\apis\templates_api.py", line 3020, in get_document_tabs (data) = self.get_document_tabs_with_http_info(account_id, document_id, template_id, **kwargs) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\apis\templates_api.py", line 3099, in get_document_tabs_with_http_info return self.api_client.call_api(resource_path, 'GET', File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 350, in call_api return self.__call_api(resource_path, method, File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 184, in __call_api return_data = self.deserialize(r, response_type) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 264, in deserialize return self.__deserialize(data, response_type) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 307, in __deserialize return self.__deserialize_model(data, klass) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 661, in __deserialize_model setattr(instance, attr, self.__deserialize(value, attr_type)) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 281, in __deserialize return [self.__deserialize(sub_data, sub_kls) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 281, in <listcomp> return [self.__deserialize(sub_data, sub_kls) File "C:\Users\l3GIT\AppData\Local\pypoetry\Cache\virtualenvs\realtyone-onboarding-JbsbWoEO-py3.9\lib\site-packages\docusign_esign\client\api_client.py", line 296, in __deserialize klass = getattr(models, klass) AttributeError: module 'docusign_esign.models' has no attribute 'Date'

Webhooks using Python client

Hello,

I am trying to receive notifications from my app when an envelope's status is changed, however, I don't receive any request to my webhook endpoint. I am using a simple Flask app as a listener and I've tested it locally if it receives regular POST requests and it works. I am also sending my code snippet. I couldn't get what is wrong. Also, I am receiving e-mails with documents just fine, I just couldn't get webhook to get requests. FYI, I am using a developer account. Thank you in advance!

        webhook_url = 'http://e6e9e971.ngrok.io/docusign-webhook/'

        event_notification = EventNotification(
            url=webhook_url,
            logging_enabled="true",
            require_acknowledgment="true",
            use_soap_interface="false",
            include_certificate_with_soap="false",
            sign_message_with_x509_cert="false",
            include_documents="true",
            include_envelope_void_reason="true",
            include_time_zone="true",
            include_sender_account_as_custom_field="true",
            include_document_fields="true",
            include_certificate_of_completion="true",
            envelope_events=[
                EnvelopeEvent(
                    envelope_event_status_code="Sent",
                    include_documents="false"
                ),
                EnvelopeEvent(
                    envelope_event_status_code="Delivered",
                    include_documents="false"
                ),
                EnvelopeEvent(
                    envelope_event_status_code="Completed",
                    include_documents="false"
                ),
                EnvelopeEvent(
                    envelope_event_status_code="Declined",
                    include_documents="false"
                ),
                EnvelopeEvent(
                    envelope_event_status_code="Voided",
                    include_documents="false"
                ),
            ],
            recipient_events=[
                RecipientEvent(
                    recipient_event_status_code="Sent",
                    include_documents="false"
                ),
                RecipientEvent(
                    recipient_event_status_code="Delivered",
                    include_documents="false"
                ),
                RecipientEvent(
                    recipient_event_status_code="Completed",
                    include_documents="false"
                ),
                RecipientEvent(
                    recipient_event_status_code="Declined",
                    include_documents="false"
                ),
                RecipientEvent(
                    recipient_event_status_code="AuthenticationFailed",
                    include_documents="false"
                ),
                RecipientEvent(
                    recipient_event_status_code="AutoResponded",
                    include_documents="false"
                ),
            ]
        )

        # Next, create the top level envelope definition and populate it.
        envelope_definition = EnvelopeDefinition(
            email_subject="Please sign this document",
            documents=[document],
            recipients=Recipients(signers=[signer]),
            status="sent",
            event_notification=event_notification
        )

Dependencies : PyJWT version is too old

Currently this package needs PyJWT v1.7.1. This version has been released in november 2018.
This old version is no more compatible with the current version of Django Rest Framework.

How can we solve this in order to use this docusign client with an API built with Django Reste Framework?

Python Signing Groups API

I would like to send a group of signers the same envelope containing the same document. I am achieving this by following this tutorial and by changing routing_order, but I would like to send the e-mail at the same time to all recipients and only one signature is needed. I've found SigningGroups, which seems like what I'm trying to use, but I couldn't find any resources on how to do this using Python API. Can you provide any examples or snippents? Thank you!

TypeError: the JSON object must be str, not 'bytes'

Context for the error:

Python Version 3.5.2
Access granted to the app through DocuSign OAuth authorization url? Yes

While running the main script after configuring it for my DocuSign Sandbox account, I get the TypeError.

Traceback:

Traceback (most recent call last):
  File "testing.py", line 66, in <module>
    login_info = auth_api.login(api_password='true', include_account_id_guid='true')
  File "/Users/brady/.local/share/virtualenvs/Docusign-eC2R9qCp/lib/python3.5/site-packages/docusign_esign/apis/authentication_api.py", line 388, in login
    (data) = self.login_with_http_info(**kwargs)
  File "/Users/brady/.local/share/virtualenvs/Docusign-eC2R9qCp/lib/python3.5/site-packages/docusign_esign/apis/authentication_api.py", line 472, in login_with_http_info
    collection_formats=collection_formats)
  File "/Users/brady/.local/share/virtualenvs/Docusign-eC2R9qCp/lib/python3.5/site-packages/docusign_esign/api_client.py", line 373, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/Users/brady/.local/share/virtualenvs/Docusign-eC2R9qCp/lib/python3.5/site-packages/docusign_esign/api_client.py", line 208, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/Users/brady/.local/share/virtualenvs/Docusign-eC2R9qCp/lib/python3.5/site-packages/docusign_esign/api_client.py", line 282, in deserialize
    data = json.loads(response.data)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

Solution:

Change this line:
https://github.com/docusign/docusign-python-client/blob/ad71773452e4df3e500af93849d060718819df43/docusign_esign/api_client.py#L282

To this:
data = json.loads(response.data.decode('utf-8'))

Which matches the pattern used here:
https://github.com/docusign/docusign-python-client/blob/ad71773452e4df3e500af93849d060718819df43/docusign_esign/api_client.py#L119

Thank you, kindly!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.