docusign / code-examples-node

Node.js code examples and launcher
https://developers.docusign.com/
MIT License
66 stars 53 forks source link

Authentication method to use and steps.. #34

Closed daskabe closed 2 years ago

daskabe commented 2 years ago

Hi, What is the authentication method suggested for aws lambda to make API call to eSignature APIs?

Scenario : Once Connect notifies a lambda that a doc has been signed, we are making a call to eSignature api https://demo.docusign.net/restapi/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/form_data to get the data entered on that form/envelop.

This is the example we are following closely that sends message to SQS once Connect triggers a Lambda. We are just adding one more step to this to get the form data. https://github.com/docusign/connect-node-listener-aws/blob/master/index.js

Ideally there should have been an option to get the form data right on the Connect configuration pictured bellow. As it saves the extra steps needed to authenticate and verify again...and then make another API call. Considering we already did Basic Auth and HMAC verification on above sample code; There should be an easy way to get the form data than authenticating again.
image

kollDocuSign commented 2 years ago

I've taken a look at the information provided and it sounds like you are trying to get form data from completed envelopes. I see you mentioned "Ideally there should have been an option to get the form data right on the Connect configuration pictured bellow." Based on that input I think you might be able to accomplish what you are looking for by going to your Connect configuration inside DocuSign and selecting the "Tabs" box on the "Included Data" Section. Doing so should result in the JSON payload including the completed form data sent via Connect. Could you let me know if you get the form data correctly after turning on the "Tabs" box on the "Included Data" Section?

daskabe commented 2 years ago

Hi @kollDocuSign , no form data when Tabs is selected.

kollDocuSign commented 2 years ago

@daskabe I tested a minute ago. My test was the following: 1: Create an envelope. The envelope had a field with the "tabLabel" "test" and was a basic text field. 2: I sent the envelope and the recipient (myself) filled in the "test" field above. 3: The data I got back from Connect was that field, and the data I entered. The example data I received from Connect is below.

To get the data I needed to include two boxes on the "Included Data" section inside Connect. The two boxes were "Recipients" and "Tabs". Can you test again with "Recipients" and "Tabs" included and see if that results in the payload containing the fields?

Data sample: "textTabs": [ { "validationPattern": "", "validationMessage": "", "shared": "false", "requireInitialOnSharedChange": "false", "requireAll": "false", "value": "5555", "originalValue": "prefilledText", "required": "true", "locked": "false", "concealValueOnDocument": "false", "disableAutoSize": "false", "maxLength": "4000", "tabLabel": "test", "font": "lucidaconsole", "fontColor": "black", "fontSize": "size9", "localePolicy": {}, "documentId": "1", "recipientId": "1", "pageNumber": "1", "xPosition": "263", "yPosition": "203", "width": "84", "height": "22", "tabId": "9ecbddf0-a428-44c9-a9f2-116e860bef1e", "templateRequired": "false", "tabType": "text" },

daskabe commented 2 years ago

Hi @kollDocuSign , Ok now I see the tabs under recipients. Thanks. This information needs to be added to documentation of Connect. Thank you.

image