Skip to content

Instantly share code, notes, and snippets.

View radhack's full-sized avatar

Alex Griffen radhack

View GitHub Profile
@radhack
radhack / gist:9b2d2486138af453424b3e7474810aa3
Created April 28, 2017 15:56
quick HelloSign script example
<script type="text/javascript">
HelloSign.init("<?php echo $client_id ?>");
HelloSign.open({
url: "<?php echo $sign_url ?>",
uxVersion: 2,
allowCancel: true,
skipDomainVerification: true,
debug: true,
messageListener: function (eventData) {
(console.log("Got message data: " + JSON.stringify(eventData)));
@radhack
radhack / gist:c55c58242fcfb3fc9149ecae3545e733
Created April 27, 2017 15:54
Quick console example of embedded signing using a document with text tags
// embedded signature request using text tags
// this assumes you've initilized clientid and apiKey
SignatureRequest request = new SignatureRequest();
request.addFile(new File("/onesign_texttags.pdf")); //one signer in this case, so my PDF has tags for signer0 only
request.setSubject("My First embedded signature request");
request.setMessage("Awesome, right?");
request.addSigner("jack@example.com", "Jack");
request.setTestMode(true);
request.setUseTextTags(true);
request.setHideTextTags(true);
curl 'https://api.hellosign.com/v3/signature_request/send' \
-u 'my_app_key:' \
-F 'title=NDA with Acme Co.' \
-F 'subject=The NDA we talked about' \
-F 'message=Please sign this NDA and then we can discuss more. Let me know if you have any questions.' \
-F 'signers[0][email_address]=mymail@domain.com' \
-F 'signers[0][name]=Jack' \
-F 'signers[0][order]=0' \
-F 'cc_email_addresses[0]=lawyer@example.com' \
-F 'file[0]=@test.pdf' \