Skip to main content

Hello there.

I need help with implementing the eSignature API. I have a simple Word document with variables - {{contractor_name}}, {{contractor_email}}. How can I use the API to update this document and populate real data instead of {{contractor_name}} and send it to the recipient?

- I tried to use textTabs and send all the necessary data in one request, including a Word document in Base64 - the fields didn't populate.
- I tried to manually create a template using the web UI, upload a Word document, manually add sender fields, and then made a request to update these custom fields (docGenFormFields). Nothing. ChatGPT assumed that docGenFormFields wasn't turned on in my account. But how to turn it on, I have no idea.


I'm using the developer sandbox account. Can anybody point me to how to implement field population via API?

I've used:
Document generation manual - https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/documents/document-generation/
Prefilled tabs - https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/tabs/prefilled-tabs/
Recipient tabs - https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/enveloperecipienttabs/


Thanks for any help
Andrew.

 

@gorenkov My suggestion would be to use anchor strings shown here: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/tabs/auto-place/

 

Specifically, you could make your strings such as “ {{contractor_name}}” white so it is invisible to the end user.
This is outlined in more detail in the above article under the section “Best practices“

You can target these strings using something similar to the below: 
"tabs": {
    "signHereTabs": [{
        "anchorString": "{{contractor_name}}",
        "anchorXOffset": "1",
        "anchorYOffset": "0",
        "anchorIgnoreIfNotPresent": "false",
        "anchorUnits": "inches"
    }]
}

 

If you had a text tab you can auto populate values using “value” : “exampleTextHere” 


Thank you, ​@Koll.Klienstuber , for the reply.

My suggestion would be to use anchor strings shown here: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/tabs/auto-place/

This way doesn’t suit me. I need to replace text since I have a more complex document than the one I populated in the screenshot, and I can’t predict the length.

 

If you had a text tab you can auto populate values using “value” : “exampleTextHere” 

Can you, please, tell me more about that method?


“If you had a text tab you can auto populate values using “value” : “exampleTextHere” “
That input would also apply to anchor strings: 
e.g: 
    "tabs": {
                    "textTabs": [{
                              "anchorString": "{{contractor_name}}",
                              "anchorXOffset": "1",
                              "anchorYOffset": "0",
                            "anchorIgnoreIfNotPresent": "false",
                              "anchorUnits": "inches"
                                "name": "enterText",

                                “value” : “TextGoesHere”,
                                "documentId": "1"
                            },]
                }

Anchor strings can be used to auto populate text fields. You can’t replace the actual text on a Docusign document aside from sender fields shown here:https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/documents/document-generation/

The actual text on documents would be burned into the document once you add the documents to a Docusign envelope. If the text on the underlying Document(s) needs to be changed dynamically prior to be added to an envelope that would be handled by whatever software is used to create the document. 


To be honest, I didn’t understand anything from your last post.

I tried “docGenFormFields” and “textTabs” - nothing worked for me. Once, ChatGPT suggested that the “docGenFormFields” feature is disabled on my test account. And because of that, populate variables doesn't work. But how to check it, I have no idea.