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 使用微信开发者工具实现一个“婚博会”小程序
  • ¥15 ros的rviz仿真机器人
  • ¥15 关于#linux#的问题(输入输出错误):出现这个界面接着我重新装系统,又让修电脑的师傅帮我扫描硬盘(没有问题)用着用着又卡死(相关搜索:固态硬盘)
  • ¥15 cv::resize不同线程时间不同
  • ¥15 web课程,怎么做啊😭没好好听课 根本不知道怎么下手
  • ¥15 做一个关于单片机的比较难的代码,然后搞一个PPT进行解释
  • ¥15 python提取.csv文件中的链接会经常出现爬取失败
  • ¥15 数据结构中的数组地址问题
  • ¥15 maya的mel里,怎样先选择模型A,然后利用mel脚本自动选择有相同名字的模型B呢。
  • ¥15 Python题,根本不会啊