php - 如何将自定义表单数据附加到 HelloSign Api 模板?
问题描述
我需要将自定义表单数据附加到 HelloSign api 模板。表单在 HelloSign 页面之前填写 php 表单。我需要获取要在 HelloSign 模板中显示的表单数据的所有详细信息。
<form name="hellosign" method="post">
Name:<input type="text" name="name">
Phone: <input type="text" name="phone">
Email: <input type="text" name="email">
<input type="submit" value="submit">
</form>
<?php $client = new HelloSign\Client('62ae8b50d5293a72ae0aa31ef0f586d1fcf5c89707b9e68b906dd64864');
$request = new HelloSign\SignatureRequest;
$request->enableTestMode();
$request->setRequesterEmail('prasad@test.com');
$request->addFile('trxade.pdf');
$client_id = '0005fc6cf93ce7ce6116778555661';
$draft_request = new HelloSign\UnclaimedDraft($request, $client_id);
$draft_request->setIsForEmbeddedSigning(true);
$response = $client->createUnclaimedDraft($draft_request);
$claim_url = $draft_request->getClaimUrl();
foreach ($response as $key => $value) {
if($key === 'signature_request_id')
{
echo $requestId =$value;echo "<br/>";
}
}
echo $requestId;
<script type="text/javascript" src="https://s3.amazonaws.com/cdn.hellosign.com/public/js/hellosign-embedded.LATEST.min.js"></script>
<script>
HelloSign.init("0005fc6cf93ce7ce6116778555661");
HelloSign.open({
url: "<?= $claim_url;?>",
allowCancel: true,
skipDomainVerification:true
});
</script>
解决方案
您可以使用自定义字段将自定义表单数据附加到 HelloSign API 模板。您将需要完成本教程并密切关注演练的自定义字段部分: https ://app.hellosign.com/api/templatesAndApiWalkthrough
请记住将用于自定义字段的文本框设置为“发送时我”,因为这是一个常见错误。
您将要使用此端点: https ://app.hellosign.com/api/reference#send_with_template
上面的端点会给你一个带有模板的非嵌入式签名请求。
你想做嵌入式还是非嵌入式?
最后,您不需要此端点 HelloSign\UnclaimedDraft 来发送带有模板的签名请求。你可以删除它。
推荐阅读
- caching - 计算缓存命中率
- java - 对象的 ApiModelProperty 注释不能使用 swagger
- python - 使用 dictwriter 将字典嵌套到具有非统一(格式错误?)数据的 CSV
- actionscript-3 - 全屏手机有缺口或检测设备是否有 Adobe AIR 缺口?
- html - Bootstrap 4 的新手,列没有按应有的方式运行?
- version-control - RTC SCM 中的 Git 钩子等效项
- python-3.x - 如何在 python 中绘制 3D 网格天气雷达数据
- ruby-on-rails - 在rails中打印(在打印机上)文件
- javascript - 普通(香草)javascript中的jQuery.each()函数
- git - 如何使用 Visual Studio Git 避免不必要的合并