3

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 vendorsupport@zappos.com 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@email.com",
                                "name":"v",
                                "recipientId":1,
                                "roleName":"Vendor"
                            },
                            {
                                "email":"email@email.com",
                                "name":"test",
                                "recipientId":2,
                                "roleName":"Vendor Support"
                            },
                            {
                                "email":"email@email.com",
                                "name":"ap",
                                "recipientId":3,
                                "roleName":"AP"
                            },
                            { 
                                "email":"email@email.com",
                                "name":"f",
                                "recipientId":4,
                                "roleName":"Finance"
                            },
                            {
                                "email":"email@email.com",
                                "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@email.com",
  "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:

  • Create Envelope
  • Get Recipient tabs (to get value of tab ids)
  • Update tab values using tab ids.
Paul S.
  • 149
  • 1
  • 11
  • 1
    Where do the tabs exist that you're assigning the values from? In server template 'A3B4F6BB-639A-486F-8C84-826295142F21'? – Andrew Jan 16 '16 at 07:43
  • Yes, they are in the template. What I am trying to do is assign the template to the document and then defauting a few of the values for one of the users. – Paul S. Jan 16 '16 at 16:56
  • @AndrewWilson Andrew, do I need to assign in a different location due to the tabs being in the template? – Paul S. Jan 21 '16 at 18:35
  • @AndrewWilson just wanted to follow up and see if due to the tabs being in the template if they are supposed to be assigned in a different way – Paul S. Mar 03 '16 at 17:42
  • See my answer below. – Andrew Mar 04 '16 at 01:30

2 Answers2

1

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?

Ergin
  • 9,254
  • 1
  • 19
  • 28
  • the role on recipient #5 is set to AP2, I set the name to ap as a placeholder. "name":"ap", "recipientId":5, "roleName":"AP2", – Paul S. Jan 13 '16 at 18:25
  • I have added the screen capture of the recipients as well as one of the fields – Paul S. Jan 13 '16 at 20:18
  • As you can see in my code I am assigning the tabs to `"AP2"` with the name of `"ap"` so I don't see where I am missing something. – Paul S. Jan 13 '16 at 23:36
  • Any other things that you might think of Ergin? – Paul S. Jan 15 '16 at 16:39
  • 1
    Nothing obvious I can think of, at this point I would start isolating the bits and pieces of your code that work. What happens if you try to assign the `textTabs` to the first recipient? What about assigning them a different `roleName` on the template? I would also test sending an envelope with just one recipient and tabs assigned to them and see what happens. Lastly, I was always a little confused with the `sequence` param under the server template property, and the `defaultRecipient` property. You might want to test around those as well. – Ergin Jan 15 '16 at 21:25
  • Thank you Ergin, I have updated my post with a workaround that I will be implementing to be able to accomplish what I need. – Paul S. Jan 15 '16 at 21:57
0

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

Andrew
  • 4,443
  • 5
  • 33
  • 75