PHP:Docusign API自动填充模板的选项卡 [英] PHP: Docusign API autopopulate tabs for template

查看:89
本文介绍了PHP:Docusign API自动填充模板的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标:使用Beta标签,使用用于服务器模板的tabLabel / value键对自动填充某些值Docusign PHP客户端



我看过很多stackoverflow帖子,但不幸的是,该帖子似乎与我关系最密切:Docusign API-在通过模板创建的信封上预填充Tab值



我无法在任何偏好中找到此 SecureField选项。



当前,名称字段会自动填写,原因是模板角色的设置正确。我不必使用tabLabel键来完成此操作,这是自动完成的。我尝试创建公司标签,但该标签无法自动填充,所以我尝试了随机文本标签。



我目前已将库分叉并将其设置为PSR- 4兼容,并且为了实现此目标,我更改了以下文件:



TemplateRole模型:修改了构造函数以使其包含$ tabs,如果$ tabs则设置$ this-> tabs被设置。我添加了两个函数getTabs()/ setTabs($ tabs),它们的行为与获取/设置RoleName,Name,Email等相同。



RequestSignatureResource:在foreach中( $ templateRoles作为$ templateRole),我在array_pusy上添加了一个 tabs键,然后将$ templateRole-> getTabs()放入。



名称,人名,电子邮件,$ tabs)。



我可以在JSON请求数据中看到这些标签。我有什么想念的吗?



我还应该注意,我也使用了这篇文章作为灵感:。如何使用DocuSign API在服务器模板上预填充标签。这样做的问题是,如果我输入textTabs:{text:{tabLabel: something,value: some value}},那么我会从API得到响应,表明我的请求无效。我可以根据需要提供特定的错误。

解决方案

以下内容对我有用:

  $ templateRole = new DocuSign\eSign\Model\TemplateRole(); 
$ templateRole-> setClientUserId($ email);
$ templateRole-> setEmail($ email);
$ templateRole-> setName($ recipientName);
$ templateRole-> setRoleName($ templateRoleName);

$ textTab = new \DocuSign\eSign\Model\Text();
//我在docuSign网站上手动添加了此文本字段。
$ textTab-> setTabLabel(字段标签);
$ textTab-> setValue('Value');

$ tabs = new DocuSign\eSign\Model\Tabs();
$ tabs-> setTextTabs(array($ textTab));

$ templateRole-> setTabs($ tabs);


Objective: Autopopulate some values using the tabLabel/value key pair for server templates, using the beta Docusign PHP Client.

I've looked at quite a few stackoverflow posts and unfortunately the one that seems to be the closest related to me seems unanswered: Docusign API - prefilling tab values on envelope created from template

I was unable to find this "SecureField" option in any sort of preferences.

Currently, the name field fills in automatically just because of the template role being set accurately. I didn't have to do this with the tabLabel key, this was done automatically. I have tried creating a company tab, and that fails to autopopulate, so does a random text tab I have tried.

I have currently forked the library and made it PSR-4 compatible, and to achieve this objective I changed the following files:

TemplateRole Model: Modified the constructor to include $tabs, and set $this->tabs if $tabs is set. I added two functions getTabs()/setTabs($tabs) that behave the same as get/set RoleName, Name, Email, etc.

RequestSignatureResource: In the foreach ($templateRoles as $templateRole) I added a 'tabs' key to the array_pusy, and put $templateRole->getTabs().

I created a new TemplateRole('role name', 'person name', 'email', $tabs).

I can see the tabs in the JSON request data. Is there anything I'm missing?

I should also note that I used this post for inspiration, too: How to pre-fill tabs on a server template with the DocuSign API. The issue with this is that if I put textTabs:{text:{tabLabel:"something", value:"some value"}} then I get a response from the API that my request was invalid. I can provide that specific error upon request if needed.

解决方案

The following worked for me :

  $templateRole = new DocuSign\eSign\Model\TemplateRole();
  $templateRole->setClientUserId($email);
  $templateRole->setEmail($email);
  $templateRole->setName($recipientName);
  $templateRole->setRoleName($templateRoleName);

  $textTab = new \DocuSign\eSign\Model\Text();
  // I added this text field manually on docuSign site.
  $textTab->setTabLabel("Field Label");
  $textTab->setValue('Value');

  $tabs = new DocuSign\eSign\Model\Tabs();
  $tabs->setTextTabs(array($textTab));

  $templateRole->setTabs($tabs);

这篇关于PHP:Docusign API自动填充模板的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆