0

I am integrating with DocuSign and need the ability to include editable pre-filled tabs on the documents in the envelope I create. I am accessing their API using the requests library in Python.

DocuSign's special pre-filled tabs explicitly lock in the value and do not allow for recipient/signer editing. I have been able to add and fill the value for regular text tabs that unfortunately are also locked for editing.

Further context:
I am writing an API endpoint that will retrieve recipient information, create the envelope off of a template with tabs pre-filled, and then return the front end a URL to display for in-app signing.

amb122
  • 11
  • 1

1 Answers1

1

Here is the code that worked for creating an envelope instance with pre-filled and editable tabs:

def make_new_envelope(template_id, account_id):
    data = json.dumps({
      "templateId": "<template_id>",
      "status": "sent",
      "templateRoles": [
        {
          "clientUserId": "<any string of your choosing>", # required but determined by you
          "email": "test@test.com",
          "name": "Maggie Nelson",
          "roleName": "signer",
          "tabs": {
            "textTabs": [
                {
                    "tabLabel": "Text a494f42f-654e-49e1-9add-dd87bdc0dd04",
                    "fontSize": "size9",
                    "fontColor": "black",
                    "font": "lucidaconsole",
                    "required": "true",
                    "locked": "false",
                    "value": "home phone number",
                    "maxLength": 4000,
                    "width": 84,
                    "height": 27,
                    "documentId": "1",
                    "recipientId": "1",
                    "pageNumber": 1,
                    "tabId": "d94dd078-c808-4ced-a1b1-d3d1a577bca0",
                    "tabType": "text",
                    "xPosition": 232,
                    "yPosition": 343,
                }
              ]
          }
        }
      ]
    })

    envelope_url = "/v2.1/accounts/{account_id}/envelopes".format(account_id=account_id)
    x = requests.post(url=BASE_URL + envelope_url, headers=headers, data=data)
    return x.json()['envelopeId']

I am not positive that all of this is absolutely necessary to include in the json object describing the tab besides the option "locked": "false".

The tabLabel and tabId values have no relationship to the template's defined tabs. It appears possible that they can be set to whatever you wish.

With regards to updating tabs on an envelope that has already been created...I have not been successful yet. I will note that the bug detailed here does still appear to exist Calling EnvelopesApi#update_document_tabs returns an error

amb122
  • 11
  • 1