Docusign嵌入式签名与复合模板

时间:2017-11-28 18:10:10

标签: docusignapi docusigncompositetmplts

鉴于我有多个模板,让我们说:

模板1:A和经理需要签名 模板2:只需要签名

是否可以将其合并为1个信封并在应用中显示?

我现在按顺序做的方式:

ExecuteNonQuery()

这种方式的问题是,如果用户在第一个文档上花费太长时间(超过5分钟),则网址将过期,并且他们无法签署其余文档。

所以,经过一些谷歌搜索,听起来像我应该使用复合模板,但我找不到任何关于如何检索嵌入式签名网址的例子。

注意:我正在使用嵌入式签名,因此我需要能够检索显示签名页面的网址,并在签名完成后指定返回网址。

更新 我使用API​​ Explorer生成正确的JSON,并且似乎适用于1个模板,将尝试多个模板和多个用户。

https://apiexplorer.docusign.com/#/esign/restapi?categories=Authentication&tags=Authentication&operations=login&mode=basic

更新:

我已经创建了一个JSON,它运行(两个模板现在都在一个信封中,我可以看到并签名),但只有一个用户。我怎样才能使它工作,所以对方也可以签名呢?

即:模板1:2人需要在不同的地方签名,模板2:只有1人需要签名

下面是JSON,带有一些随机变量,例如模板ID

* create an envelope for the template 2
* retrieve the uri
* call `POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient‌` 
  with body specifying the return url (back to my site)
* get the embedded signing url
* create another envelope for template 1
* retrieve the uri
* call `POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient‌` 
  with body specifying the return url 
  (embedded signing url for the above template)
* call `POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient‌` 
  with body specifying the return url 
  (embedded signing url for the above because it needs different signer)
* retrieve the embedded signing url
* open the embedded signing url on the UI

我正在使用该功能检索嵌入的签名网址,uri来自信封,clientUserId是本案例中第一个人为someone@email.com。我应该为manageroneemail打电话两次吗?

{
  "compositeTemplates": [
{
      "inlineTemplates": [
        {
          "customFields": {
            "listCustomFields": [
              {
                "name": "OpportunityId",
                "required": "True",
                "show": "False",
                "value": "2096"
              },
              {
                "name": "DocuInfoId",
                "required": "True",
                "show": "False",
                "value": "2"
              }
            ]
          },
          "recipients": {
            "signers": [
              {
                "clientUserId": "1",
                "email": "someone@email.com",
                "name": "Some One",
                "recipientId": "1",
                "roleName": "Occupant",
                "tabs": {
                  "dateTabs": [
                    {
                      "tabLabel": "*ExpDate",
                      "value": "2/20/2018"
                    }
                  ],
                  "listTabs": [
                    {
                      "listItems": [
                        {
                          "selected": "False",
                          "text": "True",
                          "value": "True"
                        },
                        {
                          "selected": "True",
                          "text": "False",
                          "value": "False"
                        }
                      ],
                      "tabLabel": "ShowCOI"
                    },
                    {
                      "listItems": [
                        {
                          "selected": "False",
                          "text": "Y",
                          "value": "Y"
                        },
                        {
                          "selected": "True",
                          "text": "N",
                          "value": "N"
                        }
                      ],
                      "tabLabel": "BillingOption"
                    }
                  ],
                  "numberTabs": [
                    {
                      "tabLabel": "*ValueOfGoods",
                      "value": "$5,000.00"
                    }
                  ],
                  "radioGroupTabs": [
                    {
                      "groupName": "Some Radio",
                      "radios": [
                        {
                          "selected": "false",
                          "value": "on property"
                        },
                        {
                          "selected": "true",
                          "value": "off property"
                        }
                      ]
                    },
                    {
                      "groupName": "ServiceSchedule",
                      "radios": [
                        {
                          "selected": "false",
                          "value": "Yes"
                        },
                        {
                          "selected": "true",
                          "value": "No"
                        }
                      ]
                    }
                  ],
                  "textTabs": [
                    {
                      "tabLabel": "*SomeLabel",
                      "value": "SomeValue"
                    },
                    {
                      "tabLabel": "*SomeAddress",
                      "value": "SomeAddress "
                    },
                  ]
                }
              },
              {
                "clientUserId": "2",
                "email": "managerone@email.com",
                "name": "Manager One",
                "recipientId": "2",
                "roleName": "Owner"
              }
            ]
          },
          "sequence": "1"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "<templateId1>"
        }
      ]
    },  
    {
      "inlineTemplates": [
        {
          "customFields": {
            "listCustomFields": [
              {
                "name": "OpportunityId",
                "required": "True",
                "show": "False",
                "value": "2096"
              },
              {
                "name": "DocuInfoId",
                "required": "True",
                "show": "False",
                "value": "1"
              }
            ]
          },
          "recipients": {
            "signers": [
              {
                "clientUserId": "1",
                "email": "someone@email.com",
                "name": "Some One",
                "recipientId": "1",
                "roleName": "Occupant"
              }
            ]
          },
          "sequence": "2"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "2",
          "templateId": "<templateId2>"
        }
      ]
    }    
  ],
  "emailSubject": "DocuSign API - Composite Templates",
  "eventNotification": {
    "envelopeEvents": [
      {
        "envelopeEventStatusCode": "Sent"
      },
      {
        "envelopeEventStatusCode": "Completed",
        "includeDocuments": "true"
      }
    ],
    "includeCertificateOfCompletion": "true",
    "includeCertificateWithSoap": "false",
    "includeDocumentFields": "false",
    "includeDocuments": "false",
    "includeEnvelopeVoidReason": "false",
    "includeSenderAccountAsCustomField": "false",
    "includeTimeZone": "true",
    "loggingEnabled": "false",
    "recipientEvents": [
      {
        "includeDocuments": "true",
        "recipientEventStatusCode": "Completed"
      }
    ],
    "requireAcknowledgment": "true",
    "signMessageWithX509Cert": "false",
    "url": "http://localhost:8080/api/documents/docusign/available",
    "useSoapInterface": "false"
  },
  "status": "sent"
}

1 个答案:

答案 0 :(得分:2)

请找到以下JSON请求,使用复合模板添加两个模板,

    {
   "compositeTemplates": [
      {
         "compositeTemplateId": 1,
         "inlineTemplates": [
            {
               "recipients": {
                  "signers": [
                     {
                        "email": "AEmail@gmail.com",
                        "name": "A Name",
                        "recipientId": "1",
                        "roleName": "A",
                        "routingOrder": "1",
                        "clientUserId": "AEmail"
                     },
                     {
                        "email": "ManagerEmail@gmail.com",
                        "name": "Manager Name",
                        "recipientId": "2",
                        "roleName": "Manager",
                        "routingOrder": "2",
                        "clientUserId": "ManagerEmail"
                     }
                  ]
               },
               "sequence": "2"
            }
         ],
         "serverTemplates": [
            {
               "sequence": "1",
               "templateId": "f9fd4d6f-834c-4632-a054-cedb3e79d123"
            }
         ]
      },
      {
         "compositeTemplateId": 2,
         "inlineTemplates": [
            {
               "recipients": {
                  "signers": [
                     {
                        "email": "AEmail@gmail.com",
                        "name": "A Name",
                        "recipientId": "1",
                        "roleName": "A",
                        "routingOrder": "1"
                     }
                  ]
               },
               "sequence": "2"
            }
         ],
         "serverTemplates": [
            {
               "sequence": "1",
               "templateId": "56645b6f-21d2-4838-b92c-4d44df591e41"
            }
         ]
      }
   ],
   "status": "sent"
}