未使用rest api设置texttabs创建信封

时间:2016-01-12 19:08:14

标签: docusignapi

想知道我错过了什么或做错了,因为在创建信封时没有设置标签的值。

在下面的JSON代码中,我尝试为收件人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"
                    }
                    ]
                }
            ]
            }

当我查看信封标签时,这是我获得的第五位收件人:

"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"
      }
    ]

*编辑* 添加信封标签的最后部分和收件人的屏幕截图以及一个标签...

},
  "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

*解决方法*

由于我无法在创建时设置选项卡值,因此我尝试了以下操作:

  1. 尝试创建PUT请求以使用uri更新选项卡,以获取收件人/ envelopeid / recipients / 5 / tabs的选项卡,并将文本选项卡的JSON传递为。

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

  2. 传递上面的JSON我会得到一个回复​​,即信封上没有找到标签

    {
      "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. 我的第二步是从创建的信封中实际获取tabId值,而不是使用标签标签(在创建信封之前我不会使用的标签)。
    2. 通过使用JSON中的tabId调用/ envelopeid / recipients / 5 / tabs而不是

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

      然后字段值正确更新。

      总之,对于我的解决方法,需要三次调用DocuSign才能设置此收件人的默认值:

      • 创建信封
      • 获取收件人标签(以获取标签ID的值)
      • 使用标签ID更新标签值。

2 个答案:

答案 0 :(得分:1)

您是否肯定将收件人与您在模板上配置的有效角色正确匹配?

例如,我发现对于收件人#5,您将它们分配给"AP2"角色,当您登录网站并查看模板时,模板中是否存在确切的角色?

答案 1 :(得分:0)

我很抱歉答案很长一段时间,你的JSON需要一个小小的推文。

您需要将sequence的{​​{1}}更改为serverTemplates,并将值指定给同一模板。

1

这将消除对GET / PUT的需求(尽管如果您愿意,仍然可以进行GET验证信息)

Picture of Successful Test