Notification/send and Signature/sign: Difference between pages

From SafeStamper API documentation
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
This operation sends a notification to destinataries
Uploads a document for signing
 
This operation receives HTML text that will be converted to PDF.
Any CSS or image file used by this HTML must be referenced using a full URL that is publicly accessible.
You may also use <style> blocks for CSS styles and [http://wiki.developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs data urls] for images and other files. This HTML should be simple and only include formatted text and images. It will be sanitized before its conversion to PDF, removing any problematic content such as javascript code.
 
You can upload a PDF file instead using [[signature/sign-pdf]].
 
For each signature, the signer name and email is provided.
 
An email or SMS will be sent to each document signer with an URL they must visit to sign the document.
When all signers have added their signature, a signature certificate will be generated and sent to all the document signers, and to the document sender e-mail address if specified.
 
Document signing process status can be queried using [[signature/status]].
 
If your API client has a [[API Overview#API callbacks|callback URL]], it will receive the following callbacks:
* DOCUMENT_SIGNATURE: When a signer signs the document
* SIGNATURE_CERTIFICATE: When the document signature certificate is ready
 
These callbacks receive the same JSON as returned from [[signature/status]].


= URL =
= URL =
<nowiki>https://web.safestamper.com/api/notification/send</nowiki>
<nowiki>https://www.safestamper.com/api/signature/sign</nowiki>


= Parameters =
= Parameters =
* '''sharedkey''': Your API client shared key
* '''sharedkey''': Your API client shared key
* '''authkey''': Authkey of notification owner
* '''authkey''': Authorization key, if needed
* '''recipientTypeN''': (multivalue) Send type of notification.
* '''html''': HTML of the document to sign
* '''recipientNameN''': (multivalue) Name of recipient of notification
* '''title''': Document title
* '''recipientMailN''': (multivalue) Mail of recipient of notification. In recipientTypeN equals EMAIL
* '''lang''': Language for signer e-mails and signature pages (default: es)
* '''recipientSmsN''': (multivalue) Phone of recipient of notification. In recipientTypeN equals SMS
** ''es'': Spanish
* '''subject''': Subject of the notification
** ''en'': English
* '''body''': text of the notification
* '''signaturemode''': How the signers will sign the document (default: GRAPHIC)
* '''attachment''': Attach file of notification
** ''GRAPHIC'': Graphic signature
** ''SMS'': One-time code sent by SMS
* '''sendername''': Name of the person or organization that sends this document to its signers. It will be referenced in the e-mail that the signers receive.
* '''senderemail''': E-mail address of the person or organization that sends this document to its signers (optional). If included, the signed document certificate will also be sent to this e-mail address.
* '''signername''N''''': Signer name for signature N
* '''notifymode''N''''': How to send the signature link to signer N (default: EMAIL)
** ''EMAIL'': Send link by e-mail
** ''SMS'': Send link by SMS
* '''signeremail''N''''': Signer e-mail address for signature N. Required for EMAIL notifymode
* '''signerphone''N''''': Signer mobile phone number for signature N. Required for SMS notifymode
** Phone number must include country prefix and no spaces or hyphens (eg. +34123456789)
* '''signerlang''N''''': Language for communication with signer N. Optional, defaults to document language (lang parameter).
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
** '''NOTE''': When calculating the signature use the attachment file name as the value of file parameter


= Returns =
= Returns =


A JSON object with list of following fields:
A JSON object with the following fields:
 
* '''code''': Document code
* '''title''': Document title
* '''senderName''': Sender name
* '''senderEmail''': Sender e-mail address
* '''entryDate''': Date of upload
* '''state''': Document state
** '''PENDING''': The document doesn't have all its signatures
** '''SIGNED''': The document has all its signatures and it has generated a signing certificate
* '''certificateCode''': Code of the signature certificate, if it has already been generated (for SIGNED documents)
* '''certificateUrl''': Validation URL of the signature certificate, if it has already been generated (for SIGNED documents)
** If the document status is queried when the document has just been signed by its last signer, it may be in SIGNED state, but the certificate may still be in process and the URL will not be available.
* '''signatures''': The list of signatures
** '''signerName''': Signer name
** '''signerEmail''': Signer e-mail address
** '''state''': Signature state
*** '''PENDING''': The signer has not answered yet
*** '''SIGNED''': The signer has signed the document
** '''signerIP''': IP address from which the document was signed
** '''signatureDate''': Date of signature


* '''entryDate''': Date of notification
* '''code''': Notification code
* '''uuid''': Notification uuid
* '''subject''': Subject of notification
* '''body''': Body content of notification
* '''recipientType''': Send type of the notification
* '''recipientMail''': E-mail address of the notification recipient
* '''recipientPhone''': Phone of the notification recipient
* '''recipientName''': Name of the notification recipient
* '''attachmentName''': Attachment name of notification
* '''state''': State of notification
** ''PENDING'' The notification is pending to read
** ''READ'' The notificaction has been read


= HTTP Errors =
= HTTP Errors =


* '''401''' Unauthorized: the authkey does not exist or is not authorized
* '''403''' Forbidden, the sharedkey or parameter signature are not valid
* '''403''' Forbidden: the sharedkey or signature are not valid
* '''401''' Unauthorized, the authkey is not valid
* '''400''' Parameter errors
* '''429''' Your Safe Stamper user has no certification credits available
* '''430''' Your Safe Stamper user has no storage space available


= Example =
= Example =


REQUEST:
This example uploads a document with 2 signers
 
REQUEST (line jumps are not included in the request):
<pre>
<pre>
https://web.safestamper.com/api/notification/send
https://www.safestamper.com/api/signature/sign
?authkey=0021d81c-e4a5-4869-8384-2fd70cdb58ec
?sharedkey=5hmpod0d2vx7fnh6ysxab3olz
&recipientType1=EMAIL
&html=<html>
&recipientMail1=sample@mail.com
      <body><h1>Test Document</h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p></body>
&recipientName1=Sample
      </html>
&subject=Example+notification
&title=Test Document
&body=Notification+text
&sendername=John Doe
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&senderemail=john@example.com
&signature=b1b22b34967fdf2eb67c3569a1e8b90f9fb63e77
&lang=es
&signatureid1=signature1
&signername1=Anne Example
&signeremail1=anne@example.com
&signatureid2=signature2
&signername2=Bernie Beans
&signeremail2=bernie@example.com
&signature=602382cc08c8db6929d2aac76ee13fc1266294e1
</pre>
</pre>


RESPONSE (actual response has no line breaks or indentation):
RESPONSE:
<pre>
<pre>
[
{
  {
  "code":"b508e6e9-e5f6-4bb5-beef-c89bf6b50764",
      "entryDate": "2017-03-16T12:59:08Z",
  "title":"Test Document",
      "code": "170316-6K5D2Q",
  "senderName":"John Doe",
      "uuid": "a59e091e-2338-4037-b383-91235bc0f9f3",
  "senderEmail":"john@example.com",
      "state": "PENDING",
  "state":"PENDING",
       "subject": "Example notification",
  "entryDate":"2019-07-29T09:18:46Z",
       "body": "Notification text"
  "signatures":[
       "recipientType": "EMAIL",
    {
       "recipientMail": "sample@mail.com",
       "signerName":"Anne Example",
       "recipientName": "Sample"
       "signerEmail":"anne@example.com",
       "recipientPhone": ""
       "state":"PENDING"
  }
    },
]
    {
       "signerName":"Bernie Beans",
       "signerEmail":"bernie@example.com",
       "state":"PENDING"
    }
  ]
}
</pre>
</pre>

Latest revision as of 15:27, 17 October 2023

Uploads a document for signing

This operation receives HTML text that will be converted to PDF. Any CSS or image file used by this HTML must be referenced using a full URL that is publicly accessible. You may also use <style> blocks for CSS styles and data urls for images and other files. This HTML should be simple and only include formatted text and images. It will be sanitized before its conversion to PDF, removing any problematic content such as javascript code.

You can upload a PDF file instead using signature/sign-pdf.

For each signature, the signer name and email is provided.

An email or SMS will be sent to each document signer with an URL they must visit to sign the document. When all signers have added their signature, a signature certificate will be generated and sent to all the document signers, and to the document sender e-mail address if specified.

Document signing process status can be queried using signature/status.

If your API client has a callback URL, it will receive the following callbacks:

  • DOCUMENT_SIGNATURE: When a signer signs the document
  • SIGNATURE_CERTIFICATE: When the document signature certificate is ready

These callbacks receive the same JSON as returned from signature/status.

URL

https://www.safestamper.com/api/signature/sign

Parameters

  • sharedkey: Your API client shared key
  • authkey: Authorization key, if needed
  • html: HTML of the document to sign
  • title: Document title
  • lang: Language for signer e-mails and signature pages (default: es)
    • es: Spanish
    • en: English
  • signaturemode: How the signers will sign the document (default: GRAPHIC)
    • GRAPHIC: Graphic signature
    • SMS: One-time code sent by SMS
  • sendername: Name of the person or organization that sends this document to its signers. It will be referenced in the e-mail that the signers receive.
  • senderemail: E-mail address of the person or organization that sends this document to its signers (optional). If included, the signed document certificate will also be sent to this e-mail address.
  • signernameN: Signer name for signature N
  • notifymodeN: How to send the signature link to signer N (default: EMAIL)
    • EMAIL: Send link by e-mail
    • SMS: Send link by SMS
  • signeremailN: Signer e-mail address for signature N. Required for EMAIL notifymode
  • signerphoneN: Signer mobile phone number for signature N. Required for SMS notifymode
    • Phone number must include country prefix and no spaces or hyphens (eg. +34123456789)
  • signerlangN: Language for communication with signer N. Optional, defaults to document language (lang parameter).
  • signature: Parameters signature, as explained in Signature parameter

Returns

A JSON object with the following fields:

  • code: Document code
  • title: Document title
  • senderName: Sender name
  • senderEmail: Sender e-mail address
  • entryDate: Date of upload
  • state: Document state
    • PENDING: The document doesn't have all its signatures
    • SIGNED: The document has all its signatures and it has generated a signing certificate
  • certificateCode: Code of the signature certificate, if it has already been generated (for SIGNED documents)
  • certificateUrl: Validation URL of the signature certificate, if it has already been generated (for SIGNED documents)
    • If the document status is queried when the document has just been signed by its last signer, it may be in SIGNED state, but the certificate may still be in process and the URL will not be available.
  • signatures: The list of signatures
    • signerName: Signer name
    • signerEmail: Signer e-mail address
    • state: Signature state
      • PENDING: The signer has not answered yet
      • SIGNED: The signer has signed the document
    • signerIP: IP address from which the document was signed
    • signatureDate: Date of signature


HTTP Errors

  • 403 Forbidden, the sharedkey or parameter signature are not valid
  • 401 Unauthorized, the authkey is not valid
  • 400 Parameter errors
  • 429 Your Safe Stamper user has no certification credits available
  • 430 Your Safe Stamper user has no storage space available

Example

This example uploads a document with 2 signers

REQUEST (line jumps are not included in the request):

https://www.safestamper.com/api/signature/sign
?sharedkey=5hmpod0d2vx7fnh6ysxab3olz
&html=<html>
      <body><h1>Test Document</h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p></body>
      </html>
&title=Test Document
&sendername=John Doe
&senderemail=john@example.com
&lang=es
&signatureid1=signature1
&signername1=Anne Example
&signeremail1=anne@example.com
&signatureid2=signature2
&signername2=Bernie Beans
&signeremail2=bernie@example.com
&signature=602382cc08c8db6929d2aac76ee13fc1266294e1

RESPONSE:

{
  "code":"b508e6e9-e5f6-4bb5-beef-c89bf6b50764",
  "title":"Test Document",
  "senderName":"John Doe",
  "senderEmail":"john@example.com",
  "state":"PENDING",
  "entryDate":"2019-07-29T09:18:46Z",
  "signatures":[
    { 
      "signerName":"Anne Example",
      "signerEmail":"anne@example.com",
      "state":"PENDING"
    },
    {
      "signerName":"Bernie Beans",
      "signerEmail":"bernie@example.com",
      "state":"PENDING"
    }
  ]
}