从 DocuSign 中的模板创建要签名的文档

Create a Document to Sign from a Template in DocuSign

这是我的“项目”。

我需要从 Google 工作表中下载包含员工信息(姓名、地址、电子邮件、phone 号码和其他一些自定义字段)的行,并使用此信息填写模板在 DocuSign 中并将其发送给员工进行签名。员工无需进行任何编辑,只需在文档上签名即可。

所以在 DocuSign 网站 UI 中,我创建了包含我所有字段的模板。

在 API 中,我首先创建一个新信封:

POST /v2.1/accounts/{accountId}/envelopes

{
"templateId": "9e35d343-6942-4756-b7aa-XXXXXXXX",
"templateRoles": [
    {
        "email": "joe.doe@doooeeee.com",
        "name": "Joe Doe",
        "roleName": "employee"
    }
],
"status": "created"
}

我成功创建了信封(我在 UI 中看到了它)但不清楚我的下一步 API 应该是预填充模板。我一直在研究 API 文档,但我就是不明白...

有什么提示吗?

更新: 角色名称“employee”已保留,会在此处引起一些问题,通过更改为其他名称 - 您可以正常工作。

我们有一个 step-by-step code example 向您展示如何做到这一点。

JSON 看起来像这样:

"templateId": "9e35d343-6942-4756-b7aa-XXXXXXXX",
    "templateRoles": [{
        "email": "joe.doe@doooeeee.com",
        "name": "Joe Doe",
        "roleName": "employee",
        "tabs": {
            "checkboxTabs": [{
                "selected": "true",
                "tabLabel": "ckAuthorization"
            }, {
                "selected": "true",
                "tabLabel": "ckAgreement"
            }],
            "listTabs": [{
                "documentId": "1",
                "pageNumber": "1",
                "tabLabel": "list",
                "value": "green"
            }],
            "radioGroupTabs": [{
                "groupName": "radio1",
                "radios": [{
                    "selected": "true",
                    "value": "white"
                }]
            }],
            "textTabs": [{
                "tabLabel": "text",
                "value": "Jabberywocky!"
            }, {

        // .....

 

这里是 live example 通过 API 请求生成器。

请注意,API Request Builder 可用于在 C# 中为示例创建 SDK 代码,Java、Node.js、PHP、Python,以及 Ruby