dongzg2006 2015-12-09 10:45
浏览 75
已采纳

如何使用Hellosign API在模板中附加所有者的标志?

This questions is regarding Hellosign API. I am creating a template where i want to owner's sign(Suppose, I am owner then my sign will append there automatically). I create it using Hellosign website but now i want to create it using hellosign API. Here i am generating dynamic template. So please give me answer. Thank you in advance.

Example (What i want)

Check this image please. I have a html-css block like below picture. I want to get default owner's signature and current date using hellosign.

Here is my code, what i have done

<!-- PHP code -->
<?php
require_once '../vendor/autoload.php';
$api_key   = ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$client_id = ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$client = new HelloSign\Client($api_key);
$request = new HelloSign\SignatureRequest;
$request->enableTestMode();
$request->setTitle("Testing");
$request->setSubject('My First embedded signature request');
$request->setRequesterEmail('yourname@yourmail.com');
$request->addFile('yourpage.html');
$embedded_request = new HelloSign\EmbeddedSignatureRequest($request, $client_id);
$response = $client->createEmbeddedSignatureRequest($embedded_request);
$response = $client->getEmbeddedSignUrl($signature_id);
$sign_url = $response->getSignUrl();
?>

<!-- Script code -->
<script type="text/javascript" src="//s3.amazonaws.com/cdn.hellofax.com/js/embedded.js"></script>
<script type="text/javascript">
    HelloSign.init('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz');
    var claim_url = "<?PHP echo $claim_url;?>";
     // alert(claim_url);
    HelloSign.open({
        url: claim_url,     
        allowCancel: false,
        skipDomainVerification: true,
        height: 640,
        width: 1368,
        requester: "your-name@your-mail.com",
        container: document.getElementById('wmtest'),
        messageListener: function(eventData) {
            alert("HelloSign event received");
        }    
    });
</script>
  • 写回答

1条回答 默认 最新

  • duandingyou3331 2015-12-09 18:18
    关注

    You mention templates, though your code is for embedded signing using a file/url. Here's an example of an embedded signature request using a template for reference:

    $client = new HelloSign\Client('f167bc93d1390z467k026h84c4f8b9a1aa8c043f5f58a54cd0db300766986254');
    $request = new HelloSign\TemplateSignatureRequest;
    $request->enableTestMode();
    $request->setTemplateId('c26b8a16784a872da37ea946b9ddec7c1e11dff6');
    $request->setSubject('Purchase Order');
    $request->setMessage('Glad we could come to an agreement.');
    $request->setSigner('Client', 'george@example.com', 'George');
    $request->setCC('Accounting', 'accounting@hellosign.com');
    $request->setCustomFieldValue('Cost', '$20,000');
    
    $client_id = 'YOUR_CLIENT_ID';
    $embedded_request = new HelloSign\EmbeddedSignatureRequest($request, $client_id);
    $response = $client->createEmbeddedSignatureRequest($embedded_request);
    

    Also, you wouldn't be able to sign the document programmatically. Instead, your options are either signing the document during Template creation on HelloSign.com, then using a Me (when sending) text box and passing the sign date as a CustomFieldValue with the signature request. Or you could include yourself as a signer along with your other signers, and bring up the signature request in an iframe just like your other signers.

    Please reach out to us at apisupport@hellosign.com for more information. Check out our documentation at https://www.hellosign.com/api/documentation. Or get live support for general questions https://www.hipchat.com/gq4BMFKt1

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集