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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵