douxi2670 2018-10-22 17:21
浏览 33

如何使用PHP SDK将文本发布到模板?

We have created template via the web interface.

In template we add two text fields!

We follow DocuSign PHP SDK, and we receive test email, but without populated document.

PHP code:

$templateRole = new  \DocuSign\eSign\Model\TemplateRole();
$templateRole->setEmail("example+11000@email.com");
$templateRole->setName("NN");
$templateRole->setRoleName("Boss");

// custom textTabs
$templateRole->setTabs([
    "textTabs"=>[
        [
            "tabLabel"=>"\\*TextDate",
            "value"=> "24/10/18"
        ],
        [
            "tabLabel"=>"\\*TextName",
            "value"=> "my text"
        ]
    ]
]);

log:

POST https://demo.docusign.net:7801/restapi/v2/accounts/42****/envelopes

TraceToken: d357c21d-60f3-*********************
Timestamp: 2018-10-23T10:09:07.5516969Z

Content-Length: 356
Content-Type: application/json
Accept: application/json
Host: demo.docusign.net
User-Agent: Swagger-Codegen/2.0.1/php
X-DocuSign-Authentication: {"Username":"ms@*********.com","Password":"[omitted]","IntegratorKey":"[omitted]"}
X-DocuSign-SDK: PHP
X-SecurityProtocol-Version: TLSv1.2
X-SecurityProtocol-CipherSuite: ECDHE-RSA-AES256-**********
x-forwarded-for: 213.61.************

{"emailSubject":"[DocuSign PHP SDK] - Signature Request Sample","status":"sent","templateId":"cca2833f-de76-****************","templateRoles":[{"email":"np@**********.com","name":"NN","roleName":"boss","tabs":{"textTabs":[{"tabLabel":"\\*TextDate","value":"24/10/18"},{"tabLabel":"\\*TextName","value":"my text"}]}}]}
201 Created
Content-Type: application/json; charset=utf-8
X-DocuSign-TraceToken: d357c21d-60f3-477d-**************

{
  "envelopeId": "6833c3dc-e2e3-407e-*****************",
  "uri": "/envelopes/6833c3dc-e2e3-407e-*****************",
  "statusDateTime": "2018-10-23T10:09:07.0830000Z",
  "status": "sent"
}

UPDATE

  • We created / upload template in appdemo
  • We add text fields via admin interface
  • we want to populate this text field when run php script (docusign-php-client) or using simple CURL scripts from api documentations.
  • when run php script, we send email, but in document is not populated our text fields.

How to setup this php client to add our text in uploaded template?

Any idea?

  • 写回答

1条回答 默认 最新

  • dongzu3511 2018-10-23 14:56
    关注

    Look at the signature of the setTabs() method, an \DocuSign\eSign\Model\Tabs is expected.

    • @param \DocuSign\eSign\Model\Tabs $tabs

      $tabs = new \DocuSign\eSign\Model\Tabs();
      $tab = new \DocuSign\eSign\Model\Text();
      $tab->setName('my_field');
      $tab->setTabLabel('My Label');
      $tab->setAnchorString('my_anchor_string');
      //or
      $tab->setXPosition(100);
      $tab->setYPosition(100);
      $tab->setPageNumber(1);
      
      $tabs[] = $tab;
      $templateRole->setTabs($tabs);
      ...
      
    评论

报告相同问题?

悬赏问题

  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?