【问题标题】:DocuSign REST API (PHP) - pre-fill custom tagsDocuSign REST API (PHP) - 预填充自定义标签
【发布时间】:2015-01-06 19:38:55
【问题描述】:

我正在处理需要使用 DocuSign API (PHP) 的项目。这是我第一次使用 DocuSign,我成功地在 DocuSign 控制台中使用 roleName = signer 制作了模板。在那里,我还制作了自定义文本标签:addresscitystatephone,并将它们拖到模板中的所需位置。我希望将项目数据库中的客户(签名者)信息放在那里。

从我的项目中,我成功地通过 PHP API 与 DocuSign 建立了连接,并收到了 Embedded Singing View URL,它打开了我的模板,用户可以在其中毫无问题地签署文档。

但是...我所有的自定义文本标签都是空的,签名者可以在其中输入。我需要用来自数据库的签名者个人数据预先填充它们。我在我的 DocuSign 控制台和我的代码中以及 roleName->tagLabel 关系中三重检查自定义标签标签拼写、大写/小写。我的 PHP 代码如下。

谁能告诉我我做错了什么?

我花了两天时间。

$data = array(
"accountId" => $accountId,
"emailSubject" => $this->_emailSubject,
"templateId" => $templateId,
"templateRoles" => array(
               array(
                   "email" => $email,
                   "name" => $recipientName,
                   "clientUserId" => $clientUserId,
                   "roleName" => "signer",
                   "customFields" => array(
                                "textCustomFields" => array (
                                                      array (
                                                          "name" => "address",
                                                          "value" => "Address from DB",
                                                          "show" => "true",
                                                          ),
                                                      array (
                                                          "name" => "city",
                                                          "value" => "City from DB",
                                                          "show" => "true",
                                                          ),
                                                      array (
                                                          "name" => "state",
                                                          "value" => "State from DB",
                                                          "show" => "true",
                                                          ),
                                                      array (
                                                          "name" => "phone",
                                                          "value" => "Phone from DB",
                                                          "show" => "true",
                                                          ),

                                               ),
                                     ),
                ),
                  ),
"status" => "sent"
); 

【问题讨论】:

    标签: php docusignapi custom-tag


    【解决方案1】:

    您需要在 JSON 中使用 textTabs 类型,而不是用于其他用途的 customFields。例如,如果您将数据字段从 UI 拖到文档上并将其命名为 address,要预填充该字段,您需要引用它的 tabLabel 和值字段,如下所示:

    "roleName" => "signer",
    "tabs" => array(
        "textTabs" => array(
            array(
                "tabLabel"=> "address",
                "value" => "123 Main St."
            ) 
        )
    ) 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多