### Complete ZapSign Batch Signing Example in Java Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-signatarios/signinbatch An integrated example demonstrating the complete process of batch signing using the ZapSign Java SDK, from imports and token configuration to building the request and handling the response. ```java import body.signer.SignBatch; import signers.SignerRequest; import java.util.ArrayList; public class SignInBatch { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; String userToken = "TOKEN USUÁRIO"; String signer_token1 = "TOKEN DO SIGNATÁRIO 1"; String signer_token2 = "TOKEN DO SIGNATÁRIO 2"; ArrayList signers_token = new ArrayList<>(); signers_token.add(signer_token1); signers_token.add(signer_token2); SignBatch signBatch = SignBatch.builder() .user_token(userToken) .signer_tokens(signers_token) .build(); try { String response = new SignerRequest(apiToken).signInBatch(signBatch); System.out.println(response); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### Create Document from Template (JavaScript Example) Source: https://docs.zapsign.com.br/documentos/criar-documento-via-modelo Example of a JavaScript request to the ZapSign API to create a document from a template. It shows the structure of the request body, including document details and signer information. ```javascript { "open_id": 5, "token": "eb9c367a-e62f-4992-8360-b0219deaeecc", "status": "pending", "name": "Contrato de Admissã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", "sign_url": "https://app.zapsign.com.br/verificar/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, "resend_attempts": null } ], "answers": [ { "variable": "NOME COMPLETO", "value": "Nome Teste" }, { "variable": "NÚMERO DO CPF", "value": "99999999999" }, { "variable": "ENDEREÇO COMPLETO", "value": "Endereço teste" } ] } ``` -------------------------------- ### Complete Example: Create Document from Upload Async in Java Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/createdocfromuploadasync A full Java code example demonstrating the entire process of creating a document asynchronously from a PDF upload using the ZapSign SDK. It includes all necessary imports, configurations, method calls, and error handling. ```java import body.doc.DocFromPdf; import body.signer.Signer; import docs.DocRequests; import response.DocAsyncResponse; import services.JsonConverter; import java.util.ArrayList; public class CreateDocFromUploadAsync { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; Signer signer1 = Signer.builder() .name("My First Signer") .build(); Signer signer2 = Signer.builder() .name("My Second Signer") .email("test@test.com") .lock_email(true) .lock_phone(true) .phone_country("55") .phone_number("99999999999") .auth_mode("assinaturaTela") .send_automatic_email(false) .send_automatic_whatsapp(false) .build(); ArrayList signers = new ArrayList<>(); signers.add(signer1); signers.add(signer2); DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder() .sandbox(false) .name("My Contract") .brand_primary_color("#000000") .lang("pt-br") .signers(signers) .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf") .build(); try { DocAsyncResponse docAsyncResponse = new DocRequests(apiToken).createDocFromUploadAsync(docFromPdf); String jsonDocResponse = new JsonConverter().docAsyncResponseToJson(docAsyncResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### API Response Examples Source: https://docs.zapsign.com.br/signatarios/assinar-em-lote-via-api These examples show typical responses from the ZapSign API. A 200 success response confirms that the signing request has been processed asynchronously. A 404 error indicates that the provided user or signer tokens were not found. ```json {"message":"Documento(s) assinado(s) com sucesso. Lembrete: este endpoint é assíncrono, então aguarde os PDF finais ficarem prontos via webhooks ou confira-os daqui alguns minutos."} ``` ```json {"detail": "Não encontrado."} ``` -------------------------------- ### Successful Document Creation Response (200 OK) Source: https://docs.zapsign.com.br/documentos/criar-documento-via-modelo Example of a successful API response when a document is created. It includes the document's open ID, token, and initial status. ```json { "open_id": 5, "token": "eb9c367a-e62f-4992-8360-b0219deaeecc", "status": "pending" } ``` -------------------------------- ### Complete Example: Add Extra Document to ZapSign in Java Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/addextradoc A comprehensive example demonstrating the complete workflow of adding an extra document using the ZapSign Java SDK. It includes all necessary imports, token configurations, object creation, and method calls within a main method. ```java import body.doc.ExtraDoc; import docs.DocRequests; import response.ExtraDocResponse; import services.JsonConverter; public class AddExtraDoc { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; String docToken = "TOKEN DOCUMENTO ORIGINAL"; ExtraDoc extraDoc = ExtraDoc.extraDocBuilder() .name("Extra doc") .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf") .build(); try { ExtraDocResponse extraDocResponse = new DocRequests(apiToken).addExtraDoc(docToken, extraDoc); String jsonExtraDocs = new JsonConverter().extraDocToJson(extraDocResponse); System.out.println(jsonExtraDocs); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### Java - Complete example for adding a signer Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-signatarios/addsigner A full Java program demonstrating how to add a signer to a ZapSign document. It includes all necessary steps from importing classes to handling potential errors. ```java import body.signer.Signer; import services.JsonConverter; import signers.SignerRequest; public class AddSigner { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; String docToken = "TOKEN DOCUMENTO"; Signer signer = Signer.builder() .name("New signer Name") .email("newEmail@test.com") .lock_email(true) .lock_phone(true) .phone_country("55") .phone_number("99999999999") .auth_mode("assinaturaTela") .send_automatic_email(false) .send_automatic_whatsapp(false) .build(); try { Signer signerResponse = new SignerRequest(apiToken).addSigner(docToken, signer); String jsonDocResponse = new JsonConverter().signerToJson(signerResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### Java - Complete Example for ZapSign getDocs Functionality Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/getdocs A complete Java program demonstrating the usage of the getDocs method from the ZapSign SDK. This example includes all necessary imports, API token initialization, the API call with error handling, and printing the result. It serves as a self-contained illustration of retrieving document data. ```java import docs.DocRequests; import response.DocsResponse; import services.JsonConverter; public class GetDocs { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; try { DocsResponse docsResponse = new DocRequests(apiToken).getDocs(); String jsonDocResponse = new JsonConverter().docsResponseToJson(docsResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### ZapSign Primary Document Response Example (JavaScript) Source: https://docs.zapsign.com.br/documentos/detalhar-documento This JavaScript object represents a typical response for a primary document in ZapSign. It includes document metadata, temporary file links ('original_file', 'signed_file'), status, and details about associated signers and extra documents. Note that 'original_file' and 'signed_file' links expire after 60 minutes. ```javascript { "sandbox": false, "external_id": "", "open_id": 16, "token": "965ea3fa-938a-4b7d-84ed-7d7598b17231", "name": "sample.pdf", "folder_path": "/", "status": "pending", "lang": "pt-br", "original_file": "https://zapsign.s3.amazonaws.com/aaa/aaa5e7a6-56dd-4ad9-9a1c-6e7022fbfafa/658bee7b-1dd7-442c-b426-4f111aaedffb.pdf", "signed_file": null, "extra_docs": [ { "open_id": 17, "token": "50c7d90e-ead6-46b5-99d6-33d2d3b9a31f", "name": "doc extra1.pdf", "original_file": "https://zapsign.s3.amazonaws.com/aaa/48025712-b429-4216-8a33-d90c575d0b7f/0e2d0a87-a0f6-4a49-a05f-7a439fd7308e.pdf", "signed_file": null }, { "open_id": 18, "token": "c8f2a1c4-58f2-4240-bcf5-f1dc34b07a7c", "name": "doc extra2.pdf", "original_file": "https://zapsign.s3.amazonaws.com/aaa/52d81e46-64ea-4a2d-9171-c5c8907d895c/9b1353c8-73cd-4cca-a342-ba1e7f0354a9.pdf", "signed_file": null }, { "open_id": 19, "token": "733b7538-cd38-41c1-abe7-07d06e4f6b8d", "name": "doc extra3.pdf", "original_file": "https://zapsign.s3.amazonaws.com/dev/2021/8/api/57a8bb75-641f-4cf6-962c-587774188dce.pdf", "signed_file": null } ], "created_through": "api", "deleted": false, "deleted_at": null, "signed_file_only_finished": false, "disable_signer_emails": false, "brand_logo": "", "brand_primary_color": "", "created_at": "2021-08-23T22:04:06.650460Z", "last_update_at": "2021-08-23T22:44:06.901255Z", "created_by": { "email": "teste@gmail.com" }, "signers": [ { "external_id": "", "token": "ca63b929-c053-4f7b-8680-8f0380ca4a57", "status": "new", "name": "João da Silva", "lock_name": false, "email": "", "lock_email": false, "phone_country": "55", "phone_number": "", "lock_phone": false, "times_viewed": 0, "last_view_at": null, "signed_at": null, "auth_mode": "assinaturaTela", "qualification": "", "require_selfie_photo": false, "require_document_photo": false, "geo_latitude": null, "geo_longitude": null, "redirect_link": "", "resend_attempts": { "whatsapp": 0, "email": 0, "sms": 0 }, "send_automatic_whatsapp_signed_file": null } ], "answers": [ { "variable": "NOME COMPLETO", "value": "Nome Teste" }, { "variable": "NÚMERO DO CPF", "value": "99999999999" }, { "variable": "ENDEREÇO COMPLETO", "value": "Endereço teste" } ] } ``` -------------------------------- ### ZapSign Extra Document Response Example (JavaScript) Source: https://docs.zapsign.com.br/documentos/detalhar-documento This JavaScript object shows a simplified response when querying an 'extra_doc' (an additional document associated with a primary one) in ZapSign. It includes the extra document's token, name, file links, and importantly, the 'parent_doc_token' linking it back to the main document. Like primary documents, file links are temporary. ```javascript { "open_id": 22, "token": "a35c3333-5c6e-4dbf-99cc-fc6345f91d8c", "name": "doc extra 1.pdf", "original_file": "https://zapsign.s3.amazonaws.com/aaa/f42c4315-ccf9-48c9-97df-ddd14ec5b865/e3a670c8-c811-45ef-a392-08b68db49a41.pdf", "signed_file": null, "parent_doc_token": "965ea3fa-938a-4b7d-84ed-7d7598b17231" } ``` -------------------------------- ### POST /api/v1/docs/ Source: https://docs.zapsign.com.br/documentos/oneclick/criar-documento-oneclick This endpoint allows creating a document for one-click signing from a PDF or DOCX file. It's recommended when you already have the final file and just need to configure the document and signatories. You should send the data in JSON format and will receive the response in the same format. ```APIDOC ## POST /api/v1/docs/ ### Description Creates a document for one-click signing from a PDF or DOCX file. This is useful when you have the final document and need to set up signatories and document details. ### Method POST ### Endpoint https://api.zapsign.com.br/api/v1/docs/ ### Parameters #### Headers - **Authorization** (string) - Required - Api token prefixed with "Bearer". Example: Bearer c7f35c84-7893-4087-b4fb-d1f06c23 ### Request Body *This endpoint requires a request body containing document details and signatory information. The exact structure depends on the specific fields needed for document creation. Please refer to the ZapSign documentation for the full schema.* ### Request Example ```json { "example": "request body structure for document creation" } ``` ### Response #### Success Response (200 or 201) - **document_id** (string) - The unique identifier for the created document. - **status** (string) - The current status of the document. #### Response Example ```json { "document_id": "doc_abc123xyz", "status": "pending" } ``` **Note:** To send multiple documents in an envelope for simultaneous signing, first create the document using this endpoint, then add other documents using the "Add attachment (extra document)" endpoint. ``` -------------------------------- ### Complete Example: Create Doc From Upload PDF (Java) Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/createdocfromuploadpdf A full Java program demonstrating the entire process of creating a document from an uploaded PDF using the ZapSign SDK. This includes all necessary imports, configurations, and API calls within a main method. ```java import body.doc.DocFromPdf; import body.signer.Signer; import docs.DocRequests; import response.DocResponse; import services.JsonConverter; import java.io.IOException; import java.util.ArrayList; public class CreateDocFromUploadPdf { public static void main(String[] args) throws IOException, InterruptedException { String apiToken = "SEU TOKEN"; Signer signer1 = Signer.builder() .name("My First Signer") .build(); Signer signer2 = Signer.builder() .name("My Second Signer") .email("test@test.com") .lock_email(true) .lock_phone(true) .phone_country("55") .phone_number("99999999999") .auth_mode("assinaturaTela") .send_automatic_email(false) .send_automatic_whatsapp(false) .build(); ArrayList signers = new ArrayList<>(); signers.add(signer1); signers.add(signer2); DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder() .sandbox(false) .name("My Contract") .brand_primary_color("#000000") .lang("pt-br") .signers(signers) .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf") .build(); try { DocResponse docResponse = new DocRequests(apiToken).createDocFromUploadPdf(docFromPdf); String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### GET /api/v1/docs/{{doc_token}}/ Source: https://docs.zapsign.com.br/documentos/detalhar-documento Retrieves detailed information about a specific document, including its status, associated signers, and URLs for original and signed files. ```APIDOC ## GET /api/v1/docs/{{doc_token}}/ ### Description This endpoint allows you to view all attributes of your document, such as status, signers, and the URL of the original and signed files. ### Method GET ### Endpoint `https://api.zapsign.com.br/api/v1/docs/{{doc_token}}/` ### Parameters #### Path Parameters - **doc_token** (string) - Required - Token of the document #### Headers - **Authorization** (string) - Required - Api token prefixed with "Bearer". Ex: `Bearer c7f35c84-7893-4087-b4fb-d1f06c23` ### Response #### Success Response (200) Document Found - **open_id** (integer) - The unique identifier for the document. - **token** (string) - The unique token associated with the document. - **status** (string) - The current status of the document (e.g., 'pending', 'signed'). - **name** (string) - The name or title of the document. - **original_file** (string) - URL to the original, unsigned document file. - **signed_file** (string|null) - URL to the signed document file, or null if not yet signed. - **created_at** (string) - Timestamp when the document was created. - **last_update_at** (string) - Timestamp when the document was last updated. - **signers** (array) - An array of signer objects associated with the document. - **token** (string) - The unique token for the signer. - **status** (string) - The current status of the signer (e.g., 'new', 'link-opened', 'signed'). - **name** (string) - The name of the signer. - **email** (string) - The email address of the signer. - **phone_country** (string) - The country code for the signer's phone number. - **phone_number** (string) - The signer's phone number. - **times_viewed** (integer) - The number of times the signer has viewed the document link. - **last_view_at** (string|null) - Timestamp when the signer last viewed the document link. - **signed_at** (string|null) - Timestamp when the signer signed the document. ### Response Example ```json { "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/62xxxx7-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 } ] } ``` ### Document Statuses - **pending**: Document is in progress. - **signed**: All signers have signed the document. ### Signer Statuses - **new**: Signer has been created. - **link-opened**: Signer has opened the document link at least once. - **signed**: Signer has signed the document. ### Notes It is recommended to use webhooks instead of polling the documents endpoint frequently to receive real-time updates and save computational resources. ``` -------------------------------- ### Get Document Details API Response (JavaScript) Source: https://docs.zapsign.com.br/documentos/detalhar-documento This snippet shows the JSON response structure when a document is successfully retrieved. It includes the document's token, status, file URLs, creation and update timestamps, and an array of signers with their respective details and statuses. This response is typically received after making a GET request to the document details endpoint. ```javascript { "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/62xxxx7-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 } ] } ``` -------------------------------- ### Java: Configurar e Criar Documento a partir de Template Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/createdocfromtemplate Demonstra o uso do SDK Java para instanciar e configurar um `DocFromTemplate` com dados de signatário e detalhes do template. Inclui a chamada para a API e tratamento de erros, retornando uma resposta `DocResponse` ou uma mensagem de erro. ```java import body.doc.DeParaTemplate; import body.doc.DocFromTemplate; import docs.DocRequests; import response.DocResponse; import services.JsonConverter; import java.util.ArrayList; public class CreateDocFromTemplate { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder() .de("{{NOME COMPLETO}}") .para("Full Name") .build(); DeParaTemplate deParaTemplateCpf= DeParaTemplate.deParaTemplateBuilder() .de("{{NÚMERO DO CPF}}") .para("Social Security Number") .build(); DeParaTemplate deParaTemplateEnd = DeParaTemplate.deParaTemplateBuilder() .de("{{ENDEREÇO COMPLETO}}") .para("Full address") .build(); ArrayList deParaTemplates = new ArrayList<>(); deParaTemplates.add(deParaTemplateName); deParaTemplates.add(deParaTemplateCpf); deParaTemplates.add(deParaTemplateEnd); DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder() .sandbox(false) .brand_primary_color("#000000") .lang("pt-br") .signer_name("My Signer for template") .template_id("75a3a92b-36d5-451f-95cd-5af9a927a392") .data(deParaTemplates) .build(); try { DocResponse docResponse = new DocRequests(apiToken).createDocFromTemplate(docFromTemplate); String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### Create Document Source: https://docs.zapsign.com.br/documentos/criar-documento-via-modelo This endpoint is used to create a new document for electronic signing. It supports various configurations such as automatic WhatsApp notifications, sequential signatures, metadata, folder organization, and custom signature/rubrica placement. ```APIDOC ## POST /api/v1/document ### Description Creates a new document for electronic signing with advanced configuration options. ### Method POST ### Endpoint /api/v1/document ### Parameters #### Query Parameters - **send_automatic_whatsapp_signed_file** (boolean) - Optional - If true, ZapSign will send a WhatsApp message with the signed file link to the signatory. Defaults to false. - **signature_order_active** (boolean) - Optional - If true, signatures will be requested sequentially. Defaults to false. - **folder_token** (string) - Optional - Token of the folder to store the document. Overrides `folder_path`. - **signature_placement** (string) - Optional - Text anchor for signature placement (e.g., "<>"). - **rubrica_placement** (string) - Optional - Text anchor for rubrica placement (e.g., "<>"). #### Request Body - **document_content** (string) - Required - The content of the document, typically HTML or base64 encoded PDF. - **signers** (array) - Required - List of signers for the document. Each signer object should contain at least `name` and `email`. - **metadata** (object) - Optional - Custom metadata as key-value pairs. ### Request Example ```json { "document_content": "

Document Title

Please sign this document.

", "signers": [ { "name": "John Doe", "email": "john.doe@example.com", "phone_country": "55", "phone_number": "11999998888" } ], "send_automatic_whatsapp_signed_file": true, "signature_placement": "<>" } ``` ### Response #### Success Response (200) - **open_id** (integer) - The unique identifier for the document. - **token** (string) - The unique token to access and manage the document. - **status** (string) - The current status of the document (e.g., "pending"). #### Response Example ```json { "open_id": 5, "token": "eb9c367a-e62f-4992-8360-b0219deaeecc", "status": "pending" } ``` ``` -------------------------------- ### Email Bounce Webhook Payload Example (JSON) Source: https://docs.zapsign.com.br/webhooks/eventos/signer/email-bounce This JSON object represents the data received when an email bounce occurs during document sending. The 'error' field provides a human-readable explanation for the bounce. The 'status' field indicates 'dropped', and 'delivered' is false, confirming the failure. ```json { "email": "teste@truora.com", "token": "853fda7d-ca1c-45cf-829d-9006a4bdfb9e", "type": "link_email", "status": "dropped", "status_code": null, "error": "ZapSign did not send the message to this email address because there was a previous delivery failure to this same email. We recommend checking the email, and if you believe there was an error, please contact support@zapsign.com.br.", "delivered": false, "event_type": "email_bounce" } ``` -------------------------------- ### Define Document from PDF in Java using ZapSign SDK Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/createdocfromuploadasync Shows how to configure a document for creation from a PDF using the `DocFromPdf` class. This includes setting sandbox mode, document name, primary brand color, language, associated signers, and the URL of the PDF file. ```java DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder() .sandbox(false) .name("My Contract") .brand_primary_color("#000000") .lang("pt-br") .signers(signers) .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf") .build(); ``` -------------------------------- ### Create Document from Template Async in Java Source: https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/createdocfromtemplateasync This Java code demonstrates how to asynchronously create a document from a template using the ZapSign SDK. It involves setting up API tokens, defining template variables, configuring the document, and making the API call. The response is a DocAsyncResponse object or an exception. ```java import body.doc.DeParaTemplate; import body.doc.DocFromTemplate; import docs.DocRequests; import response.DocAsyncResponse; import services.JsonConverter; import java.util.ArrayList; public class CreateDocFromTemplate { public static void main(String[] args) throws Exception { String apiToken = "SEU TOKEN"; DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder() .de("{{NOME COMPLETO}}") .para("Full Name") .build(); DeParaTemplate deParaTemplateCpf= DeParaTemplate.deParaTemplateBuilder() .de("{{NÚMERO DO CPF}}") .para("Social Security Number") .build(); DeParaTemplate deParaTemplateEnd = DeParaTemplate.deParaTemplateBuilder() .de("{{ENDEREÇO COMPLETO}}") .para("Full address") .build(); ArrayList deParaTemplates = new ArrayList<>(); deParaTemplates.add(deParaTemplateName); deParaTemplates.add(deParaTemplateCpf); deParaTemplates.add(deParaTemplateEnd); DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder() .sandbox(false) .brand_primary_color("#000000") .lang("pt-br") .signer_name("My Signer for template") .template_id("75a3a92b-36d5-451f-95cd-5af9a927a392") .data(deParaTemplates) .build(); try { DocAsyncResponse docAsyncResponse = new DocRequests(apiToken).createDocFromTemplateAsync(docFromTemplate); String jsonDocResponse = new JsonConverter().docAsyncResponseToJson(docAsyncResponse); System.out.println(jsonDocResponse); } catch(Exception exceptionError) { System.out.println(exceptionError.getMessage()); } } } ``` -------------------------------- ### Exemplo de Requisição GET para Consultar Check (cURL) Source: https://docs.zapsign.com.br/consultar-check Exemplo de como realizar uma requisição GET para o endpoint de consulta de check utilizando cURL. Requer o ID da consulta e um token de autorização Bearer. ```bash curl -X GET \ 'https://api.zapsign.com.br/api/v1/checks/{{check_id}}/' \ -H 'Authorization: Bearer c7f35c84-7893-4087-b4fb-d1f06c23' ``` -------------------------------- ### Criar Documento com Grupos de Signatários (JSON) Source: https://docs.zapsign.com.br/signatarios/grupo-de-signatarios/definir-grupos-de-signatarios Este snippet demonstra como criar um novo documento na ZapSign, especificando múltiplos grupos de signatários. Inclui detalhes como nome do documento, URL do PDF, ID externo, lista de signatários com seus respectivos grupos de assinatura, e configurações de envio e autenticação. ```json { "name": "Contrato Teste", "url_pdf": "https://zapsign.s3.amazonaws.com/exemplo.pdf", "external_id": "TESTE_CENARIO_A", "signers": [ { "name": "Signatário 1", "email": "email1@cliente.com", "auth_mode": "assinaturaTela", "order_group": 1, "custom_message": "Você é o primeiro do grupo. Assine assim que possível.", "phone_country": "55", "phone_number": "11999999999", "require_cpf": true, "cpf": "12345678900", "send_automatic_email": true, "send_automatic_whatsapp": false } ], "send_automatic": true, "lang": "pt", "disable_signer_emails": false, "signature_order_active": true } ``` -------------------------------- ### GET /api/v1/companies/ Source: https://docs.zapsign.com.br/detalhe-do-check Retrieves information about companies, including their associated check IDs and data set details. ```APIDOC ## GET /api/v1/companies/ ### Description Retrieves information about companies, including their associated check IDs and data set details. ### Method GET ### Endpoint /api/v1/companies/ ### Parameters (No specific parameters mentioned in the provided text for this endpoint) ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **details** (array) - An array of company detail objects. - **categorization** (array) - Categories associated with the company. - **check_id** (string) - The ID of the check related to the company. - **data_set** (string) - The data set name for the company information. - **database_id** (string) - The ID of the database where the company information is stored. - **database_name** (string) - The name of the database. - **depth** (integer) - Depth of the search or data retrieval. - **document_type** (string) - The type of document associated with the company information (e.g., 'company-name'). - **found_company_name** (string) - The found name of the company. - **found_date_of_birth** (string) - The found date of birth (if applicable). - **found_first_name** (string) - The found first name (if applicable). #### Response Example ```json { "details": [ { "categorization": [], "check_id": "CHKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "data_set": "international_background", "database_id": "DBIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "database_name": "United Nations Security Council Consolidate List", "depth": 0, "document_type": "company-name", "found_company_name": "", "found_date_of_birth": "", "found_first_name": "" } ] } ``` ``` -------------------------------- ### Criar Documento via Modelo Source: https://docs.zapsign.com.br/documentos Allows creating a document from a predefined template. ```APIDOC ## POST /documentos/criar-documento-via-modelo ### Description Creates a new document using a predefined template. ### Method POST ### Endpoint /documentos/criar-documento-via-modelo ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **template_id** (string) - Required - The ID of the template to use. - **document_details** (object) - Optional - Details to populate the document fields. ### Request Example ```json { "template_id": "tmpl_abc", "document_details": { "field1": "value1", "recipient": "user@example.com" } } ``` ### Response #### Success Response (200) - **document_id** (string) - The ID of the newly created document. - **message** (string) - Confirmation message. #### Response Example ```json { "document_id": "doc_def789", "message": "Document created successfully from template." } ``` ``` -------------------------------- ### GET /api/v1/checks/{check_id}/details/ Source: https://docs.zapsign.com.br/detalhe-do-check Retrieves detailed information about a specific check, including associated data sets and update history. ```APIDOC ## GET /api/v1/checks/{check_id}/details/ ### Description Retrieves detailed information about a specific check, including associated data sets and update history. ### Method GET ### Endpoint /api/v1/checks/{check_id}/details/ ### Parameters #### Path Parameters - **check_id** (string) - Required - The unique identifier of the check. ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **title** (string) - The title of a data section. - **rows** (array) - An array of row objects within a data section. - **cells** (array) - An array of cell objects within a row. - **label** (string) - The label for a cell's data. - **value** (string) - The value of the cell's data. - **update_date** (string) - The date and time when the check details were last updated. - **self** (string) - The API endpoint for the check details. - **next** (string) - The API endpoint for the next page of results (if applicable). #### Response Example ```json { "title": "Partes", "rows": [ { "cells": [ { "label": "Número do documento", "value": "XXX.XXX.XXX-XX" }, { "label": "Nome", "value": "NOME COMPLETO" }, { "label": "Polaridade", "value": "ACTIVE" }, { "label": "Tipo", "value": "AUTHOR" }, { "label": "Parte ativa", "value": "yes" }, { "label": "Tipo específico", "value": "AUTOR" } ] } ], "update_date": "2025-05-06T22:13:30.528911729Z" } ``` ``` -------------------------------- ### POST /sign-documents Source: https://docs.zapsign.com.br/signatarios/assinar-em-lote-via-api Initiates the signing process for one or more documents. This is an asynchronous operation, and final signed documents will be delivered via webhooks. ```APIDOC ## POST /sign-documents ### Description Initiates the signing process for one or more documents. This is an asynchronous operation, and final signed documents will be delivered via webhooks. ### Method POST ### Endpoint /sign-documents ### Parameters #### Request Body - **user_token** (string) - Required - The token of the user initiating the signing process. - **signer_tokens** (array) - Required - An array of signer tokens, where each token corresponds to a signer for a document. - **selfie_photo** (string) - Optional - A publicly accessible URL to the user's selfie photo (JPG, JPEG, or PNG). - **document_photo_url** (string) - Optional - A publicly accessible URL to the front image of the user's document (JPG, JPEG, or PNG). - **document_verse_photo_url** (string) - Optional - A publicly accessible URL to the back image of the user's document (JPG, JPEG, or PNG). - **cpf** (string) - Optional - The user's CPF number (11 numeric digits, with or without punctuation). ### Request Example ```json { "user_token": "your_user_token", "signer_tokens": ["signer_token_1", "signer_token_2"], "selfie_photo": "https://example.com/selfie.jpg", "document_photo_url": "https://example.com/document_front.jpg", "document_verse_photo_url": "https://example.com/document_back.jpg", "cpf": "111.222.333-44" } ``` ### Response #### Success Response (200) - **message** (string) - Indicates that the signing process has been successfully initiated. #### Response Example ```json { "message": "Documento(s) assinado(s) com sucesso. Lembrete: este endpoint é assíncrono, então aguarde os PDF finais ficarem prontos via webhooks ou confira-os daqui alguns minutos." } ``` #### Error Response (404) - **detail** (string) - Indicates that a provided `user_token` or `signer_tokens` was not found. ### Notes - This endpoint is asynchronous. You will receive immediate confirmation, and signed documents will be available later via webhooks. - It is recommended to send a maximum of 100 documents per request. ``` -------------------------------- ### POST /api/v1/models/create-doc/ Source: https://docs.zapsign.com.br/documentos/criar-documento-via-modelo This endpoint allows you to create a document using a DOCX template. You need to send the data to replace dynamic fields in JSON format and will receive the response in JSON. ```APIDOC ## POST /api/v1/models/create-doc/ ### Description This endpoint allows you to create a document using a DOCX template. You need to send the data to replace dynamic fields in JSON format and will receive the response in JSON. ### Method POST ### Endpoint https://api.zapsign.com.br/api/v1/models/create-doc/ ### Parameters #### Headers - **Authorization** (string) - Required - Api token a frente do texto "Bearer". Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23 ### Request Example ```json { "field1": "value1", "field2": "value2" } ``` ### Response #### Success Response (200) - **document_id** (string) - The ID of the created document. - **share_url** (string) - The URL to access the created document. #### Response Example ```json { "document_id": "doc_abc123", "share_url": "https://zapsign.com.br/view/doc_abc123" } ``` ```