Paul S.
Paul S.

Reputation: 149

texttabs not being set using rest api create envelope

Wondering what I am missing or doing wrong here as the value for the tabs are not being set when creating the envelope.

In the JSON code below I am trying to default values for the text tabs for recipient 5.

{
            "emailSubject":"Allowance Agreement - AK Anne Klein Footwear  -  ytd .doc",
            "emailBlurb":"DEV - Please complete the Vendor Allowance Agreement required for your Supplier setup with Zappos.com or 6pm.com. \n\n Please reach out to your Vendor Support team member or [email protected] with any questions.",
            "status":"sent",
            "compositeTemplates":[
            {
                "compositeTemplateId": "1",                    
                "inlineTemplates":[
                    {
                        "sequence":"1",
                         "documents": [
                            {
                            "documentId": "1",
                            "name": "Allowance Agreement - AK Anne Klein Footwear  -  ytd .doc.doc"
                            }
                            ],
                        "customFields": {
                                "textCustomFields": [
                                    {
                                        "name": "Node ID",
                                        "required": "true",
                                        "show": "true",
                                        "value": "658824"
                                    }
                                ]
                            },
                        "recipients":{
                        "signers":[
                            {
                                "email":"[email protected]",
                                "name":"v",
                                "recipientId":1,
                                "roleName":"Vendor"
                            },
                            {
                                "email":"[email protected]",
                                "name":"test",
                                "recipientId":2,
                                "roleName":"Vendor Support"
                            },
                            {
                                "email":"[email protected]",
                                "name":"ap",
                                "recipientId":3,
                                "roleName":"AP"
                            },
                            { 
                                "email":"[email protected]",
                                "name":"f",
                                "recipientId":4,
                                "roleName":"Finance"
                            },
                            {
                                "email":"[email protected]",
                                "name":"ap",
                                "recipientId":5,
                                "roleName":"AP2",
                                "tabs":{
                               "textTabs":[
                                  {
                                     "tabLabel":"txtVendorId",
                                     "value":"100023"
                                  },
                                  {
                                     "tabLabel":"txtSupplierName",
                                     "value":"AK Anne Klein Footwear"
                                  },
                                  {
                                     "tabLabel":"txtSupplierId",
                                     "value":"253"
                                  }
                               ]
                        }}
                        ]
                    }                    
                    }
                    ],
                "serverTemplates":[
                    {
                        "sequence":"2",
                        "templateId":"A3B4F6BB-639A-486F-8C84-826295142F21"
                    }
                    ]
                }
            ]
            }

When I look at the envelope tabs here is what I get for the 5th recipient:

"textTabs": [
      {
        "height": 22,
        "isPaymentAmount": "false",
        "validationPattern": "",
        "shared": "false",
        "requireInitialOnSharedChange": "false",
        "requireAll": "false",
        "name": "Text",
        "value": "",
        "width": 300,
        "required": "true",
        "locked": "false",
        "concealValueOnDocument": "false",
        "disableAutoSize": "false",
        "tabLabel": "txtVendorId",
        "font": "lucidaconsole",
        "fontColor": "black",
        "fontSize": "size9",
        "documentId": "1",
        "recipientId": "5",
        "pageNumber": "2",
        "xPosition": "217",
        "yPosition": "651",
        "tabId": "2179efb5-9f59-4bb7-895e-da868fba9919"
      },
      {
        "height": 22,
        "isPaymentAmount": "false",
        "validationPattern": "",
        "shared": "false",
        "requireInitialOnSharedChange": "false",
        "requireAll": "false",
        "name": "Text",
        "value": "",
        "width": 342,
        "required": "true",
        "locked": "false",
        "concealValueOnDocument": "false",
        "disableAutoSize": "false",
        "tabLabel": "txtSupplierName",
        "font": "lucidaconsole",
        "fontColor": "black",
        "fontSize": "size9",
        "documentId": "1",
        "recipientId": "5",
        "pageNumber": "2",
        "xPosition": "172",
        "yPosition": "670",
        "tabId": "2c6e59b1-6a4f-4f5f-a873-33398c78e408"
      },
      {
        "height": 22,
        "isPaymentAmount": "false",
        "validationPattern": "",
        "shared": "false",
        "requireInitialOnSharedChange": "false",
        "requireAll": "false",
        "name": "Text",
        "value": "",
        "width": 354,
        "required": "true",
        "locked": "false",
        "concealValueOnDocument": "false",
        "disableAutoSize": "false",
        "tabLabel": "txtSupplierId",
        "font": "lucidaconsole",
        "fontColor": "black",
        "fontSize": "size9",
        "documentId": "1",
        "recipientId": "5",
        "pageNumber": "2",
        "xPosition": "172",
        "yPosition": "690",
        "tabId": "614eb20b-5536-45db-b64a-84a475cdc44d"
      }
    ]

* EDIT * adding final part of envelopes tabs and screen captures of recipients and one tab...

},
  "isBulkRecipient": "false",
  "name": "ap",
  "email": "[email protected]",
  "recipientId": "5",
  "recipientIdGuid": "77e255d8-a6d6-47a8-98ee-0f3829631d76",
  "requireIdLookup": "false",
  "userId": "8d7f443b-7adf-4cfa-8368-296aee88e959",
  "routingOrder": "5",
  "roleName": "AP2",
  "status": "created",
  "totalTabCount": "5"
}

Recipients

Field sample

* Workaround *

Since I was not able to set the tab values at creation time I tried the following:

  1. Tried to create a PUT request to update the tabs using the uri for the tab for the recipient /envelopeid/recipients/5/tabs and passing the JSON for the text tabs as.

    { "textTabs":[ { "tabLabel": "txtVendorId", "value":"123" } ] }

Passing the JSON above I would get a response that the tab was not found on the envelope

{
  "requireAll": "false",
  "concealValueOnDocument": "false",
  "disableAutoSize": "false",
  "recipientId": "5",
  "tabId": "00000000-0000-0000-0000-000000000000",
  "errorDetails": {
    "errorCode": "INVALID_TAB_OPERATION",
    "message": "The Tab specified is not valid for the requested operation.  The Tab specified is not valid for the requested operation. Tab not found in envelope."
}
  1. My second step was to actually get the tabId value from the created envelope instead of using the tab lable (something that I would not have before creating the envelope).

By calling /envelopeid/recipients/5/tabs with the tabId in the JSON instead like

{
    "textTabs":[
        {
            "tabId": "57135910-fe34-417d-a4e3-fc7d6c4a42ed",
            "value":"123"
        }
    ]
}

Then the field value got updated correctly.

In conclusion, for my workaround will need three calls to DocuSign to be able to set the default values for this recipient:

Upvotes: 3

Views: 263

Answers (2)

Andrew
Andrew

Reputation: 4441

I'm sorry for the very long delay on an answer, your JSON needs one small tweek.

You need to change your sequence of your serverTemplates to 1, assigning the values to the same template.

"serverTemplates":[
  {
    "sequence":"1",
  }

This will remove the need for the GET/PUT (although you can still do the GET to verify information if you'd like)

Picture of Successful Test

Upvotes: 0

Ergin
Ergin

Reputation: 9356

Are you positive you are correctly matching your recipients to valid roles you've configured on the Template?

For instance, I see that for recipient #5 you are assigning them to the "AP2" role, does that exact role exist in your template when you login to the website and view the template?

Upvotes: 1

Related Questions