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

DocuSignException in post_recipient_view when recipient's name change is not reflected in database #102

Open
smcoll opened this issue Jan 12, 2017 · 1 comment · May be fixed by #103
Open

Comments

@smcoll
Copy link
Contributor

smcoll commented Jan 12, 2017

Narrowing in on a non-callback issue mentioned in peopledoc/django-docusign#65...

If a user has changed their name using the DocuSign interface while signing, and that name change is not reflected in the database, pydocusignEnvelope.post_recipient_view will raise an exception via DocuSignClient.post_recipient_view:

DocuSignException: DocuSign request failed: POST https://na2.docusign.net/restapi/v2/accounts/<account-id>/envelopes/<envelope_id>/views/recipient returned code 400 while expecting code 201; Message: {  
  "errorCode": "UNKNOWN_ENVELOPE_RECIPIENT",  
  "message": "The recipient you have identified is not a valid recipient of the specified envelope."  
} ;

This is because the lookup includes a name that no longer matches the recipient name in DocuSign's database.

According to https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Post%20Recipient%20View.htm, clientUserId can be used in conjuction with userId in lieu of email+userName to do the lookup. In our case, userName is out of sync with DocuSign, but clientUserId+userId would work.

My proposal is to only use email and userName in the POST data if clientUserIduserId is unavailable. This would prevent the exception in the case of an out-of-sync name where the more reliable clientUserIduserId can be used instead.

To do this, we would need to only pass the defined keyword arguments to DocuSignClient.post_recipient_view in the POST data, and determine which keyword arguments to use in the method call in pydocusignEnvelope.post_recipient_view.

@zebuline
Copy link
Contributor

@smcoll thank you for the ticket; it is very clear and seems to be legit.
Unfortunately I have no time this month for working on pydocusign. If you want to propose a PR, you are more than welcome.

@smcoll smcoll linked a pull request Feb 9, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants