创建信封时传递模板标签的值 [英] Passing template tabs value while creating envelope
问题描述
我知道存在一个与我要提出的问题类似的问题,但该问题是4年前提出的,没有给出具体答案。问题的链接是此处
I know there exists an question similar to the one which I am going to ask but that question was asked 4 years back and no concrete answer is given. Link for the question is here
我正在使用现有模板创建一个信封,并且一切都像黄油一样光滑。但是,当我尝试在模板中预填充制表符值时,制表符值未添加到信封中。我尝试了两种不同的JSON请求,一种使用tabId,另一种使用tabLabel。他们都没有工作。
I am creating an envelope using existing template and everything works smooth as butter. But, when I try to pre fill tabs value in template, tabs values are not being added to envelope. I have tried two different JSON requests, one with tabId and one with tabLabel. None of them worked.
尝试1:
{
"status":"sent",
"emailSubject":"Testing with DocuSign",
"templateId":"124faf68-3b42-43b9-9b6d-814d465e161d",
"templateRoles":
[{
"roleName":"Climber",
"name":"xyz",
"email":"temp@email.com",
"clientUserId":"126789",
"tabs":{
"fullNameTabs":[{
"tabId":"bb56d91a-1665-4817-99a6-643c67defbc1",
"value":"abc"
}],
"companyTabs":[{
"tabId":"ba5p67cb-bcf5-42b0-aa04-a0cfec448ddc",
"value":"Temporary companyname"
}]
}
}]
}
尝试2:
{
"status":"sent",
"emailSubject":"Testing with DocuSign",
"templateId":"124faf68-3b42-43b9-9b6d-814d465e161d",
"templateRoles":
[{
"roleName":"Climber",
"name":"xyz",
"email":"temp@email.com",
"clientUserId":"126789",
"tabs":{
"fullNameTabs":[{
"tabLabel":"CustomField1",
"value":"abc"
}],
"companyTabs":[{
"tabLabel":"Company 2fdbb190-2f3e-4d39-8202-e15b9a1c332a,
"value":"Temporary companyname"
}]
}
}]
}
有人可以告诉我我做错了吗。
Can someone tell me if I am doing wrong.
推荐答案
要通过创建信封请求填充制表符值,您需要在请求正文中使用 compositeTemplates
结构。这是一个使用您在帖子中提供的数据的请求结构的示例-但填充了一个 textTab
而不是 companyTab
和 fullnameTab
。正如阿米特(Amit)在他的帖子中提到的那样,无法通过API设置 companyTab
和 fullnameTab
。
To populate tab values via a Create Envelope request, you'll need to use the compositeTemplates
structure within the request body. Here's an example of that request structure that uses the data you provided in your post -- but populates a single textTab
, instead of the companyTab
and fullnameTab
. As Amit mentioned in his post, the companyTab
and fullnameTab
cannot be set via the API.
POST https://demo.docusign.net/restapi/v2/accounts/ACCOUNT_NUMBER/envelopes
{
"status" : "sent",
"emailSubject": "Testing with DocuSign",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "124faf68-3b42-43b9-9b6d-814d465e161d"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"roleName": "Climber",
"name": "xyz",
"email": "temp@email.com",
"clientUserId": "126789",
"recipientId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "field1",
"value": "field-1-value"
}
]
}
}]
}
}]
}]
}
这篇关于创建信封时传递模板标签的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!