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

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

报告相同问题?

悬赏问题

  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA