Introduction
In cooperation with (the developers) of our customers, Stiply has created a powerful and blazingly fast RESTful API, to integrate our first class signing service in your own projects. The Stiply API is very easy to use and the reference documentation below should get you started in no time. Should you have any questions regarding the API whatsoever, or do you need a function that is not yet supported, then please don’t hesitate to contact us at api@stiply.nl.
Authentication
To authenticate with the API, you need a valid account with API access enabled. Authentication is done through basic authentication. Therefore you need to add a HTTP header to every request you make to the API.
Example
GET /v1/sign_requests HTTP/1.1 Host: api.stiply.nl Authorization: Basic am9vf3RA4f3RdcGhkLn5sDfRhpa2tldm40dGVzdGlgcGVsbGlbg== Cache-Control: no-cache
JWT
We do support JSON Web Tokens (JWT) as an authentication method. Should you want to use JWT, please contact us for more information.
URL and version
The base URL of the Stiply API is https://api.stiply.nl
. The current version of the Stiply API is version 1. To use this the prefix for all API-calls is v1. https://api.stiply.nl/v1
Example
Should you want to use the PING function (as further described below) the URL you could call would be: https://api.stiply.nl/v1/actions/ping
How to use the API
To send a sign request to one or more signers, the following procedure should be followed:
- Create a sign request
- Add signer(s)
- Send sign request
The status of a sign request may be checked at every moment. Once a sign request has been signed by all signers, the signed document and the proof document can be downloaded through the API.
Wrapper
One of our clients created a PHP wrapper for the Stiply API, which makes it even easier to create and send sign requests through our API. It is available here: https://github.com/CyberfusionNL/StiplyAPI
Reference
Ping
POST actions/ping (JSON)
Description
Test the API connections and authentication header
Preconditions
–
Status codes
200 Success 400 Wrong parameter
Parameters
Provide data in JSON
Parameters | Value | Description |
---|---|---|
ping_value | string | A string to send to the API. If the API responds correctly the same string will be returned |
Example JSON
{"ping_value":"pong"}
Response
{ "ping_value": "pong", "status_code": "200" }
Create sign request
POST /sign_requests (FORM-DATA)
Description
Create new signature request.
Preconditions
–
Status codes
200 Success 400 Wrong parameter 415 Wrong media file type
Parameters
Provide data as FORM-DATA
Parameters | Value | Description |
---|---|---|
file | multipart/form-data | The file to be uploaded in DOC, DOCX or PDF |
term | string | 2 digit code representing the sign term (1d = 1 day, 2w = 2 weeks, 3m = 3 months) |
doc_name (optional) | string | The name of the document. Please note this is not the name of the file but merely a label for the document. |
message (optional) | string | The message to be included in the e-mail to the signers. |
comment (optional) | string | A comment for internal use. |
external_key (optional) (unique) | string | A key for your internal use so you don’t have to save the Stiply sign request key in your local database. However, your external key has to be unique. |
call_back_url (optional) | url | An URL to be called by Stiply when the last signer has signed the document. Please note that ?key={sign_request_key} shall be added to the call back url. |
Response
{ "data": { "document": { "name": "End-user license agreement", "filename": "license-agreement.pdf", "file_size": "224615", "created_at": "2017-03-29T13:43:07+0200", "updated_at": "2017-03-29T13:43:07+0200" }, "sign_request": { "key": "jgxfx3qYLaL9A2th3XejaOoODEp2QahRr1s5b3ki062JMu1k9n", "sent": 0, "sent_at": "0000-00-00 00:00:00", "all_signed": 0, "all_signed_at": "0000-00-00 00:00:00", "signed_hash": "", "proof_hash": "", "message": "Hi! Could you please sign our license agreement? Cheers!", "comment": "Customer wants to start asap", "external_key": "myexternalkey1234", "call_back_url": "https://www.myawesomewebsitecallbackurl.com/callback", "created_at": "2017-03-29T13:43:07+0200", "updated_at": "2017-03-29T13:43:07+0200", "terms": [ { "term_code": "1w", "term_expired": 0, "term_expires": "0000-00-00 00:00:00", "created_at": "2017-03-29T13:43:07+0200" } ], "signers": [] } } }
Create signer
POST /sign_requests/[:sign_request_key]/signers (JSON)
Description
Add signer to sign request. This url may be called multiple times on one sign request to add multiple signers to the sign request.
Preconditions
- Sign request must exist
- Sign request has not been sent
Status codes
200 Success 400 Wrong parameter 403 Precondition failed 404 Sign request not found
Parameters
Provide data as JSON
Parameters | Value | Description |
---|---|---|
signer_email | The e-mail address of signer | |
signer_signature_fields | json array | Array with arrays containing signature field information, by using either a tag or coordinates.TagsMake sure the document includes a tag where the signature field should be added. You can pick the name Example{"signer_email":"test@email.com", "signer_signature_fields":[{"name":"signature_1","width":"300"}, {"name":"signature_2"}]} CoordinatesTo add a field by coordinates you have to specify the page, x-coordinate and y-coordinate of the field. Example"signer_signature_fields":[{"page":1,"x":100,"y":200}] |
signer_text_fields (optional) | json array | Text fields can be added in the same ways as signature fields: with a tag or with coordinates. The maximum values for the X and Y coordinates are: X-max: 524 Y-max: 1060 The top left of the field shall be positioned on the top left of the tag, provided that the field does not cross the page boundaries. You can optionally specify the width of the field, also provided that you keep within the minimum and maximum field dimensions. Example"signer_text_fields"[{"name":"text_field_1","width":"150"}] or "signer_text_fields"[{"page":1,"x":300,"y":300}, {"page":2,"x":400,"y":400}] |
auth_method (optional) | string | Authentication method for signer. Currently sms , emandate and idin ;are available as a valid option. |
cell_phone_number (optional) | phone number | Cellular phone number of the signer is required in case auth_method is set to sms . Withoutsetting auth_method to sms the phone number will not be saved. Phone numbers need to contain a country code as follows: 31655136642 |
emandate (optional) | json array | You may add an optional emandate object, when auth_method is set to emandate . The emandateobject has three parameters:
Example{"signer_email":"signer@stiply.nl","signer_signature_fields":[{"name":"signature_1"}], "auth_method":"emandate", "emandate":{"instrument_code":"core", "sequence_type":"rcur","emandate_id":"12345"}} |
idin (optional) | json array | You may add an optional idin object, when auth_method is set to idin . The idin object has threeparameters:
Example{"signer_email":"signer@stiply.nl","signer_signature_fields":[{"name":"signature_1"}], "auth_method":"idin", "idin":{"prefix":"van der", "last_name":"meer","date_of_birth":"01-09-1982"}} |
language (optional) | string | The language in which the signer receives correspondence. Current options are nl ,de , es , en , da , pl , it , fr ,sv . If no language is provided, the account language of sender will be used. |
role (optional) | string | A signer can have different roles. When default, the signer will need to sign the document regularly. When the value cc is set as role, the signer shall be copy-only (cc). |
invitation_method (optional) | string | If you would like to invite the signer yourself, you should set the invitation_method to custom .In that case Stiply shall not send an email with the sign request to the signer. Instead, when you send the sign request, the API shall return a unique sign link to you, which you can provide to the signer yourself. |
message (optional) | string | You can send a specific message to a signer, that overrules the sign_request message in the mail to the signer. |
Example JSON
{"signer_email":"signer@stiply.nl","signer_signature_fields":[{"name":"signature_0"}],"signer_text_fields":[{"name":"text_0"}], "auth_method":"sms","cell_phone_number":"31612345678"}
Response
{ "data": { "key": "X7FylzU1MQlIaMEo4oec03lkQtI0wF2jtrEHQoXtotGDaDH5CI", "email": "signer@stiply.nl", "name": null, "order": 0, "language": "nl", "phone": 31612345678, "auth_method": "sms", "role": "", "sign_url": null, "emandate": [], "created_at": "2017-03-29T14:59:56+0200", "updated_at": "2017-03-29T14:59:57+0200", "signer_progresses": [], "fields": [ { "type": "signature", "x": 91.34, "y": 865.35, "width": 250, "height": 125, "page": 1, "created_at": "2017-03-29T14:59:57+0200", "updated_at": "2017-03-29T14:59:57+0200" }, { "type": "signature", "x": 144.64, "y": 755.36, "width": 230, "height": 20, "page": 1, "created_at": "2017-03-29T14:59:57+0200", "updated_at": "2017-03-29T14:59:57+0200" } ] } }
Send sign request
POST /sign_requests/[:sign_request_key]/actions/send
Description
Send sign request to first signer
Preconditions
- Sign request must exist
- Sign request has not been sent
- Sign request has at least 1 signer with at least 1 signature field
Status codes
200 Success 403 Precondition failed 404 Sign request not found
Parameters
–
Response
{ "data": { "document": { "name": "End-user license agreement", "filename": "license-agreement.pdf", "file_size": "224615", "created_at": "2017-03-29T13:43:07+0200", "updated_at": "2017-03-29T13:43:07+0200" }, "sign_request": { "key": "jfxfx3qYLoL9AHth3XejOOoODEp2QahRr1s5b3bi062JMu1k9n", "sent": 1, "sent_at": "2017-03-29T15:12:17+0200", "all_signed": 0, "all_signed_at": "0000-00-00 00:00:00", "signed_hash": "", "proof_hash": "", "message": "Hi! Could you please sign our license agreement? Cheers!", "comment": "Customer wants to start asap", "external_key": "myexternalkey1234", "call_back_url": "https://www.myawesomewebsitecallbackurl.com/callback", "created_at": "2017-03-29T13:43:07+0200", "updated_at": "2017-03-29T15:12:17+0200", "terms": [ { "term_code": "1w", "term_expired": 0, "term_expires": "2017-04-05T15:12:17+0200", "created_at": "2017-03-29T13:43:07+0200" } ], "signers": [ { "key": "X7FylzU1MQlIaMEo4oec03lkQtI0wF2jtrEHQoXtotGDaDH5CI", "email": "signer@stiply.nl", "name": null, "order": null, "phone": 31612345678, "auth_method": "sms", "created_at": "2017-03-29T14:59:56+0200", "updated_at": "2017-03-29T14:59:57+0200", "sign_url": null, "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T15:12:17+0200", "status": null } ] } ] } } }
Get signed document
GET /sign_requests/[:sign_request_key]/documents/actions/get_signed_document
Description
Get signed document of sign request.
Preconditions
- Sign request must exist
- Sign request has been signed by all signers
Status codes
200 Success 403 Precondition failed 404 Sign request not found
Parameters
–
Response
{ "file_name": "license-agreement-[Ondertekend].pdf", "mimeType": "application/pdf", "file_size": "244087", "hash": "d24fe514aafcg15a79a9k3blb95b0237d0hf4d", "data": "JVBERi0xLjUNCiW1tbW1 (... long base64 ...) 00gl93a==", "status_code": "200" }
Get proof document
GET /sign_requests/[:sign_request_key]/documents/actions/get_proof_document
Description
Get proof document of sign request.
Preconditions
- Sign request must exist
- Sign request has been signed by all signers
Status codes
200 Success 403 Precondition failed 404 Sign request not found
Parameters
–
Response
{ "file_name": "license-agreement-[Bewijs].pdf", "mimeType": "application/pdf", "file_size": "244087", "hash": "2289ac9gkei61bd5b2306f90e27743fkaa184e64a", "data": "jQKJcOkw7zDtsOfC (... long base64 string ...) hg4fsa==", "status_code": "200" }
Send reminder
POST /sign_requests/[:sign_request_key]/actions/send_reminder (JSON)
Description
Send a reminder e-mail to the current signer of the sign request.
Preconditions
- Sign request must exist
- Sign request has been sent
Status codes
200 Success 400 Wrong parameters 403 Precondition failed
Parameters
–
Response
{ "data": { "document": { "name": "End-user license agreement", "filename": "license-agreement.pdf", "file_size": "224615", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:57:19+0200" }, "sign_request": { "key": "eIGy1HCynD6B7QDo2gbsXeDoPKdjsLr1U8SNKGx1CMOzB77Peh", "sent": 1, "sent_at": "2017-03-29T16:58:16+0200", "all_signed": 0, "all_signed_at": "0000-00-00 00:00:00", "signed_hash": "", "proof_hash": "", "message": "Hi! Could you please sign our license agreement? Cheers!", "comment": "Customer wants to start asap", "external_key": "myexternalkey12345", "call_back_url": "https://www.myawesomewebsitecallbackurl.com/callback", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:58:16+0200", "terms": [ { "term_code": "1w", "term_expired": 0, "term_expires": "2017-04-05T16:58:16+0200", "created_at": "2017-03-29T16:57:19+0200" } ], "signers": [ { "key": "X7FylzU1MQlIaMEo4oec03lkQtI0wF2jtrEHQoXtotGDaDH5CI", "email": "signer@stiply.nl", "name": null, "order": null, "phone": 31612345678, "auth_method": "sms", "created_at": "2017-03-29T16:58:05+0200", "updated_at": "2017-03-29T16:58:06+0200", "sign_url": null, "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:16+0200", "status": "failed" }, { "action": "mail_reminder_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:27+0200", "status": null } ] } ] } } }
Extend term
POST /sign_requests/[:sign_request_key]/actions/extend_term (JSON)
Description
Extend the term of an existing sign request.
Preconditions
- Sign request must exist
- Sign request has been sent
- The current term of the sign request has been expired
Status codes
200 Success 400 Wrong parameters
Parameters
Provide data in JSON
Parameters | Value | Description |
---|---|---|
term | string | 2 digit code representing the sign term (1d = 1 day, 2w = 2 weeks, 3m = 3 months) |
Example JSON
{"term":"2d"}
Response
{ "data": { "document": { "name": "End-user license agreement", "filename": "license-agreement.pdf", "file_size": "224615", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:57:19+0200" }, "sign_request": { "key": "eIGy1HCynD6B7QDo2gbsXeDoPKdjsLr1U8SNKGx1CMOzB77Peh", "sent": 1, "sent_at": "2017-03-29T16:58:16+0200", "all_signed": 0, "all_signed_at": "0000-00-00 00:00:00", "signed_hash": "", "proof_hash": "", "message": "Hi! Could you please sign our license agreement? Cheers!", "comment": "Customer wants to start asap", "external_key": "myexternalkey12345", "call_back_url": "https://www.myawesomewebsitecallbackurl.com/callback", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:58:16+0200", "terms": [ { "term_code": "1w", "term_expired": 1, "term_expires": "2017-04-05T16:58:16+0200", "created_at": "2017-03-29T16:57:19+0200" }, { "term_code": "2d", "term_expired": 0, "term_expires": "2017-04-08T09:00:00+0200", "created_at": "2017-04-06T09:00:00+0200" }, ], "signers": [ { "key": "X7FylzU1MQlIaMEo4oec03lkQtI0wF2jtrEHQoXtotGDaDH5CI", "email": "signer@stiply.nl", "name": null, "order": null, "phone": 31612345678, "auth_method": "sms", "created_at": "2017-03-29T16:58:05+0200", "updated_at": "2017-03-29T16:58:06+0200", "sign_url": null, "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:16+0200", "status": "failed" }, { "action": "mail_term_extended_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:27+0200", "status": null } ] } ] } } }
Get sign request key
GET /sign_requests/[:your_external_key]/actions/get_sign_request_key
Description
Get sign request key from external key (your local key).
Preconditions
- Sign request must exist
Status codes
200 Success 400 External key not found or invalid
Parameters
–
Response
{ "key": "eIGy1HCynD6B7QDo2gbsXeDoPKdjsLr1U8SNKGx1CMOzB77Peh", "status_code": "200" }
Get sign request
GET /sign_requests/[:sign_request_key]
Description
Get a specific sign request
Preconditions
- Sign request must exist
Status codes
200 Success 404 Sign request not found
Parameters
–
Response
{ "data": { "document": { "name": "End-user license agreement", "filename": "license-agreement.pdf", "file_size": "224615", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:57:19+0200" }, "sign_request": { "key": "eIGy1HCynD6B7QDo2gbsXeDoPKdjsLr1U8SNKGx1CMOzB77Peh", "sent": 1, "sent_at": "2017-03-29T16:58:16+0200", "all_signed": 0, "all_signed_at": "0000-00-00 00:00:00", "signed_hash": "", "proof_hash": "", "message": "Hi! Could you please sign our license agreement? Cheers!", "comment": "Customer wants to start asap", "external_key": "myexternalkey12345", "call_back_url": "https://www.myawesomewebsitecallbackurl.com/callback", "created_at": "2017-03-29T16:57:19+0200", "updated_at": "2017-03-29T16:58:16+0200", "terms": [ { "term_code": "1w", "term_expired": 1, "term_expires": "2017-04-05T16:58:16+0200", "created_at": "2017-03-29T16:57:19+0200" }, { "term_code": "2d", "term_expired": 0, "term_expires": "2017-04-08T09:00:00+0200", "created_at": "2017-04-06T09:00:00+0200" }, ], "signers": [ { "key": "X7FylzU1MQlIaMEo4oec03lkQtI0wF2jtrEHQoXtotGDaDH5CI", "email": "signer@stiply.nl", "name": null, "order": null, "phone": 31612345678, "auth_method": "sms", "created_at": "2017-03-29T16:58:05+0200", "updated_at": "2017-03-29T16:58:06+0200", "sign_url": null, "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:16+0200", "status": "failed" }, { "action": "mail_reminder_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:27+0200", "status": null } ] } ] } } }
Delete sign request
DELETE /sign_requests/[:sign_request_key]
Description
Delete a specific sign request
Preconditions
- Sign request must exist
Status codes
200 Success 404 Sign request not found 422 Deleting sign request not succesful
Parameters
–
Response
{ "message": "Ondertekenverzoek en document succesvol verwijderd.", "status_code": "200" }
Get signer
GET /sign_requests/[:sign_request_key]/signers/[:signer_key]
Description
Get a specific signer
Preconditions
- Sign request must exist
- Signer must exist
Status codes
200 Success 404 Sign request or signer not found
Parameters
–
Response
{ "data": [ { "key": "xuSfW4HkRZHW2dRZipk8jIefqYVsMdWXK3QmWALbMJ216NPdRZ", "email": "signer@stiply.nl", "name": null, "order": 0, "language": "nl", "phone": 31612345678, "auth_method": "sms", "role": "", "sign_url": null, "emandate": [], "created_at": "2017-03-29T16:58:05+0200", "updated_at": "2017-03-29T16:58:06+0200", "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:16+0200" }, { "action": "mail_reminder_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:27+0200" } ], "fields": [ { "type": "signature", "x": 91.34, "y": 865.35, "width": 250, "height": 125, "page": 1, "created_at": "2017-03-29T16:58:06+0200", "updated_at": "2017-03-29T16:58:06+0200" }, { "type": "signature", "x": 144.64, "y": 755.36, "width": 230, "height": 20, "page": 1, "created_at": "2017-03-29T16:58:06+0200", "updated_at": "2017-03-29T16:58:06+0200" } ] } ] }
Update signer
PUT /sign_requests/[:sign_request_key]/signers/[:signer_key] (JSON)
Description
Update the e-mail address and/or telephone number of a signer who has not yet signed. It is required to post both values, email and phone, when updating. Should you only want to update one of these, just submit the original value of the other.
Please note that in case a signer has already received the sign request email and you update the email address of the signer afterwards, the link in the signer’s e-mail will not work anymore. The signer shall not receive a new sign request e-mail on the new e-mail address. Please use Send Reminder for that purpose after the e-mail address has been updated. If you only update the phone number the original sign link still works so no reminder is required.
Preconditions
- Sign request must exist
- Signer must exist
- Signer has not signed
Status codes
200 Success 400 Wrong parameters 404 Sign request or signer not found
Parameters
Provide data in JSON
Parameters | Value | Description |
---|---|---|
new_email | New email of signer to which the reminder mail will be send. This value will replace the e-mail of the signer permanently | |
new_cell_phone_number | phone number | New phone number of signer to which the authentication text will be send. This value will replace phone number of the signer permanently |
Example JSON
{"new_email":"newemail@stiply.nl","new_cell_phone_number":"+31612345678"}
Response
{ "data": [ { "key": "xuSfW4HkRZHW2dRZipk8jIefqYVsMdWXK3QmWALbMJ216NPdRZ", "email": "newemail@stiply.nl", "name": null, "order": 0, "language": "nl", "phone": 31612345678, "auth_method": "sms", "role": "", "sign_url": null, "emandate": [], "created_at": "2017-03-29T16:58:05+0200", "updated_at": "2017-03-29T16:58:06+0200", "signer_progresses": [ { "action": "mail_signrequest_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:16+0200" }, { "action": "mail_reminder_sent", "ip": null, "location": null, "system": null, "value": "signer@stiply.nl", "created_at": "2017-03-29T16:58:27+0200" } ], "fields": [ { "type": "signature", "x": 91.34, "y": 865.35, "width": 250, "height": 125, "page": 1, "created_at": "2017-03-29T16:58:06+0200", "updated_at": "2017-03-29T16:58:06+0200" }, { "type": "signature", "x": 144.64, "y": 755.36, "width": 230, "height": 20, "page": 1, "created_at": "2017-03-29T16:58:06+0200", "updated_at": "2017-03-29T16:58:06+0200" } ] } ] }
Delete signer
DELETE /sign_requests/[:sign_request_key]/signers/[:signer_key]
Description
Delete a specific signer
Preconditions
- Sign request must exist
- Sign request has not been sent
- Signer must exist
Status codes
200 Success 404 Sign request not found 422 Deleting signer not succesful
Parameters
–
Response
{ "message": "Ondertekenaar succesvol verwijderd.", "status_code": "200" }