【发布时间】:2016-01-12 19:08:14
【问题描述】:
想知道我在这里遗漏了什么或做错了什么,因为在创建信封时没有设置选项卡的值。
在下面的 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"
}
* 解决方法 *
由于我无法在创建时设置选项卡值,因此我尝试了以下方法:
-
尝试创建一个 PUT 请求以使用收件人 /envelopeid/recipients/5/tabs 的选项卡的 uri 更新选项卡,并将文本选项卡的 JSON 传递为。
{ “文本标签”:[ { "tabLabel": "txtVendorId", “价值”:“123” } ] }
通过上面的 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."
}
- 我的第二步是从创建的信封中实际获取 tabId 值,而不是使用制表符(在创建信封之前我不会有的东西)。
通过使用 JSON 中的 tabId 调用 /envelopeid/recipients/5/tabs 而不是像
{
"textTabs":[
{
"tabId": "57135910-fe34-417d-a4e3-fc7d6c4a42ed",
"value":"123"
}
]
}
然后字段值得到正确更新。
总之,对于我的解决方法,需要对 DocuSign 进行三个调用才能为该收件人设置默认值:
- 创建信封
- 获取收件人标签(以获取标签 ID 的值)
- 使用选项卡 ID 更新选项卡值。
【问题讨论】:
-
您从中分配值的选项卡在哪里?在服务器模板“A3B4F6BB-639A-486F-8C84-826295142F21”中?
-
是的,它们在模板中。我要做的是将模板分配给文档,然后为其中一位用户默认一些值。
-
@AndrewWilson Andrew,由于模板中的选项卡,我是否需要在不同的位置进行分配?
-
@AndrewWilson 只是想跟进,看看是否由于模板中的标签是否应该以不同的方式分配
-
在下面查看我的答案。
标签: docusignapi