Skip to content

Instantly share code, notes, and snippets.

View radhack's full-sized avatar

Alex Griffen radhack

View GitHub Profile
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' \
@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);
@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 / HelloSign Callback callback_test
Last active November 30, 2017 20:22
Raw callback_test callback event
POST /callback.php HTTP/1.1
Host: host.ngrok.io
Accept: */*
User-Agent: HelloSign API
Content-MD5: OTA1OGI4YTc1ZWQ2MjY4OWY2ZTlhZDIxNzU3NjEzZTA=
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------e8ca2ab77974
Content-Length: 449
X-Forwarded-For: 52.200.252.64
@radhack
radhack / gist:d18f32c95b27605ea3e61724536610cc
Created July 20, 2017 19:33
SESSION['signature_id'] Try Catch
<?php
require_once 'vendor/autoload.php';
include('auth.php');
if (isset($_SESSION['signature_id'])) {
try {
$client = new HelloSign\Client($api_key);
$embedded_response = $client->getEmbeddedSignUrl($_SESSION['signature_id']);
$sign_url = $embedded_response->getSignUrl();
include('signerpage.php');
} catch (Exception $e) {
@radhack
radhack / HelloSign Callback signature_request_all_signed
Last active August 19, 2019 16:54
Raw signature_request_all_signed callback event
POST /callback.php HTTP/1.1
Host: hstests.ngrok.io //your domain here
Accept: */*
User-Agent: HelloSign API
Content-MD5: md5HashHere=
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------58e538693ad6
Content-Length: 1813
X-Forwarded-Proto: https
X-Forwarded-For: 52.200.252.64
@radhack
radhack / HelloSign Callback signature_request_declined
Last active November 30, 2017 20:21
Raw signature_request_declined callback event
POST /callback.php HTTP/1.1
Host: hstests.ngrok.io
Accept: */*
User-Agent: HelloSign API
Content-MD5: ODkzODc1YzQ4MzliNzMyNGQxMGQyMDIyNGEwNjExNjY=
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------cdbbc9813ec9
Content-Length: 2272
X-Forwarded-Proto: https
X-Forwarded-For: 52.200.252.64
@radhack
radhack / HelloFax Fax Sent
Last active November 30, 2017 20:00
Raw and Complete HelloFax API Fax Sent Callback
POST /callback.php?type=outbound HTTP/1.1
Host: hstests.ngrok.io
Accept: */*
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------e2bdba1d3cf0
Content-Length: 520
X-Forwarded-For: 52.200.252.64
------------------------------e2bdba1d3cf0
Content-Disposition: form-data; name="json"
@radhack
radhack / HelloSign Callback siganture_request_sent
Last active November 30, 2017 20:21
Raw signature_request_sent callback event
POST /callback.php HTTP/1.1
Host: hstests.ngrok.io
Accept: */*
User-Agent: HelloSign API
Content-MD5: NTgwMWU1NzFiNTc2NWFlMzE4ODYyNTkwZDUyNzlmZjY=
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------026b03bdcde8
Content-Length: 1630
X-Forwarded-Proto: https
X-Forwarded-For: 52.200.252.64
@radhack
radhack / HelloSign Callback signature_request_invalid - form_fields_per_document
Last active November 30, 2017 21:45
Raw signature_request_invalid HelloSign Callback due to improper placement of form_fields_per_document
POST /callback.php HTTP/1.1
Host: hstests.ngrok.io
Accept: */*
User-Agent: HelloSign API
Content-MD5: MmEyYTc3MTlhMjVlZjY3ODNjYzk5MThhNDM5OWQ3MGE=
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------278a0352fbd2
Content-Length: 2465
X-Forwarded-Proto: https
X-Forwarded-For: 52.200.252.64