ZapSign API
Search…
Create document via Upload
post
https://api.zapsign.com.br
/api/v1/docs/?api_token={{access_token}}
Create document via Upload

Optional fields

  • Document - JSON root:
    • lang (string): document language. Possible values: "pt-br" (Portuguese), "es" (Spanish), "en" (English). Default: "pt-br"
    • disable_signer_emails (boolean): To disable emails sent to signers, send this parameter to true. Default: false
    • signed_file_only_finished (boolean): To disable the "Download Original" and "Download Signed" buttons from the signer experience, enable this flag. Thus, you are the one who will be in charge of delivering the signed_file to the signer. Default: false
    • brand_logo (string): If you want to customize the logo of the signing experience for this specific document, submit the image URL (must be a publicly accessible link). Default: ""
    • brand_primary_color (string): If you want to customize the primary (button) color of the signing experience for this specific document, send it in rgb or hexadecimal. Ex: "#0011ee". Default: ""
    • brand_name (string): if you want to customize the sender name of emails sent to the signer, enter the brand name here. For example, if you entered "XPTO Advogados", the sender of the email will be "XPTO Advogados via ZapSign". Max-length: 100 characters. Default: ""
    • external_id (string): ID of the document in your application. Default: ""
    • folder_path (string): path of the folder inside ZapSign where the document will be placed. If the folders do not exist, they will be created automatically. Requirements: (1) folder_path can be up to 255 characters long, (2) each folder can be up to 50 characters long, (3) there is a limit of 5 folder levels. Ex.: "/api/" or "/folder1/folder2/folder3/". Default: "/" (no folder).
    • created_by (string): email of the user who will be defined as creator of the document, for internal organization purposes. If the email does not exist or is not your account user, this parameter will be ignored. Default: "" (document will have account owner as creator)
    • date_limit_to_sign (DateTime): Deadline for signing the document. (Accepted formats: YYYY-MM-DD, YYYY-MM-DDTH:m:s.ssssssZ)
    • signature_order_active (boolean): If true, the signer's signatures will be ordered sequentially. Default: false
    • observers (array<string>): represents document observers (limit 20), i.e. email addresses that will be notified upon completion of the signature flow. It's an array of strings.
  • Signers - for each signer:
    • auth_mode (string): You can choose the signer's authentication method. Possible values are: "assinaturaTela" (default) (signature on screen), "tokenEmail", "assinaturaTela-tokenEmail", "tokenSms" and "assinaturaTela-tokenSms". They correspond to the same methods available in the web interface.
    • email (string): You can set the signer's email.
    • send_automatic_email (boolean): If true, ZapSign will send an email to the signer with the link to sign the document. If false (default), you will be responsible for sharing the subscription link with the signatory, whether through your website, widget, WhatsApp, SMS, email, chat etc. Note: For this to work, it is mandatory that the signer's email address is defined.
    • order_group (integer): In case "signature_order_active" is active in the document, this field controls the signing order. Example: If the field is set to 0, then this signer will be the first to sign. If the field is set to 1, then this signer will be the second to sign and so on.
    • custom_message (string): (only relevant if send_automatic_email: true). The custom_message is the personalized message that you can insert in the email sent by ZapSign to the signer. Example: "Hello So-and-so, \n This is your employment contract. \n Hugs, Team XPTO". The \n symbol serves to "skip a line" in the email text. Default: ""
    • phone_country (string): You can set the phone (country code) of the signer. Default: "" (ie. US is "1")
    • phone_number (string): You can set the phone number of the signer. Example: "11998989222". Default: ""
    • lock_email (boolean): You can lock changes to the signer's email. Default: false
    • lock_phone (boolean): You can lock changes to the signer's phone. Default: false
    • lock_name (boolean): You can lock changes to the signer's name. Default: false
    • require_selfie_photo (boolean): You can ask the signer to take a selfie while signing. Default: false.
    • require_document_photo (boolean): You can ask the signer to take a photo of your personal document while signing. Default: false
    • selfie_validation_type (string): If you want to use facial recognition (liveness+document match validation) provided by Truora, please also define this field as "liveness-document-match". Default: "none". Note that this feature has an extra cost, please contact sales.
    • qualification (string): Qualification to appear in the signatures report. Ex: "Witness" value will result in "Signed as a witness". Default: ""
    • external_id (string): ID of the signer in your application. Default: ""
    • redirect_link (string): link to redirect after signer signs. For example: "https://www.seusite.com.br/agracimento". It will appear as a "CONTINUE" button below the "Download Original" and "Download Signed" buttons. Remember to insert http:// or https:// at the beginning of the link. Default: ""

Exemple Request

Parameters must be in JSON format in the request body:
{
"name":"Contrato de Admissão João",
"base64_pdf":"JVBERi0xLjcNCiWhs8XXDQoxIDA...",
"brand_primary_color":"#000000",
"signers":[
{
"name":"João da Silva"
},
{
"name":"Fulano Siclano",
"email":"[email protected]",
"send_automatic_email":true,
"custom_message":"Olá Fulano, \n Este é o seu contrato de trabalho. \n Abraços, Equipe XPTO",
"lock_email":true,
"lock_phone":true,
"phone_country":"55",
"phone_number":"11977778600",
"auth_mode":"assinaturaTela-tokenSms"
}
]
}

Response

After a successful request, you should receive a response like this:
{
"open_id": 5,
"token": "eb9c367a-e62f-4992-8360-b0219deaeecc",
"status": "pending",
"name": "Contrato de Admissão João",
"original_file": "https://zapsign.s3.amazonaws.com/pdf/62xxxxx-d8fc-4392-8575-f3c46c3cfc7a/df6bac91-2766-4182-8c8b-ded5287e4c0f.pdf",
"signed_file": null,
"created_at": "2020-04-16T03:33:46.241747Z",
"last_update_at": "2020-04-16T03:33:46.241775Z",
"signers": [
{
"token": "921c115d-4a6e-445d-bdca-03fadedbbc0b",
"status": "new",
"name": "João da Silva",
"email": "",
"phone_country": "",
"phone_number": "",
"times_viewed": 0,
"last_view_at": null,
"signed_at": null
},
{
"token": "07fb0a0a-4b7d-49a5-bd7b-4958265c4e46",
"status": "new",
"name": "Fulano Siclano",
"email": "",
"phone_country": "",
"phone_number": "",
"times_viewed": 0,
"last_view_at": null,
"signed_at": null
}
]
}
What you should do with this response is send the signature link to the signers through your application.
The signature link consists of the route:
https://app.zapsign.co/verificar/{{signer_token}}
Thus, in the example above, where we have two signers, you must send two signature links, each signer with their respective token:
- João da Silva: https://app.zapsign.co/verificar/921c115d-4a6e-445d-bdca-03fadedbbc0b
- Fulano Siclano: https://app.zapsign.co/verificar/07fb0a0a-4b7d-49a5-bd7b-4958265c4e46
And now just wait for the signers to sign!

Code examples

PHP

<?php
$url = "https://api.zapsign.com.br/api/v1/docs/?api_token=1e19d1f9-69e0-4a66-b93d-e515fdf081c693b8b613-25e9-4536-b5df-76d25120449a";
$ch = curl_init( $url );
$base64 = 'JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZw0KL091dGxpbmVzIDIgMCBSDQovUGFnZXMgMyAwIFINCj4+DQplbmRvYmoNCg0KMiAwIG9iag0KPDwNCi9UeXBlIC9PdXRsaW5lcw0KL0NvdW50IDANCj4+D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XBlIC9UeXBlMQ0KL05hbWUgL0YxDQovQmFzZUZvbnQgL0hlbHZldGljYQ0KL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcNCj4+DQplbmRvYmoNCg0KMTAgMCBvYmoNCjw8DQovQ3JlYXRvciAoUmF2ZSBcKGh0dHA6Ly93d3cubmV2cm9uYS5jb20vcmF2ZVwpKQ0KL1Byb2R1Y2VyIChOZXZyb25hIERlc2lnbnMpDQovQ3JlYXRpb25EYXRlIChEOjIwMDYwMzAxMDcyODI2KQ0KPj4NCmVuZG9iag0KDQp4cmVmDQowIDExDQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTkgMDAwMDAgbg0KMDAwMDAwMDA5MyAwMDAwMCBuDQowMDAwMDAwMTQ3IDAwMDAwIG4NCjAwMDAwMDAyMjIgMDAwMDAgbg0KMDAwMDAwMDM5MCAwMDAwMCBuDQowMDAwMDAxNTIyIDAwMDAwIG4NCjAwMDAwMDE2OTAgMDAwMDAgbg0KMDAwMDAwMjQyMyAwMDAwMCBuDQowMDAwMDAyNDU2IDAwMDAwIG4NCjAwMDAwMDI1NzQgMDAwMDAgbg0KDQp0cmFpbGVyDQo8PA0KL1NpemUgMTENCi9Sb290IDEgMCBSDQovSW5mbyAxMCAwIFINCj4+DQoNCnN0YXJ0eHJlZg0KMjcxNA0KJSVFT0YNCg==';
$payload = array(
"name"=>"Contrato de Admissão João",
"signers"=>array(
array(
"name"=>"João da Silva"
),
array(
"name"=>"Fulano Siclano",
"email"=>"[email protected]",
"auth_mode"=>"tokenEmail"
)
),
"base64_pdf"=>$base64
);
$json_payload = json_encode($payload);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
// A depender da versão de php, curl e OpenSSL do seu servidor,
// você pode testar também outras opções do curl, como:
// curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
// curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
// curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, TRUE);
// curl_setopt ($ch, CURLOPT_SSLVERSION, 6);
// curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36");
// curl_setopt ($ch, CURLOPT_COOKIESESSION, TRUE);
// curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_payload );
// curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
// curl_setopt ($ch, CURLOPT_HEADER, 1);
// curl_setopt ($ch, CURLOPT_POST, true);
// curl_setopt ($ch, CURLOPT_FRESH_CONNECT , 1);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
// Para testes/debug, descomentar:
// echo $result;
// echo curl_getinfo($ch);
// echo curl_errno($ch);
// echo curl_error($ch);
curl_close($ch);

Python

import requests
url = "https://api.zapsign.com.br/api/v1/docs/?api_token=1e19d1f9-69e0-4a66-b93d-e515fdf081c693b8b613-25e9-4536-b5df-76d25120449a"
payload = "{\"name\":\"Contrato de Admissão João\",\"signers\":[{\"name\":\"João da Silva\"},{ \"name\":\"Fulano Siclano\"}],\"base64_pdf\":\"JVBERi0xLjcNCiWhs8XXDQoxIDA...\"}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))

Node.js

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.zapsign.com.br/api/v1/docs/?api_token=1e19d1f9-69e0-4a66-b93d-e515fdf081c693b8b613-25e9-4536-b5df-76d25120449a',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({"name":"Contrato de Admissão João","signers":[{"name":"João da Silva"},{"name":"Fulano Siclano"}],"base64_pdf":"JVBERi0xLjcNCiWhs8XXDQoxIDA..."})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

Delphi

var
json : string;
ArraySigner : TJSONArray;
ObjDoc, ObjSigner : TJSONObject;
begin
ObjDoc := TJSONObject.Create;
ObjDoc.AddPair('name', 'Contrato de Locação');
ObjDoc.AddPair('base64_pdf', 'ASFASDFKÇLKÇGÇO#OP%$%#WERP#@&*OSADFJF...'); // Arquivo base64
ArraySigner := TJSONArray.Create;
ObjSigner := TJSONObject.Create;
ObjSigner.AddPair('name', 'João da Silva');
ObjSigner.AddPair('email', '[email protected]');
ObjSigner.AddPair('phone_country', '55');
ObjSigner.AddPair('phone_number', '11888121111');
// Opcional caso queira impedir alteração
ObjSigner.AddPair('lock_name', TJSONTrue.Create);
ObjSigner.AddPair('lock_email', TJSONTrue.Create);
ObjSigner.AddPair('lock_phone', TJSONTrue.Create);
ArraySigner.AddElement(ObjSigner);
ObjDoc.AddPair('signers', ArraySigner);
json := ObjDoc.ToString;
ObjDoc.DisposeOf;
RESTClient.BaseURL := 'https://api.zapsign.com.br/api/v1/docs/?api_token=...seu token..';
Request_remete.ClearBody;
Request_remete.Body.Add(json,ContentTypeFromString('application/json'));
Request_remete.Execute;
end;