# ZapSign Developer Docs

Build with the ZapSign API — programmatically generate, send, and track documents for electronic signature.

{% columns %}
{% column width="66.66666666666666%" %}
**Integrate with ZapSign in minutes.**

One API call. Documents ready for electronic signature, integrated into your workflow from start to finish.

Create, send, and track documents with security, status visibility, and legal validity — without relying on manual processes.
{% endcolumn %}

{% column width="33.33333333333334%" %}

<figure><img src="/files/VvmxA3LdwVUDr3Aps8c0" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<a href="/spaces/-M4noMoX5ZGb2-RhWjjf-1703796690/pages/W4Gq51bKC24lVKtsWgUU#how-do-i-get-my-api-token" class="button primary">Get your API key</a> <a href="/spaces/-M4noMoX5ZGb2-RhWjjf-1703796690/pages/W4Gq51bKC24lVKtsWgUU" class="button secondary">API Overview</a>

{% hint style="info" %}
If you haven’t yet integrated with ZapSign, we recommend starting with the testing environment (sandbox) by [clicking here](https://sandbox.app.zapsign.com.br/acesso/entrar) to avoid charges.
{% endhint %}

### API Implementation Essentials

<table data-view="cards"><thead><tr><th></th><th></th><th data-type="files"></th><th></th><th data-type="files"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>REST API:</strong> Use GET and POST. Send and receive data in JSON.</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Null Strings:</strong> Do not send <code>null</code> for string fields. Use <code>""</code> or omit the field.</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Booleans vs. Strings:</strong> Use real booleans. <code>true</code> and <code>false</code> are not the same as <code>"true"</code> and <code>"false"</code>.</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

### **Time Management**

* **UTC+0 Time Zone:** Our server stores dates and times in the UTC+0 time zone. Most frameworks and browsers automatically perform this conversion when dealing with datetime objects.

### Get help with Ask

Use Ask, our AI assistant, to find quick answers about the ZapSign API.

To get started, click Ask at the top of the page, next to search.

{% hint style="info" %}
For any questions, please contact our support team via [WhatsApp](https://api.whatsapp.com/send?phone=551140401991\&text=Hi,%20I%20would%20like%20to%20speak%20to%20support) or by email at <support@zapsign.com.br>. You can also [speak with our specialists](https://zapsign.co/contact-sales?hsCtaTracking=f29cb894-a383-4ae5-ad40-8567b0f3257e%7C29b2d094-e9d4-4165-b8f3-5c9c26eae155) for customized solutions.
{% endhint %}


# Getting Started

If you're new to ZapSign or expanding your existing integrations, this is the ideal starting point. Let's begin!

* Sign up or log in to ZapSign to get your API token.&#x20;
* Always set the API token in the Authorization header for all your requests.&#x20;

### How do I get my Api Token?

&#x20;Once logged into your account, navigate to Settings > Integrations > ZAPSIGN API. Then, copy your token and set it in your tool.

![](https://github.com/AmandaAmani/documenta-ocurso/blob/main/api%20token%20em%20ingles.gif?raw=true)

Ready to start! With your Access Token, you can authenticate against our API endpoints. This lets us know that it's you making the request.

![Animation GIF](https://github.com/AmandaAmani/documenta-ocurso/blob/main/Anima%C3%A7%C3%A3o.gif?raw=true)

In addition to the static access token in your account, you can also use a dynamic token. Learn more in [Authentication. ](/english/authentication)

{% hint style="warning" %}
Do not share your Token with anyone outside your organization!
{% endhint %}


# ZapSign Environments

ZapSign offers two environments for API usage. Only the production environment requires an API plan.

<table><thead><tr><th width="149">Environment</th><th width="307">Endpoint</th><th>Legal Validity</th></tr></thead><tbody><tr><td>Sandbox</td><td>https://sandbox.api.zapsign.com.br</td><td>Does not have legal validity</td></tr><tr><td>Production</td><td>https://api.zapsign.com.br</td><td>Has legal validity</td></tr></tbody></table>

To create a Sandbox account, [log in or register in the environment. <br>](https://sandbox.app.zapsign.com.br/acesso/entrar)\
\
The sandbox environment replicates the production environment exactly. To get your token, follow the same path: [Settings > Integrations > ZAPSIGN API.](https://sandbox.app.zapsign.com.br/conta/configuracoes/integration?tab=api-zapsign) Then, copy your token and set it in your testing tool.<br>

<figure><img src="/files/QKdFvfPTY8uJJbvntLiR" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
It is not necessary to include the `sandbox=true` parameter in your requests to use the sandbox environment. Simply use the specific URLs for the sandbox environment or the predefined environments in the next chapter.
{% endhint %}


# Ready-to-use requests!

Postman and Insomnia are powerful tools for developing, testing, and documenting APIs. At ZapSign, we've prepared complete request libraries for both platforms to streamline your workflow.

### Using Postman

You can save a lot of time by using the pre-built requests available in Postman.

{% embed url="<https://elements.getpostman.com/redirect?entityId=27495556-787b914f-ebeb-426a-9808-7fb0bd0d47fd&entityType=collection>" %}

After opening the link, select the environment you want to test from the top right corner and create a fork to access all the endpoints within your own workspace.\
![](/files/3dcfvpxuTKxVE3yz3dE2)

Once the environment is selected, simply configure your variables by clicking on "Environments" in the left-hand menu.<br>

<figure><img src="/files/TA69fBeYHhVOUF8YMEXE" alt=""><figcaption></figcaption></figure>

With Postman configured, you're ready to use all the endpoints. The only mandatory variable is the `api_token`, your authentication token. All other variables can be filled in as needed. \ <br>

{% hint style="info" %}
In the right sidebar menu, the \</> code icon allows you to export all requests in your preferred language.\
![](/files/YClr0vdjtzXgLGNa5j4U)
{% endhint %}

### Using Insomnia

\
For Insomnia, we’ve prepared all the endpoints in this file. After importing the file, you’ll need to select the environment and input your API token before making a request.

{% file src="/files/W0cO9bDgBNJDxn6XDA6x" %}
Insomnia ZapSign API.json
{% endfile %}

![File import with all requests for Insomnia.](https://github.com/AmandaAmani/documenta-ocurso/blob/main/%20cortado%20insonia.gif?raw=true)

{% hint style="info" %}
In Insomnia, press Shift+Ctrl+G while viewing a request, and the code will be automatically generated in any programming language you choose.
{% endhint %}


# Authentication

ZapSign offers two authentication methods: using a static token (your API token) or via JWT, a dynamic token.

### Supported authentication types

* [Static token](/english/authentication/autenticacao)**:** A fixed token generated for continuous authentication.
* [JWT](/english/authentication/jwt-authentication) **(JSON Web Token):** A dynamic token that provides additional security, used for real-time authentication.


# Static token

The static token is a fixed and predefined token used for continuous authentication with the API. It's simple to implement and is ideal for scenarios where security does not require temporary tokens.

To use it, just include your `api_token` in the "Authorization" header of your request, with the prefix "Bearer ". For example:

```javascript
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer c7f35c84-7893-4087-b4fb-d1f06c23'
  },
```

<figure><img src="https://github.com/AmandaAmani/documenta-ocurso/blob/main/api%20token%20em%20ingles.gif?raw=true" alt="GIF demonstrating how to obtain the static token for integration with ZapSign."><figcaption><p>User navigating to obtain their API token.</p></figcaption></figure>

{% hint style="info" %}
For more information, see the '[Getting Started'](/english/getting-started#how-do-i-get-my-api-token) chapter.
{% endhint %}


# JWT Authentication

JSON Web Tokens (JWT) provide an effective and secure way to authenticate between different entities, ensuring enhanced security during development in a simple and efficient manner.

### HOW the JWT Authentication flow works

The JWT-based flow works through two essential types of tokens:

* [**Access Token**](/english/authentication/jwt-authentication/get-access-token)
* [**Refresh Token**](/english/authentication/jwt-authentication/refresh-your-access-token)

With these two tokens, **you will be able to authenticate with ZapSign and integrate with your application.** In the following chapters, we will discuss each token in more detail.


# Get access token

The access token is used to authenticate with the ZapSign API. It is associated with your user and the organization specified when generating the token, and it expires after 1 hour.

To obtain the Access Token, make a request to the authentication endpoint with your ZapSign user credentials. This endpoint will return both the Access Token and the Refresh Token.

<mark style="color:green;">`POST`</mark> `https://api.zapsign.com.br/api/v1/auth/token/{{`organization\_ID`}}/`

{% hint style="info" %}
You can obtain your organization ID by navigating to **Settings > Integrations > API Token > Organization ID**.
{% endhint %}

```
Request body
{
    "username": "dev@example.com.br",
    "password": "StrongPassword123"
}

```

<figure><img src="/files/0ENoF7YU2NpY2Kcxy7Lw" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="200: OK Authentication successfully completed." %}
{% code overflow="wrap" %}

```json
{
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTcxMDE3ODM0NCwianRpIjoiYjhmZjMwNDJmNjRkNDJmM2FlMzczZmRiNDQ3YTQ2NGEiLCJ1c2Vyb",
    "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
```

{% endcode %}
{% endtab %}

{% tab title="401: Unauthorized Invalid credentials" %}
{% code overflow="wrap" %}

```json
{
    "detail": "No active account found with the given credentials"
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Login attempts exceeded." %}

```javascript
{
    "message": "Rate limit exceeded"
}
```

{% endtab %}
{% endtabs %}

After obtaining your Token, you can authenticate to the ZapSign endpoints by including your token in the "Authorization" header of your request, using the prefix "Bearer". Example:

```
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA5ODIwMTQxLCJqdGkiOiIxMGM4YmVhOTkxNDM0ZGU5OWQxNmViMGE2ZTA3MTU1YyIsInVzZXJfaWQiOjEsInR5cGUiOiJwdWJsaWMifQ.GhMKXDyiidHrWCSmU3I9e6-zDm61mBmDqEavir4IW0c'
  },
```

After one hour, you will need to authenticate again. See how to do this in the chapter "[Refresh Your Access Token".](/english/authentication/jwt-authentication/refresh-your-access-token)


# Refresh your access token

After one hour, you will need to update your token in your integrations. To do this, use the refresh token obtained in the previous call.

## Refresh your access token

<mark style="color:green;">`POST`</mark> `https://api.zapsign.com.br/api/v1/auth/token-refresh/`

Get a new JWT access token with increased expiration time

#### Request Body

```json
Request Body

{
    "refresh": "The_refresh_field_returned_in_Get_acess_token"
}
```

{% tabs %}
{% tab title="200: OK Refresh successfully completed." %}
{% code overflow="wrap" %}

```json
{
    "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
```

{% endcode %}
{% endtab %}

{% tab title="401: Unauthorized Invalid token" %}
{% code overflow="wrap" %}

```json
{
    "detail": "Token is invalid or expired",
    "code": "token_not_valid"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Types of Tokens

#### API Token

* **Location:** Go to [Settings > Integrations > ZapSign API > Access Token.](https://app.zapsign.co/conta/configuracoes/integration?tab=api-zapsign)
* **Description:** The API Token is the primary account token, used for authentication when integrating with the API. If you prefer a JWT-based authentication method, see the "Authentication" section.

#### User Token

* **Location:** Navigate to [Settings > My Profile > Security > API Signing.](https://app.zapsign.co/conta/perfil?tab=security)
* **Description:** The User Token is an exclusive token for batch signing via API.

#### Template ID

* **Location:** In Templates, select the desired template and click on Manage. Copy the code from the URL after "modelos/".
* **Example:** <https://app.zapsign.co/conta/templates/><mark style="color:green;">31bfa32c-9427-40ac-9804-187e6f4e73</mark>
* **Description:** The Template ID identifies a specific template created on the platform and is used to link it to your request.

#### Signer Token

* **Location:** Find the set of numbers after "/verificar" in the URL.
* **Description:** The Signer Token is associated with a specific signer. Each signer has a unique link for authentication and identification. You can use it for batch signing, signer detailing, etc.
* **Example:** <https://app.zapsign.co/verificar/><mark style="color:green;">92b36ec9-a449-4574-8ff0-5cc2c5ab7</mark>

#### Doc Token

* **Location:** In Created Documents, select the desired document and click on it. Copy the code from the URL after "documentos/".
* **Description:** The Doc Token is unique to each document created on the platform and is used for identification and specific operations, such as adding documents and extra users, detailing documents, and positioning signatures.
* **Example:** <https://app.zapsign.co/conta/documentos/><mark style="color:green;">1a764cab-b702-4a85-b16d-612688</mark>

{% hint style="info" %}
When making a request, both the Doc Token and the Signer Token will be created automatically and can be verified in the received response.
{% endhint %}


# API versioning

**We are constantly improving our API with new features and enhancements. However, we ensure that these changes will not affect your application. If we make significant changes to an endpoint, we will release a new version of the API.**

**Current API Version: V1**

**We consider the following changes to be backward compatible:**

* Adding new endpoints to the API
* Adding new optional parameters to the request
* Changing a required parameter to optional
* Adding new properties to existing API responses
* Adding new events to webhooks (this means your webhook endpoint should handle unknown event types, for example, by ignoring them with a status 200 response)

**We will notify you by email whenever a change is made.**


# Rate Limit Policies

To provide a more stable and efficient user experience, we have implemented rate limit policies to ensure the best possible performance of our API for all users.

**Overall Limit and Application** For all public endpoints of the application, the rate limit is set to 500 requests per minute. This limit is applied per IP address or valid authentication token, ensuring that each entity (IP or token) has a fair usage quota.<br>

**Rate Limit Operation**

* **Request Limit:** Each valid IP or authentication token is allowed up to 500 requests per minute to the public endpoints of the application.
* **Time Windows:** The request count is tracked in 1-minute time windows, resetting every new minute.
* **Rate Limit Feedback:** When the 500 requests per minute limit is reached by a specific IP or token, subsequent requests within the same 1-minute period will receive a response with HTTP status code 429 (Too Many Requests).

### BEST PRACTICES FOR DEVELOPERS&#x20;

To avoid hitting the request limit, we recommend following these best practices:

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>Implement Caching:</strong> Use caching techniques to reduce the number of repeated requests to the server.</td><td></td><td></td><td><a href="/files/lTQ3RRm2s3TeQUhyxRUc">/files/lTQ3RRm2s3TeQUhyxRUc</a></td></tr><tr><td><strong>Request Optimization:</strong> Aggregate multiple operations into a single request when possible.</td><td></td><td></td><td><a href="/files/lTQ3RRm2s3TeQUhyxRUc">/files/lTQ3RRm2s3TeQUhyxRUc</a></td></tr><tr><td><strong>Error Management:</strong> Implement exponential backoff logic to handle rate limit exceeded responses (HTTP 429).</td><td></td><td></td><td><a href="/files/lTQ3RRm2s3TeQUhyxRUc">/files/lTQ3RRm2s3TeQUhyxRUc</a></td></tr></tbody></table>

{% hint style="info" %}
**Support and Contact** If you encounter issues related to rate limits or need a custom limit for specific needs, please contact our support team at <support@zapsign.com.br> or WhatsApp +55 11 4040-1991.
{% endhint %}

For more details, please visit the [original documentation](https://docs.zapsign.com.br/politicas-de-rate-limit).


# Incident alerts

We maintain an availability standard of at least 99.9% for our applications, ensuring high reliability for users. \
Visit our status page to check the application's availability and identify any issues that might affect your system's operation.

{% embed url="<https://status.zapsign.com.br/>" %}

Any downtime or incidents are communicated via email to the registered addresses. If you prefer to receive real-time updates on incidents and availability, click "Subscribe to updates" on our status page.\ <br>

<figure><img src="https://github.com/AmandaAmani/documenta-ocurso/blob/main/nova%20tela%20de%20status.gif?raw=true" alt="User subscribing to receive email updates about ZapSign&#x27;s status."><figcaption><p>ZapSign service status page</p></figcaption></figure>


# How Payment Works

{% hint style="info" %}
**Attention:** To use the ZapSign integration in production you must have an active API plan. To learn more about the plans [click here](https://zapsign.co/pricing) and for more documents [contact our sales team](https://zapsign.co/contact-sales).&#x20;
{% endhint %}

To use the production environment, you need to subscribe to an API plan via credit card which is automatically renewed. You have the option to choose between monthly or annual payments. If you exceed the number of documents included in your plan, the excess will be charged to your registered credit card at the end of the month.

You are responsible for tracking the volume of documents used. We will only provide a usage report at the end of the month if you exceed the document volume of your plan.

&#x20;**Unsigned and deleted documents do not "recover" credits. Once created, the document will be counted towards your API Plan usage.**

<figure><img src="https://github.com/AmandaAmani/documenta-ocurso/blob/main/plans%20and%20prices.gif?raw=true" alt="A user navigating within the platform goes to Settings > Plans and Pricing and subscribes to an API plan."><figcaption><p>Remember that you will always need an API plan to integrate tools with ZapSign.</p></figcaption></figure>


# Status Code

ZapSign uses standard HTTP status codes. 4xx errors occur when there is an issue with the request sent by the client to ZapSign, while 5xx errors indicate potential server problems

Our application always returns a 200 status code for successful responses. Below, we outline the common errors that may occur and how to address them:

| Code | Reference         | Explanation                                                                                                                                                                                                       |
| ---- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400  | BAD REQUEST       | ZapSign processes all requests in JSON, so formatting errors such as missing commas, malformed base64, etc., can cause this error.                                                                                |
| 401  | UNAUTHORIZED      | The server did not authorize the request. Your [Access Token](/english/authentication/jwt-authentication/get-access-token) may be incorrect.                                                                      |
| 402  | PAYMENT REQUIRED  | The client does not have an API plan. In the production environment, it is mandatory to have a monthly plan to use the API. Navigate to Settings > Plans and Pricing or [click here.](https://zapsign.co/pricing) |
| 403  | FORBIDDEN         | The server did not authorize the request. Check if the API token used corresponds to the environment you want to use.                                                                                             |
| 404  | NOT FOUND         | The server could not find the resource or is unwilling to disclose its existence. Check the URL used or the template ID if you are using Templates.                                                               |
| 406  | NOT ACCEPTABLE    | Check if you are sending your request in JSON format. Remember to verify strings and booleans throughout the body                                                                                                 |
| 429  | TOO MANY REQUESTS | The client has exceeded the allowed request limit within a specific time period.                                                                                                                                  |
|      |                   |                                                                                                                                                                                                                   |


# SDKs

An overview of Zapsign's app development SDKs.

Zapsign provides software development kits (SDKs) to simplify the process of creating request to our Api. By using these SDKs, you can:

* **Better organize**. Create classes to use requests.
* **Avoid body errors**. The created classes help you to always use the right variable in the body.

### Supported programming languages

Zapsign provides SDKs for the following programming languages:

* [Java](/english/facilitators/sdks/java-sdk)

SDKs for other languages are in development.


# Typescript SDK

An overview of how to develop an application with ZapSign\`s Typescript SDK.

This SDK repository can be found [here](https://github.com/ZapSign/zapsign_SdkNode). Inside it you will see all the code used in the examples.

On your NPM - Typescript / Node project, add [this dependency](https://www.npmjs.com/package/sdk-node-typescript-zapsign):

```
npm i sdk-node-typescript-zapsign
```

Now, you just have to update your dependencies and you will be ready to start making requests.

### Requests

The requests made by the SDK are splitted in two parts:

* [Documents requests](/english/facilitators/sdks/typescript-sdk/documents-requests)
* [Signers requests](/english/facilitators/sdks/typescript-sdk/signers-requests)


# Documents requests

An overview of classes for documents requests

### DocRequests class

This class is responsable of sending requests to ZapSign\`s API. The only constructor required parameter is the [api\_token](/english):

`docRequest: DocRequests = new DocRequests(apiToken);`


# createDocFromUploadPdf

Create a document via Upload PDF

### Overview

Parameters:&#x20;

* [DocFromPdf](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/docfrompdf)

Return:

* [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) - in case of success
* Exception - in case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Build your signers with the [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) class:&#x20;

```typescript
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);
```

Now, build your document with the [DocFromPdf](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfrompdf) class:

```typescript
const docFromPdf: DocFromPdf = new DocFromPdfBuilder()
                                .withSandbox(false)
                                .withName("My Contract")
                                .withBrandLogo("#000000")
                                .withLang("en")
                                .withSigners(signers)
                                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                                .build();
                                

```

Finally, call the createDocFromUploadPdf method to get the returned value of [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) class or an error message:

```typescript
async function exempleCreateDocFromUploadPdf() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadPdf(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```

### Example:

```typescript
import { SignerBuilder } from 'sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder';
import { Signer } from "sdk-node-typescript-zapsign/src/body/signer/Signer";
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { DocFromPdfBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/DocFromPdfBuilder";

apiToken: string = "SEU TOKEN";

signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela")
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);

const docFromPdf: DocFromPdf = new DocFromPdfBuilder()
                                .withSandbox(false)
                                .withName("My Contract")
                                .withBrandLogo("#000000")
                                .withLang("en")
                                .withSigners(signers)
                                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                                .build();
                                
async function exempleCreateDocFromUploadPdf() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadPdf(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```


# createDocFromUploadDocx

Create a document via Upload docx

### Overview

Parameters:&#x20;

* DocFromDocx

Return:

* [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) - in case of success
* Exception - in case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method.

### How to use:

Salve seu[ Api Token](https://docs.zapsign.com.br/):

```typescript
const apiToken: string = "YOUR TOKEN";
```

Build your signers with the [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) class:&#x20;

```typescript
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);
```

Now, build your document with the [DocFromDocx](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfromdocx) class:

```typescript
const docFromDocx: DocFromDocx = DocFromDocxBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .url_docx("https://zapsign.s3.amazonaws.com/2022/1/docs/d7660fd2-fe74-4691-bec8-5c42c0ae2b3f/39a35070-8987-476d-86e3-75d91f588a5a.docx")
                .build();
```

Finally, call the createDocFromUploadDocx method to get the returned value of [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) class or an error message:

```typescript
async function exempleCreateDocFromUploadDocx() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadDocx(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```

### Example:

```typescript
import { SignerBuilder } from 'sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder';
import { Signer } from "sdk-node-typescript-zapsign/src/body/signer/Signer";
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { DocFromPdfBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/DocFromPdfBuilder";

apiToken: string = "YOU TOKEN";

signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela")
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);

const docFromPdf: DocFromPdf = new DocFromDocxBuilder()
                                .withSandbox(false)
                                .withName("My Contract")
                                .withBrandLogo("#000000")
                                .withLang("en")
                                .withSigners(signers)
                                .withUrlDocx("https://zapsign.s3.amazonaws.com/2022/1/docs/d7660fd2-fe74-4691-bec8-5c42c0ae2b3f/39a35070-8987-476d-86e3-75d91f588a5a.docx")
                                .build();
                                
async function exempleCreateDocFromUploadPdf() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadDocx(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```


# createDocFromUploadAsync

Create a document via Upload pdf Asynchronously

### Overview

Parameters:&#x20;

* [DocFromPdf](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/docfrompdf)

Return:

* [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) - in case of success
* Exception - in case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Build your signers with the [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) class:&#x20;

```typescript
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);
```

Now, build your document with the [DocFromPdf](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfrompdf) class:

```typescript
const docFromPdf: DocFromPdf = new DocFromPdfBuilder()
                                .withSandbox(false)
                                .withName("My Contract")
                                .withBrandLogo("#000000")
                                .withLang("en")
                                .withSigners(signers)
                                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                                .build();
                                

```

Finally, call the createDocFromUploadAsync method to get the returned value of [docAsyncResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docasyncresponse) class or an error message:

```typescript
async function exempleCreateDocFromUploadAsync() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadAsync(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```

### Example:

```typescript
import { Signer } from "sdk-node-typescript-zapsign/src/body/signer/Signer";
import { SignerBuilder } from 'sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder';
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { DocFromPdfBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/DocFromPdfBuilder";
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);

const docFromPdf: DocFromPdf = new DocFromPdfBuilder()
                                .withSandbox(false)
                                .withName("My Contract")
                                .withPrimaryColor("#000000")
                                .withLang("en")
                                .withSigners(signers)
                                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                                .build();
                                
async function exempleCreateDocFromUploadAsync() {
    try {
        docResponse: DocResponse = await new DocRequests(apiToken).createDocFromUploadAsync(docFromPdf);
        jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
        console.log(jsonDocResponse);
    } catch(Err) {
        console.log(Err);
    }
}
```


# createDocFromTemplate

Create document via Template

### Overview

Parameters:&#x20;

* [DocFromTemplate](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfromtemplate)

Return:

* [DocResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Add your variables to a list of type [DeParaTemplate](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/deparatemplate):

<pre class="language-typescript"><code class="lang-typescript"><strong>const fromToTemplateName: DeParaTemplateBuilder = deParaTemplateBuilder()
</strong>        .de("{{FULL NAME}}") // the variable
        .para("Jhon Doe") // the value to replace
        .build();
        
const fromToTemplateSocialSecurty: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Social Security Number}}")
        .para("9999999999")
        .build();
        
const fromToTemplateAdress: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Full address}}")
        .para("999 N Main St")
        .build();
        
let fromToTemplates: DeParaTemplatesBuilder[] = [];

fromToTemplates.push(fromToTemplateName, fromToTemplateSocialSecurty, fromToTemplateAdress);
</code></pre>

Build your document with[ DocFromTemplate](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfromtemplate) class:

```typescript
const docFromTemplate: DocFomTemplateBuilder = new DocFromTemplateBuilder()
        .withSandbox(false)
        .withPrimaryColor("#000000")
        .withSignerName("My Signer for Template")
        .withTemplateId("YOUR TEMPLATE ID")
        .withData(fromToTemplates)
        .build();
```

Finally, call the createDocFromTemplate method to get the [DocResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docresponse) return or an error[ ](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse)message:

```typescript
async function exempleCreateDocFromTemplate() {
        try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromTemplate(docFromTemplate);
                jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
                console.log(jsonDocResponse);
            } catch(Err) {
                console.log(Err);
            }
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import { DeParaTemplateBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/DeParaTemplateBuilder";
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { DocFromTemplate } from "sdk-node-typescript-zapsign/src/body/doc/builders/DocFromTemplate";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const fromToTemplateName: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Full Name}}")
        .para("Jhon Doe")
        .build();
        
const fromToTemplateCpf: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Social Security Number}}")
        .para("9999999999")
        .build();
        
const fromToTemplateEndereco: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Full address}}")
        .para("999 N Main St")
        .build();
        
let fromToTemplates: DeParaTemplatesBuilder[] = [];

fromToTemplates.push(fromToTemplateName, fromToTemplateCpf, fromToTemplateEndereco);

const docFromTemplate: DocFomTemplateBuilder = new DocFromTemplateBuilder()
        .withSandbox(false)
        .withPrimaryColor("#000000")
        .withSignerName("My Signer for Template")
        .withTemplateId("YOUR TEMPLATE ID")
        .withData(fromToTemplates)
        .build();

async function exempleCreateDocFromTemplate() {
        try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromTemplate(docFromTemplate);
                jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
                console.log(jsonDocResponse);
            } catch(Err) {
                console.log(Err);
            }
}
</code></pre>


# createDocFromTemplateAsync

Create document via Template

### Overview

Parameters:&#x20;

* [DocFromTemplate](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfromtemplate)

Return:

* [DocAsyncResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docasyncresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Add your variables to a list of type [DeParaTemplate](/english/facilitators/sdks/typescript-sdk/used-classes/body/deparatemplate):

<pre class="language-typescript"><code class="lang-typescript"><strong>const fromToTemplateName: DeParaTemplateBuilder = deParaTemplateBuilder()
</strong>        .de("{{FULL NAME}}") // the variable
        .para("Jhon Doe") // the value to replace
        .build();
        
const fromToTemplateSocialSecurty: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Social Security Number}}")
        .para("9999999999")
        .build();
        
const fromToTemplateAdress: DeParaTemplateBuilder = deParaTemplateBuilder()
        .de("{{Full address}}")
        .para("999 N Main St")
        .build();
        
let fromToTemplates: DeParaTemplatesBuilder[] = [];

fromToTemplates.push(fromToTemplateName, fromToTemplateSocialSecurty, fromToTemplateAdress);
</code></pre>

Build your document with[ DocFromTemplate](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfromtemplate) class:

```typescript
const docFromTemplate: DocFomTemplateBuilder = new DocFromTemplateBuilder()
        .withSandbox(false)
        .withPrimaryColor("#000000")
        .withSignerName("My Signer for Template")
        .withTemplateId("YOUR TEMPLATE ID")
        .withData(fromToTemplates)
        .build();
```

Finally, call the createDocFromTemplate method to get the [DocAsyncResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docasyncresponse) return or an error[ ](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse)message:

```typescript
async function exempleCreateDocFromTemplate() {
        try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromTemplateAsync(docFromTemplate);
                jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
                console.log(jsonDocResponse);
            } catch(Err) {
                console.log(Err);
            }
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import { DeParaTemplateBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/DeParaTemplateBuilder";
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { DocFromTemplate } from "sdk-node-typescript-zapsign/src/body/doc/builders/DocFromTemplate";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const fromToTemplateName: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Full Name}}")
        .para("Jhon Doe")
        .build();
        
const fromToTemplateCpf: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Social Security Number}}")
        .para("9999999999")
        .build();
        
const fromToTemplateEndereco: DeParaTemplateBuilder = DeParaTemplateBuilder()
        .de("{{Full address}}")
        .para("999 N Main St")
        .build();
        
let fromToTemplates: DeParaTemplatesBuilder[] = [];

fromToTemplates.push(fromToTemplateName, fromToTemplateCpf, fromToTemplateEndereco);

const docFromTemplate: DocFomTemplateBuilder = new DocFromTemplateBuilder()
        .withSandbox(false)
        .withPrimaryColor("#000000")
        .withSignerName("My Signer for Template")
        .withTemplateId("YOUR TEMPLATE ID")
        .withData(fromToTemplates)
        .build();

async function exempleCreateDocFromTemplate() {
        try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromTemplate(docFromTemplate);
                jsonDocResponse: string = new JsonConverter().docAsyncResponseToJson(docResponse);
                console.log(jsonDocResponse);
            } catch(Err) {
                console.log(Err);
            }
}
</code></pre>


# addExtraDoc

Add an attachment (extra document)

### Overview

Parameters:&#x20;

* [ExtraDoc](/english/facilitators/sdks/typescript-sdk/used-classes/body/extradoc)

Retorno:

* [ExtraDocResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/extradocresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* original document\`s token;
* build the extra document;
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Save your original document\`s token:

<pre class="language-typescript"><code class="lang-typescript"><strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";
</strong></code></pre>

Build your extra doc with the [ExtraDoc](/english/facilitators/sdks/typescript-sdk/used-classes/body/extradoc) class:

```typescript
const extraDoc: ExtraDocBuilder = ExtraDocBuilder()
                .withName("Extra Doc Name")
                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                .build();
```

Finally, call the addExtraDoc method to get the [ExtraDocResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/extradocresponse) or an error message:

<pre class="language-typescript"><code class="lang-typescript">async function exempleAddExtraDoc() {
            try {
                        docResponse: DocResponse = await new DocRequests(apiToken).addExtraDoc(docToken, extraDoc);
                        jsonDocResponse: string = new JsonConverter().extraDocToJson(docResponse);
                        console.log(jsonDocResponse);
                } catch(Err) {
                    console.log(Err);
                }
<strong>            }
</strong><strong>}
</strong></code></pre>

### Example:

<pre class="language-typescript"><code class="lang-typescript">import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { ExtraDocBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/ExtraDocBuilder";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const docToken: string = "DOCUMENT ORIGINAL TOKEN";

const extraDoc: ExtraDocBuilder = ExtraDocBuilder()
                .withName("Extra Doc Name")
                .withUrlPdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                .build();
                
async function exempleAddExtraDoc() {
                try {
                        docResponse: DocResponse = await new DocRequests(apiToken).addExtraDoc(docToken, extraDoc);
                        jsonDocResponse: string = new JsonConverter().extraDocToJson(docResponse);
                        console.log(jsonDocResponse);
                } catch(Err) {
                        console.log(Err);
                }
}
</code></pre>


# detailDoc

detail the document

### Overview

Parameters:&#x20;

* Document\`s token - string

Return:

* [docResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* document\`s token.
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set the original document\`s token:

<pre class="language-typescript"><code class="lang-typescript"><strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";
</strong></code></pre>

Call the detailDoc method to get the [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) return or an error message:

```typescript
async function exempleDetailDoc() {
            try {
                        docResponse: DocResponse = await new DocRequests(apiToken).detailDoc(docToken);
                        jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
                        console.log(jsonDocResponse);
                } catch(Err) {
                         console.log(Err);
                }
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";

async function exempleDetailDoc() {
      try {
            const docResponse: DocResponse = await new DocRequests(apiToken).detailDoc(docToken);
            const jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
            console.log(jsonDocResponse);
         } catch(Err) {
            console.log(Err);
         }
}
</code></pre>


# getDocs

list documents

### Overvie

return:

* [DocsResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docsresponse) - In case of success
* Exception - In case of failure

To get the documents data we will need:

* set your apiToken;
* document\`s token;
* call the method

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Call the getDocs method to get the [DocsResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docsresponse) or an error message

### Example:

```typescript
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";

async function exempleAddExtraDoc() {
    try {
            docResponse: DocResponse = await new DocRequests(apiToken).getDocs();
            jsonDocResponse: string = new JsonConverter().docsResponseToJson(docResponse);
            console.log(jsonDocResponse);
        } catch(Err) {
            console.log(Err);
        }
}
```

###


# deleteDoc

delete document

### Overview

Parameters:&#x20;

* document token- String

Return:

* [DocsResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docsresponse) - In case of success
* Exception - In case of failure

To delete a document we will need:

* set your apiToken;
* document\`s token.
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set your original document token:

<pre class="language-typescript"><code class="lang-typescript"><strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";
</strong></code></pre>

Finally, clal the deleteDoc method to get the [DocsResponse ](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docsresponse)or an error message

### Example

```typescript
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";

async function exempleDeleteDoc() {
    try {
                docResponse: DocResponse = await new DocRequests(apiToken).deleteDoc(docToken, extraDoc);
                jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
                console.log(jsonDocResponse);
    } catch(Err) {
                console.log(Err);
    }
  }
}
```


# placeSignatures

place the signatures

### Overview

Parameters:&#x20;

* document token - String
* [RubricaList](/english/facilitators/sdks/typescript-sdk/used-classes/body/rubricalist)

Return:

* int - In case of success
* Exception - In case of failure

To place the rubrics/signatures on the document we will need:

* set your apiToken;
* document token;
* build the rubrics;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set your original document\`s token:

<pre class="language-typescript"><code class="lang-typescript"><strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";
</strong></code></pre>

Build your rubrics and save them on [RubricaList ](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/rubricalist)wich will be an array of [Rubrica](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/rubrica):

```typescript
const rubrica1: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(52.50)
                .withRelativePositionLeft(75.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
const rubrica2: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(13.50)
                .withRelativePositionLeft(20.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
let rubricas = RubricaBuilder[];
rubricas.push(rubrica1, rubrica2);

const rubricasArray = new RubricaArray(rubricas);
```

Call the placeSignatures method to get the response\`s status code or an error message:

```typescript
async function exempleAddExtraDoc() {
        try {
                statusCode: number = await new DocRequests(apiToken).placeSignatures(docToken, rubricasArray);
                console.log(statusCode);
        } catch(Err) {
            console.log(Err);
        }
    }
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { RubricaBuilder } from "sdk-node-typescript-zapsign/src/body/doc/builders/RubricaBuilder";
import { RubricasArray } from "sdk-node-typescript-zapsign/src/body/doc/RubricasArray";

<strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const docToken: string = "ORIGINAL DOCUMENT TOKEN";

const rubrica1: RubricaBuilder = RubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(52.50)
                .withRelativePositionLeft(75.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
const rubrica2: RubricaBuilder = rubricaBuilder()
                .withPage(0)
                .withtRelativePositionBottom(13.50)
                .withRelativePositionLeft(20.71)
                .withRelativeSizeX(19.55)
                .withRelativePositionSizeY(9.42)
                .withType("signature")
                .withSignerToken("SIGNER TOKEN")
                .build();
                
let rubricas = RubricaBuilder[];
rubricas.push(rubrica1, rubrica2);

const rubricasArray = new RubricasArray(rubricas);

async function exempleAddExtraDoc() {
        try {
                statusCode: number = await new DocRequests(apiToken).placeSignatures(docToken, rubricasArray);
                console.log(statusCode);
        } catch(Err) {
            console.log(Err);
        }
    }
}
</code></pre>


# createDocFromPdfBase64

Create a document via a base64 PDF

### Overview

Parameters:&#x20;

* [DocFromPdf](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfrompdf)

Return:

* [DocResponse](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set your base64:

```typescript
const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
```

Build your signers with the [Signer](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/signer) class:

```typescript
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);
```

Build your document with the [DocFromPdfBase64](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfrompdfbase64) class:

```typescript
const docFromPdfBase64 = DocFromPdfBase64Builder()
    .withSandbox(false)
    .withName("My Contract")
    .withBrandPrimaryColor("#000000")
    .withBase64Pdf(base64)
    .build();
```

Finally, call the createDocFromPdfBase64 method to get the [DocResponse ](/english/facilitators/sdks/typescript-sdk/used-classes/response/docresponse)or an error message:

<pre class="language-typescript"><code class="lang-typescript">try {
<strong>    docResponse = new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
</strong>    jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
    console.log(jsonDocResponse);
} catch {
     console.log(Err);
}
</code></pre>

### Example:

```typescript
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";

const apiToken: string = "YOUR TOKEN";

const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKP...";

const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);

const docFromPdfBase64 = DocFromPdfBase64Builder()
    .withSandbox(false)
    .withName("My Contract")
    .withBrandPrimaryColor("#000000")
    .build();

async function exempleDocFRomPdfBase64() {
    try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
                jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
                console.log(jsonDocResponse);
    } catch(Err) {
                console.log(Err);
    }
  }
}
```


# createDocFromBase64Async

Create a document via a base64 PDF Asynchronously

### Overview

Parameters:&#x20;

* [DocFromPdf](/english/facilitators/sdks/typescript-sdk/used-classes/body/docfrompdf)

Return:

* [DocAsyncResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docasyncresponse) - In case of success
* Exception - In case of failure

To create this document we will need:

* set your apiToken;
* build your signers;
* build the document;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set your base64:

```typescript
const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
```

Build your signers with the [Signer](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/body/signer) class:&#x20;

```typescript
const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();
                
const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);
```

Build your document with the [DocFromPdfBase64](broken://spaces/-MGLHwoaRaiLL9MSXMX9/pages/-MWtos8YoqMafOsi5RI7) class:

```typescript
const docFromPdfBase64 = DocFromPdfBase64Builder()
    .withSandbox(false)
    .withName("My Contract")
    .withBrandPrimaryColor("#000000")
    .withBase64Pdf(base64)
    .build();
```

Finally, call the createDocFromPdfBase64 method to get the [DocResponse ](https://docs.zapsign.com.br/facilitadores/sdks/sdk-em-typescript/classes-usadas/response/docasyncresponse)or an error message:

```typescript
try {
    docResponse = new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
    jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
    console.log(jsonDocResponse);
} catch {
     console.log(Err);
}
```

### Example:

```typescript
import DocRequests from "sdk-node-typescript-zapsign/src/docs/DocRequests";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";

const apiToken: string = "YOUR TOKEN";

const base64: string = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKP...";

const signer1: Signer = new SignerBuilder()
                .withName("My First Signer")
                .build();

const signer2: Signer = new SignerBuilder()
                .withName("My Second Signer")
                .withEmail("test@test.com")
                .withLockEmail(true)
                .withLockPhone(true)
                .withPhoneCountry("55")
                .withPhoneNumber("99999999999")
                .withAuthMode("assinaturaTela") // draw on screen
                .withSendAutomaticEmail(false)
                .withSendAutomaticWhatsapp(false)
                .build();
                
let signers: Signer[] = [];
                
signers.push(signer1, signer2);

const docFromPdfBase64 = DocFromPdfBase64Builder()
    .withSandbox(false)
    .withName("My Contract")
    .withBrandPrimaryColor("#000000")
    .build();

async function exempleDocFRomPdfBase64Async() {
    try {
                docResponse: DocResponse = await new DocRequests(apiToken).createDocFromPdfBase64Async(docFromPdfBase64);
                jsonDocResponse: string = new JsonConverter().docResponseToJson(docResponse);
                console.log(jsonDocResponse);
    } catch(Err) {
                console.log(Err);
    }
  }
}
```


# Signers requests

An overview of the signer requests classes


# detailSigner

Detail the signer

### Overview

Parameters:&#x20;

* String - signer token

Retorno:

* [Signer ](broken://pages/LNA023m1MfF7Iv92JTZd)- In case of success
* Exception - In case of failure

To get the signer we will need:

* set your apiToken;
* set the signer token;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set the signer token:

```typescript
const signerToken: string = "SIGNER TOKEN";
```

Finally, call the detailSigner method to get the [Signer](https://app.gitbook.com/s/-M4noMoX5ZGb2-RhWjjf-887967055/~/changes/193/facilitadores/sdks/sdk-typescript/classes-usadas/body/signer) or an error message:

```typescript
async function exempleDetailSigner() {
    try {
           const signerRequest: SignerRequest = await new SignerRequest(apiToken).detailSigner(signerToken);
           const jsonDocResponse: string = new JsonConverter().signerToJson(docResponse);
           console.log(jsonDocResponse);
         } catch(Err) {
           console.log(Err);
     }
   }
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const signerToken: string = "SIGNER TOKEN";

async function exempleDetailSigner() {
    try {
           const signerRequest: SignerRequest = await new SignerRequest(apiToken).detailSigner(signerToken);
           const jsonDocResponse: string = new JsonConverter().signerToJson(docResponse);
           console.log(jsonDocResponse);
         } catch(Err) {
           console.log(Err);
     }
   }
}
</code></pre>


# updateSigner

update signer

### Overview

Parameter:&#x20;

* String - Signer token
* [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer)

Retorno:

* [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) - In case of success
* Exception - In case of failure

To update the signer we will need:

* set your apiToken;
* set your signer token;
* set the new signer\`s values.
* call the method.

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set your signer token:

```typescript
const signerToken: string = "SIGNER TOKEN";
```

Build your signer with the [Signer](https://app.gitbook.com/s/-M4noMoX5ZGb2-RhWjjf-887967055/~/changes/193/facilitadores/sdks/sdk-typescript/classes-usadas/body/signer) class:

```typescript
const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();
```

Finally, call the addSigner method to get the [Signer](https://app.gitbook.com/s/-M4noMoX5ZGb2-RhWjjf-887967055/~/changes/193/facilitadores/sdks/sdk-typescript/classes-usadas/body/signer) or an error message:

```typescript
async function exempleUpdateSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).updateSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
<strong>import { SignerBuilder } from "sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder";
</strong><strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong><strong>
</strong>const signerToken: string = "SIGNER TOKEN";

const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();
    
async function exempleUpdateSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).updateSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}
</code></pre>


# addSigner

add signer

### Overview

Parameters:&#x20;

* String - document token
* [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer)

Return:

* [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) - In case of success
* Exception - In case of failure

To add a signer we will need:

* set your apiToken;
* set your document token;
* build a new signer;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set the signer token:

```typescript
const signerToken: string = "SIGNER TOKEN";
```

Build your signer with the [Signer](/english/facilitators/sdks/typescript-sdk/used-classes/body/signer) class:

```typescript
const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();
```

Call the addSigner method to get the [Signer](https://app.gitbook.com/s/-M4noMoX5ZGb2-RhWjjf-887967055/~/changes/193/facilitadores/sdks/sdk-typescript/classes-usadas/body/signer) or an error message:

```typescript
async function exempleAddSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).addSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { SignerBuilder } from "sdk-node-typescript-zapsign/src/body/signer/builders/SignerBuilder";
<strong>
</strong><strong>const apiToken: string = "SEU TOKEN";
</strong>const docToken: string = "TOKEN DOCUMENTO";

const signerBuilder = SignerBuilder()
    .withName("New Signer Name")
    .withEmail("newEmail@test.com")
    .withLockEmail(true)
    .withLockPhone(true)
    .withPhoneCountry("55")
    .withPhoneNumber("999999999")
    .withAuthMode("assinaturaTela") // draw on screen
    .withSendAutomaticAemail(false)
    .withSendAutomaticWhatsApp(false)
    .build();
    
async function exempleAddSigner() {
    try {
        signerResponse: string = new SignerRequest(apiToken).addSigner(signerToken, signer);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }    
}
</code></pre>


# deleteSigner

delete signer

### Overview

Parameters:&#x20;

* String - document token

Return:

* String[ ](broken://pages/LNA023m1MfF7Iv92JTZd)- In case of success
* Exception - In case of failure

To remove a signer we will need:

* set your apiToken;
* set your signer token;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set the signer token:

```typescript
const signerToken: string = "SIGNER TOKEN";
```

Finally, call the deleteSigner method to get an string with:&#x20;

"Signatário removido com sucesso."[ ](broken://pages/LNA023m1MfF7Iv92JTZd)(Signer removed successfully)

or an error message:

```typescript
async function exempleDeleteSigner() {
    try {
        response: string = new SignerRequest(apiToken).deleteSigner(signerToken);
        console.log(response);
    }
    catch(Err) {
        console.log(Err);
    }  
}
```

### Complete example:

<pre class="language-typescript"><code class="lang-typescript">import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong>const signerToken: string = "SIGNER TOKEN";

async function exempleDeleteSigner() {
    try {
        response: string = new SignerRequest(apiToken).deleteSigner(signerToken);
        console.log(response);
    }
    catch(Err) {
        console.log(Err);
    }  
}
</code></pre>


# signInBatch

Sign multiple documents via API

### Overview

Parameters:&#x20;

* [SignBatch](/english/facilitators/sdks/typescript-sdk/used-classes/body/signbatch)

Return:

* String[ ](broken://pages/LNA023m1MfF7Iv92JTZd)- In case of success
* Exception - In case of failure

To sign in batch we will need:

* set your apiToken;
* set the user token;
* set the signers tokens;
* call the method;

### How to use:

Save your [apiToken](/english):

<pre class="language-typescript"><code class="lang-typescript"><strong>const apiToken: string = "YOUR TOKEN";
</strong></code></pre>

Set the user token, ([where to find it](/english/signatarios/assinar-em-lote-via-api))

```typescript
const userToken: string = "USER TOKEN";
```

Set your signers tokens

```typescript
const signerToken1: string = "FIRST SIGNER TOKEN";
const signerToken2: string = "SECOND SIGNER TOKEN";

let signersToken: string[]  = [];
signersToken.push(signerToken1, signerToken2);
```

Create an instance of [SignInBatch](https://app.gitbook.com/s/-M4noMoX5ZGb2-RhWjjf-887967055/~/changes/193/facilitadores/sdks/sdk-typescript/classes-usadas/body/signbatch):

```typescript
const signBatch = SignBatchBuilder()
                .withUserToken(userToken)
                .withSignerTokens(signersToken)
                .build();
```

Finally, call the signInBatch method to get an string with the response's success message or an error message:

```typescript
async function exempleSignInBatch() {
    try {
        signerResponse: string = new SignerRequest(apiToken).signInBatche(signBatch);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }   
}
```

### Example:

<pre class="language-typescript"><code class="lang-typescript">import SignerRequest from "sdk-node-typescript-zapsign/src/signer/SignerRequest";
import { JsonConverter } from "sdk-node-typescript-zapsign/src/services/JsonConverter";
import { SignBatchBuilder } from "sdk-node-typescript-zapsign/src/body/signer/builders/SignBatchBuilder";
<strong>
</strong><strong>const apiToken: string = "YOUR TOKEN";
</strong>const userToken: string = "USER TOKEN";

const signerToken1: string = "FIRST SIGNER TOKEN";
const signerToken2: string = "SECOND SIGNER TOKEN";

let signersToken: string[]  = [];
signersToken.push(signerToken1, signerToken2);

const signBatch = SignBatchBuilder()
                .withUserToken(userToken)
                .withSignerTokens(signersToken)
                .build();
                
async function exempleSignInBatch() {
    try {
        signerResponse: string = new SignerRequest(apiToken).signInBatch(signBatch);
        jsonDocResponse: string = new JsonConverter().signerToJson(signerResponse);
        console.log(jsonDocResponse);
    }
    catch(Err) {
        console.log(Err);
    }   
}
</code></pre>


# Used Classes

We separate this classes in:

* [Body](/english/facilitators/sdks/java-sdk/used-classes/body) - classes used to formulate the request body.
* [Response](/english/facilitators/sdks/java-sdk/used-classes/response) - classes used to formulate request responses.


# Body

classes used to formulate the request body

### Classes used in documents:

* [Doc](/english/facilitators/sdks/java-sdk/used-classes/body/doc)
  * [DocFromDocx](/english/facilitators/sdks/java-sdk/used-classes/body/docfromdocx)
  * [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf)
  * [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate)
* [DeParaTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/deparatemplate)
* [ExtraDoc](/english/facilitators/sdks/java-sdk/used-classes/body/extradoc)
* [Rubrica](/english/facilitators/sdks/java-sdk/used-classes/body/rubrica)
* [RubricaList](/english/facilitators/sdks/java-sdk/used-classes/body/rubricalist)

### Classes used in signers:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer)
* [SignBatch](/english/facilitators/sdks/java-sdk/used-classes/body/signbatch)


# Doc

Class to create documents

### Properties:

<table><thead><tr><th width="236">name</th><th width="149.33333333333331" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>name</td><td align="center">string</td><td>document name</td></tr><tr><td>lang</td><td align="center">string</td><td>document language. Possible values: "pt-br" (Portuguese), "es" (Spanish), "en" (English). Default: "pt-br"</td></tr><tr><td>disable_signer_emails</td><td align="center">boolean </td><td>To disable emails sent to signers, send this parameter to true. Default: false</td></tr><tr><td>signed_file_only_finished</td><td align="center">boolean </td><td>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</td></tr><tr><td>brand_logo</td><td align="center">string </td><td>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: ""</td></tr><tr><td>brand_primary_color</td><td align="center">string </td><td>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: ""</td></tr><tr><td>brand_name</td><td align="center">string</td><td>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: ""</td></tr><tr><td>external_id</td><td align="center">string </td><td>ID of the document in your application. Default: ""</td></tr><tr><td>folder_path</td><td align="center">string </td><td>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).</td></tr><tr><td>date_limit_to_sign</td><td align="center">Date</td><td> Deadline for signing the document. (Accepted formats: YYYY-MM-DD, YYYY-MM-DDTH:m:s.ssssssZ)</td></tr><tr><td>signature_order_active</td><td align="center">boolean</td><td>If true, the signer's signatures will be ordered sequentially. Default: false</td></tr><tr><td>observers</td><td align="center">string[]</td><td>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.</td></tr><tr><td>signers</td><td align="center"><a href="/pages/2tgfF6OPg8ILy8jRTj3Q">Signer</a>[]</td><td>Represents the document signers</td></tr><tr><td>reminder_every_n_days</td><td align="center">int</td><td>Represents the interval of days between reminders that will be sent to signers, as long as they don`t sign. There will be 3 tries at most. Observation: this field must only be filled if send_automatic_whatsapp or send_automatic_email are true. Example: if setted to 8 it will be sent one email every 7 days, until it's signed, for at most 21 days.</td></tr><tr><td>created_by</td><td align="center"><a href="/pages/Wx3FvZig6MxXnNbyMSr0">CreateBy</a></td><td>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)</td></tr></tbody></table>


# DocFromDocx

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

<table><thead><tr><th width="177">name</th><th width="197.33333333333331" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>url_docx</td><td align="center">string </td><td>docx url for document creation</td></tr></tbody></table>


# DocFromPdf

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

| name     |  type  | description                   |
| -------- | :----: | ----------------------------- |
| url\_pdf | string | pdf url for document creation |


# DocFromPdfBase64

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

| name        |  type  | description  |
| ----------- | :----: | ------------ |
| base64\_pdf | string | pdf's Base64 |


# DocFromTemplate

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

<table><thead><tr><th width="270.3333333333333">name</th><th align="center">type</th><th>description</th></tr></thead><tbody><tr><td>signer_name</td><td align="center">string</td><td>Signer name</td></tr><tr><td>template_id</td><td align="center">string</td><td>Template Id</td></tr><tr><td>data</td><td align="center"><a href="/pages/IhAqipkx7h0MjuWmowJp">DeParaTemplate</a>[]</td><td>class list of variables</td></tr><tr><td>send_automatic_email</td><td align="center">boolean</td><td>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.</td></tr><tr><td>send_automatic_whatsapp</td><td align="center">boolean</td><td>If true, ZapSign will send a whatsapp 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 cell phone is defined.</td></tr><tr><td>custom_message </td><td align="center">string</td><td>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: ""</td></tr><tr><td>signer_has_incomplete_fields </td><td align="center">boolean</td><td>If set to <em>true</em>, the signer will be redirected to fill out the template form before signing the document. Default: false</td></tr></tbody></table>

### Override:

DocFromTemplate don't receive signers, so it's impossible to call methos like:&#x20;

* getSigners
* setSigners


# DeParaTemplate

Class to build the DocFromTemplate class

### Properties:

|      |        |                        |
| ---- | :----: | ---------------------- |
| de   | string | variable's name (from) |
| para | string | variable's value (to)  |


# ExtraDoc

Class to create extra documents

### Properties:

| name     |  type  | description                         |
| -------- | :----: | ----------------------------------- |
| name     | string | Extra doc's name                    |
| url\_pdf | string | pdf url for extra document creation |


# Rubrica

Class to create signatures

### Properties:

| name                       |  type  | description                                                    |
| -------------------------- | :----: | -------------------------------------------------------------- |
| page                       |   int  | document page                                                  |
| relative\_position\_bottom |  float | distance from 0 to 100 from the bottom edge of the page        |
| relative\_position\_left   |  float | distance from 0 to 100 from the left edge of the page          |
| relative\_size\_x          |  float | size from 0 to 100 of signature compared to page width         |
| relative\_size\_y          |  float | size from 0 to 100 of signature compared to page height        |
| type                       | string | signature type: "signature" for signature and "visto" for visa |
| signer\_token              | string | signer token                                                   |


# RubricaList

List of signatures for placement in the document

### Properties:

| name     |                                        type                                       | description     |
| -------- | :-------------------------------------------------------------------------------: | --------------- |
| rubricas | [Rubrica](/english/facilitators/sdks/typescript-sdk/used-classes/body/rubrica)\[] | signatures list |


# Signer

Class to create signers

### Properties:

|                           |         |                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------- | :-----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                      |  string | You can set the signer's name.                                                                                                                                                                                                                                                                                                                           |
| email                     |  string | You can set the signer's email.                                                                                                                                                                                                                                                                                                                          |
| 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.                                                                       |
| 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.        |
| send\_automatic\_whatsapp | boolean | If true, ZapSign will send a whatsapp 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 cell phone is defined.         |
| order\_group              |   int   | In case "signature\_order\_active" is active in the document, this field controls the signing order. Example: If the field is set to 1, then this signer will be the first to sign. If the field is set to 2, 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                                                                                                                                                                                                                                                                                               |
| blank\_email              | boolean | You may not request the signer's email. Default: false                                                                                                                                                                                                                                                                                                   |
| hide\_email               | boolean | You can hide the signer's email in the signatures report. Default: false                                                                                                                                                                                                                                                                                 |
| lock\_phone               | boolean | You can lock changes to the signer's phone. Default: false                                                                                                                                                                                                                                                                                               |
| blank\_phone              | boolean | You may not ask for the signer's phone number. Default: false                                                                                                                                                                                                                                                                                            |
| hide\_phone               | boolean | <p>You can hide the signer's phone number in the signature report. </p><p>Default: false</p>                                                                                                                                                                                                                                                             |
| lock\_name                | boolean | <p>You can lock changes to the signer's name. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                  |
| require\_selfie\_photo    | boolean | You can ask the signer to take a selfie while signing. Default: false.                                                                                                                                                                                                                                                                                   |
| selfie\_validation\_type  |  string | <p>You can ask the signer to take a photo of your personal document while signing. Default: falseIf you want to use facial recognition (liveness+document match validation) provided by Truora, please also define this field as "liveness-document-match". </p><p>Default: "none". Note that this feature has an extra cost, please contact sales. </p> |
| qualification             |  string | Qualification to appear in the signatures report. Ex: "Witness" value will result in "Signed as a witness". Default: ""                                                                                                                                                                                                                                  |
| external\_id              |  string | <p>ID of the signer in your application. </p><p>Default: ""</p>                                                                                                                                                                                                                                                                                          |
| 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: ""                                                                      |


# SignBatch

Class used to Sign in batch

### Properties:

| name           |    type   | description                |
| -------------- | :-------: | -------------------------- |
| user\_token    |   string  | user's token who will sign |
| signer\_tokens | string\[] | list of signer's tokens    |


# Response

Classes Used to form the request response

### Classes to form requests responses:

* [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse)
* [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)
* [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse)
* [ExtraDocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/extradocresponse)
* [Answers](/english/facilitators/sdks/java-sdk/used-classes/response/answers)
* [CreateBy](/english/facilitators/sdks/java-sdk/used-classes/response/createby)
* [Template](/english/facilitators/sdks/java-sdk/used-classes/response/template)
* [Signer ](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response)(response)


# DocAsyncResponse

Asynchronous request response class

### Properties:

| name  |  type  | description                           |
| ----- | :----: | ------------------------------------- |
| token | string | asynchronously created document token |


# DocResponse

document response class

Inherited from [Doc](/english/facilitators/sdks/typescript-sdk/used-classes/body/doc) class.

### Properties:

<table><thead><tr><th width="202.33333333333331">name</th><th width="293" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>open_id</td><td align="center">int</td><td>sequencial number of this document inside your company</td></tr><tr><td>token</td><td align="center">string</td><td>Document token</td></tr><tr><td>status</td><td align="center">string</td><td>Document status: "em-curso", "assinado", "recusado" or "lixeira"</td></tr><tr><td>original_file</td><td align="center">string</td><td>Url of original file saved on amazon</td></tr><tr><td>signed_file</td><td align="center">string</td><td>Signed file url saved on amazon</td></tr><tr><td>created_through</td><td align="center">string</td><td>Where this document was created: "web" or "api"</td></tr><tr><td>extra_docs</td><td align="center"><a href="/pages/AOjP4l8JMG2MYY037T5i">ExtraDocResponse</a>[]</td><td>Document extra documents list</td></tr><tr><td>deleted</td><td align="center">boolean</td><td>If True, the document has been deleted</td></tr><tr><td>deleted_at</td><td align="center">string</td><td>Date the document was deleted</td></tr><tr><td>created_at</td><td align="center">string</td><td>Date the document was created</td></tr><tr><td>last_update_at</td><td align="center">string</td><td>Last date the document was updated</td></tr><tr><td>template</td><td align="center"><a href="/pages/aUXE7rInH3ODcR3GEwrY">Template</a></td><td>If the document was created by a model, it contains the model token</td></tr><tr><td>answers</td><td align="center"><a href="/pages/YAQhRC0zLPGlIFaqOgSU">Answers</a>[]</td><td>List of variables and values ​​for creating this document</td></tr><tr><td>auto_reminder</td><td align="center">int</td><td>Number of times this document will notify signers</td></tr><tr><td>signers</td><td align="center"><a href="/pages/sb705lMFN12UXHfg0TuA">Signer</a>[]</td><td>represents the list of signers saved in the document</td></tr></tbody></table>


# DocsResponse

Document list response class

### Properties:

| name     |                                              type                                             | description                                   |
| -------- | :-------------------------------------------------------------------------------------------: | --------------------------------------------- |
| count    |                                              int                                              | Number of documents found                     |
| next     |                                             string                                            | url for next request if it has pagination     |
| previous |                                             string                                            | url for previous request if it has pagination |
| results  | [DocResponse](/english/facilitators/sdks/typescript-sdk/used-classes/response/docresponse)\[] | List of documents found                       |


# ExtraDocResponse

Response class that contains the extra document

### Properties:

| name           |  type  | description                                            |
| -------------- | :----: | ------------------------------------------------------ |
| open\_id       | string | sequencial number of this document inside your company |
| token          | string | extra document token                                   |
| name           | string | extra document name                                    |
| original\_file | string | extra document url without signatures                  |
| signed\_file   | string | extra document url with signatures                     |


# Answers

Response class that contains the document variables and values

### Properties:

| name     |  type  | description              |
| -------- | :----: | ------------------------ |
| variable | string | variable name (question) |
| value    | string | variable value (answer)  |


# CreateBy

Response class that contains the user who created the document

### Properties:

| name  |  type  | description                 |
| ----- | :----: | --------------------------- |
| email | string | document creator user email |


# Template

Response class that contains the document creator template

### Properties:

| name  |  type  | description                     |
| ----- | :----: | ------------------------------- |
| token | string | document creator template token |


# Signer (Response)

Signer with all the information coming from the response

This class is the same as Signer, but contains more properties when coming from the request response.

### Properties:

<table><thead><tr><th width="259.3333333333333">name</th><th width="191" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>name</td><td align="center">string</td><td>You can set the signer's name.</td></tr><tr><td>email</td><td align="center">string</td><td>You can set the signer's email.</td></tr><tr><td>auth_mode</td><td align="center">string</td><td>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.</td></tr><tr><td>send_automatic_email</td><td align="center">boolean</td><td>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.</td></tr><tr><td>send_automatic_whatsapp</td><td align="center">boolean</td><td>If true, ZapSign will send a whatsapp 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 cell phone is defined.</td></tr><tr><td>order_group</td><td align="center">int</td><td>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.</td></tr><tr><td>custom_message</td><td align="center">string</td><td>(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: ""</td></tr><tr><td>phone_country</td><td align="center">string</td><td><p>You can set the phone (country code) of the signer. </p><p>Default: "" (ie. US is "1")</p></td></tr><tr><td>phone_number</td><td align="center">string</td><td><p>You can set the phone number of the signer. Example: "11998989222". </p><p>Default: ""</p></td></tr><tr><td>lock_email</td><td align="center">boolean</td><td><p>You can lock changes to the signer's email. </p><p>Default: false</p></td></tr><tr><td>blank_email</td><td align="center">boolean</td><td>You may not request the signer's email. Default: false</td></tr><tr><td>hide_email</td><td align="center">boolean</td><td><p>You can hide the signer's email in the signatures report.</p><p>Default: false</p></td></tr><tr><td>lock_phone</td><td align="center">boolean</td><td><p>You can lock changes to the signer's phone. </p><p>Default: false</p></td></tr><tr><td>blank_phone</td><td align="center">boolean</td><td><p>You may not ask for the signer's phone number. </p><p>Default: false</p></td></tr><tr><td>hide_phone</td><td align="center">boolean</td><td>You can hide the signer's phone number in the signature report. Default: false</td></tr><tr><td>lock_name</td><td align="center">boolean</td><td><p>You can lock changes to the signer's name. </p><p>Default: false</p></td></tr><tr><td>require_selfie_photo</td><td align="center">boolean</td><td><p>You can ask the signer to take a selfie while signing. </p><p>Default: false. </p></td></tr><tr><td>selfie_validation_type</td><td align="center">string</td><td>You can ask the signer to take a photo of your personal document while signing. Default: falseIf 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. </td></tr><tr><td>qualification</td><td align="center">string</td><td><p>Qualification to appear in the signatures report. Ex: "Witness" value will result in "Signed as a witness". </p><p>Default: ""</p></td></tr><tr><td>external_id</td><td align="center">string</td><td>ID of the signer in your application. Default: ""</td></tr><tr><td>redirect_link</td><td align="center">string</td><td><p>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. </p><p>Default: "" </p></td></tr><tr><td>sign_url</td><td align="center">string</td><td>url for the signer to sign the document</td></tr><tr><td>token</td><td align="center">string</td><td>signer token</td></tr><tr><td>status</td><td align="center">string</td><td>signer status: "novo" = new,  "abriu-link" = link-opened or "assinou" = signed</td></tr><tr><td>times_viewed</td><td align="center">int</td><td>how many times the signer has seen the document</td></tr><tr><td>last_view_at</td><td align="center">string</td><td>data da ultima vez que o signatário viu o documento</td></tr><tr><td>signed_at</td><td align="center">string</td><td>date when the signer signed the document</td></tr><tr><td>geo_latitude</td><td align="center">string</td><td>latitude from where the signer signed the document (if they allow it)</td></tr><tr><td>geo_longitude</td><td align="center">string</td><td>longitude from where the signer signed the document (if he allows it)</td></tr><tr><td>signature_image</td><td align="center">string</td><td>image containing the signer's signature</td></tr><tr><td>visto_image</td><td align="center">string</td><td>image containing the signer's rubric</td></tr><tr><td>document_photo_url</td><td align="center">string</td><td>url containing the signer's document photo</td></tr><tr><td>document_verse_photo_url</td><td align="center">string</td><td>url containing the back of the signer's photo</td></tr><tr><td>selfie_photo_url</td><td align="center">string</td><td>url containing the signer's selfie photo</td></tr><tr><td>selfie_photo_url2</td><td align="center">string</td><td>url containing the signer's selfie photo</td></tr><tr><td>send_via</td><td align="center">string</td><td>how the document was sent to the signer: "email", "whatsapp" or null</td></tr></tbody></table>


# Java SDK

An overview of developing apps with Zapsign's Java SDK.

The repository for this SDK can be found [here](https://github.com/ZapSign/zapsign-sdkJava). In that you can see all the necessary code used.

In your project Maven - Java, add the [zapsign dependency](https://mvnrepository.com/artifact/br.com.zapsign/zapsign_sdk) in .pom:

```
<!-- https://mvnrepository.com/artifact/br.com.zapsign/zapsign_sdk -->
<dependency>
    <groupId>br.com.zapsign</groupId>
    <artifactId>zapsign_sdk</artifactId>
    <version>1.0-3</version>
</dependency>
```

Now just update your dependencies and criate your requests.

### Requests

The requests made by the SDK are separated into two parts:

* [Document Requests](/english/facilitators/sdks/java-sdk/documents-requests)
* [Signers Requests](/english/facilitators/sdks/java-sdk/signers-requests)


# Documents Requests

An overview of the request class for documents

### DocRequests Class

This is the class responsible for issuing requests to the zapsign api. To build this class you just have to put the api token as a reference:

```
DocRequests docRequest = new DocRequests(apiToken);
```

Using the DocRequests class, it is possible to perform the following requests:

* [createDocFromUploadPdf](/english/facilitators/sdks/java-sdk/documents-requests/createdocfromuploadpdf)
* [createDocFromUploadDocx](/english/facilitators/sdks/java-sdk/documents-requests/createdocfromuploaddocx)
* [createDocFromUploadAsync](/english/facilitators/sdks/java-sdk/documents-requests/createdocfromuploadasync)
* [createDocFromPdfBase64](/english/facilitators/sdks/java-sdk/documents-requests/createdocfrompdfbase64)
* [createDocFromBase64Async](/english/facilitators/sdks/java-sdk/documents-requests/createdocfrombase64async)
* [createDocFromTemplate](/english/facilitators/sdks/java-sdk/documents-requests/createdocfromtemplate)
* [createDocFromTemplateAsync](/english/facilitators/sdks/java-sdk/documents-requests/createdocfromtemplateasync)
* [addExtraDoc](/english/facilitators/sdks/java-sdk/documents-requests/addextradoc)
* [detailDoc](/english/facilitators/sdks/java-sdk/documents-requests/detaildoc)
* [getDocs](/english/facilitators/sdks/java-sdk/documents-requests/getdocs)
* [deleteDoc](/english/facilitators/sdks/java-sdk/documents-requests/deletedoc)
* [placeSignatures](/english/facilitators/sdks/java-sdk/documents-requests/placesignatures)


# createDocFromUploadPdf

### Overview

Parameters:

* [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf)

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To create this document we need:

* set your api token.
* set your signers.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```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;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();
                
ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);
```

Set your doc with class with the class [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf):

```java
DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                .build();

```

Call the method createDocFromUploadPdf and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
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());
}
```

### Example:

```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 = "YOUR 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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();

        ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);

        DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .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());
        }
    }
}
```


# createDocFromUploadDocx

### Overview

Parameters:

* [DocFromDocx](/english/facilitators/sdks/java-sdk/used-classes/body/docfromdocx)

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To create this document we need:

* set your api token.
* set your signers.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DocFromDocx;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;

import services.JsonConverter;
import java.io.IOException;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();
                
ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);
```

Set your doc with class with the class [DocFromDocx](/english/facilitators/sdks/java-sdk/used-classes/body/docfromdocx):

```java
DocFromDocx docFromDocx = DocFromDocx.docFromDocxBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .url_docx("https://zapsign.s3.amazonaws.com/2022/1/docs/d7660fd2-fe74-4691-bec8-5c42c0ae2b3f/39a35070-8987-476d-86e3-75d91f588a5a.docx")
                .build();

```

Call the method createDocFromUploadDocx and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
try {
    DocResponse docResponse = new DocRequests(apiToken).createDocFromUploadDocx(docFromDocx);
    String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.doc.DocFromDocx;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

import java.util.ArrayList;

public class CreateDocFromUploadDocx {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR 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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();

        ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);

        DocFromDocx docFromDocx = DocFromDocx.docFromDocxBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .url_docx("https://zapsign.s3.amazonaws.com/2022/1/docs/d7660fd2-fe74-4691-bec8-5c42c0ae2b3f/39a35070-8987-476d-86e3-75d91f588a5a.docx")
                .build();

        try {
            DocResponse docResponse = new DocRequests(apiToken).createDocFromUploadDocx(docFromDocx);
            String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# createDocFromUploadAsync

### Overview

Parameters:

* [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf)

Return:

* [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse) - success
* Exception - failure

To create this document we need:

* set your api token.
* set your signers.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DocFromPdf;
import body.signer.Signer;
import docs.DocRequests;
import response.DocAsyncResponse;

import services.JsonConverter;
import java.io.IOException;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();
                
ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);
```

Set your doc with class with the class [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf):

```java
DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .url_pdf("https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf")
                .build();
```

Call the method createDocFromUploadAsync and receive the [DocAsyncResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse)class or an error message as a response:

```java
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());
}
```

### Example:

```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 = "YOUR 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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();

        ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);

        DocFromPdf docFromPdf = DocFromPdf.docFromPdfBuilder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .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());
        }
    }
}
```


# createDocFromPdfBase64

### Overview

Parameters:

* [DocFromPdfBase64](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdfbase64)

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To create this document we need:

* set your api token.
* set your base64.
* set your signers.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DocFromPdfBase64;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

import java.io.IOException;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your base64:

```java
String base64 = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();
                
ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);
```

Set your doc with class with the class [DocFromPdfBase64](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdfbase64):

```java
DocFromPdfBase64 docFromPdfBase64 = DocFromPdfBase64.docFromPdfBase64Builder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .base64_pdf(base64)
                .build();

```

Call the method createDocFromPdfBase64 and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:&#x20;

```java
try {
    DocResponse docResponse = new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
    String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.doc.DocFromPdfBase64;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

import java.io.IOException;
import java.util.ArrayList;
public class CreateDocFromBase64Pdf {
    public static void main(String[] args) throws IOException, InterruptedException  {
        String apiToken = "YOUR TOKEN";
        String base64 = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."

                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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();

        ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);

        DocFromPdfBase64 docFromPdfBase64 = DocFromPdfBase64.docFromPdfBase64Builder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .base64_pdf(base64)
                .build();


        try {
            DocResponse docResponse = new DocRequests(apiToken).createDocFromPdfBase64(docFromPdfBase64);
            String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# createDocFromBase64Async

### Overview

Parameters:

* [DocFromPdfBase64](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdfbase64)

Return:

* [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse) - success
* Exception - failure

To create this document we need:

* set your api token.
* set your base64.
* set your signers.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DocFromPdfBase64;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

import java.io.IOException;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your base64:

```java
String base64 = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();
                
ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);
```

Set your doc with class with the class [DocFromPdfBase64](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdfbase64):

```java
DocFromPdfBase64 docFromPdfBase64 = DocFromPdfBase64.docFromPdfBase64Builder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .base64_pdf(base64)
                .build();

```

Call the method createDocFromBase64Async and receive the [DocAsyncResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse)class or an error message as a response:

```java
try {
    DocAsyncResponse docAsyncResponse = new DocRequests(apiToken).createDocFromPdfBase64Async(docFromPdfBase64);
    String jsonDocResponse = new JsonConverter().docAsyncResponseToJson(docAsyncResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.doc.DocFromPdfBase64;
import body.signer.Signer;
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

import java.io.IOException;
import java.util.ArrayList;
public class CreateDocFromBase64PdfAssync {
    public static void main(String[] args) throws IOException, InterruptedException  {
        String apiToken = "YOUR TOKEN";
        String base64 = "JVBERi0xLjYKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTG..."

                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") // draw on screen
                .send_automatic_email(false)
                .send_automatic_whatsapp(false)
                .build();

        ArrayList<Signer> signers = new ArrayList<>();
        signers.add(signer1);
        signers.add(signer2);

        DocFromPdfBase64 docFromPdfBase64 = DocFromPdfBase64.docFromPdfBase64Builder()
                .sandbox(false)
                .name("My Contract")
                .brand_primary_color("#000000")
                .lang("en")
                .signers(signers)
                .base64_pdf(base64)
                .build();


        try {
            DocAsyncResponse docAsyncResponse = new DocRequests(apiToken).createDocFromPdfBase64Async(docFromPdfBase64);
            String jsonDocResponse = new JsonConverter().docAsyncResponseToJson(docAsyncResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# createDocFromTemplate

Criar documento via Modelo

### Overview

Parameters:

* [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate)

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To create this document we need:

* set your api token.
* set your variables.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DeParaTemplate;
import body.doc.DocFromTemplate;
import docs.DocRequests;
import response.DocResponse;

import services.JsonConverter;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

add your variables in a [DeParaTemplate ](/english/facilitators/sdks/java-sdk/used-classes/body/deparatemplate)class list:

```java
DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder()
        .de("{{FULL NAME}}")
        .para("Full Name")
        .build();

DeParaTemplate deParaTemplateNumber= DeParaTemplate.deParaTemplateBuilder()
        .de("{{SOCIAL SECURITY NUMBER}}")
        .para("Social Security Number")
        .build();

DeParaTemplate deParaTemplateAddress = DeParaTemplate.deParaTemplateBuilder()
        .de("{{FULL ADDRESS}}")
        .para("Full address")
        .build();

ArrayList<DeParaTemplate> deParaTemplates = new ArrayList<>();
deParaTemplates.add(deParaTemplateName);
deParaTemplates.add(deParaTemplateCpf);
deParaTemplates.add(deParaTemplateEnd);

```

Set your doc with class with the class [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate):

```java
DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder()
                .sandbox(false)
                .brand_primary_color("#000000")
                .lang("en")
                .signer_name("My Signer for template")
                .template_id("75a3a92b-...")
                .data(deParaTemplates)
                .build();

```

Call the method createDocFromTemplate and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
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());
}
```

### Example:

```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 = "YOUR TOKEN";

        DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder()
                .de("{{FULL NAME}}")
                .para("Full Name")
                .build();

        DeParaTemplate deParaTemplateNumber= DeParaTemplate.deParaTemplateBuilder()
                .de("{{SOCIAL SECURITY NUMBER}}")
                .para("Social Security Number")
                .build();

        DeParaTemplate deParaTemplateAddress = DeParaTemplate.deParaTemplateBuilder()
                .de("{{FULL ADDRESS}}")
                .para("Full address")
                .build();

        ArrayList<DeParaTemplate> deParaTemplates = new ArrayList<>();
        deParaTemplates.add(deParaTemplateName);
        deParaTemplates.add(deParaTemplateCpf);
        deParaTemplates.add(deParaTemplateEnd);

        DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder()
                .sandbox(false)
                .brand_primary_color("#000000")
                .lang("en")
                .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());
        }
    }
}
```


# createDocFromTemplateAsync

### Overview

Parameters:

* [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate)

Return:

* [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse) - success
* Exception - failure

To create this document we need:

* set your api token.
* set your variables.
* set your doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.DeParaTemplate;
import body.doc.DocFromTemplate;
import docs.DocRequests;
import response.DocAsyncResponse;

import services.JsonConverter;
import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

add your variables in a [DeParaTemplate ](/english/facilitators/sdks/java-sdk/used-classes/body/deparatemplate)class list:

```java
DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder()
        .de("{{FULL NAME}}")
        .para("Full Name")
        .build();

DeParaTemplate deParaTemplateNumber= DeParaTemplate.deParaTemplateBuilder()
        .de("{{SOCIAL SECURITY NUMBER}}")
        .para("Social Security Number")
        .build();

DeParaTemplate deParaTemplateAddress = DeParaTemplate.deParaTemplateBuilder()
        .de("{{FULL ADDRESS}}")
        .para("Full address")
        .build();

ArrayList<DeParaTemplate> deParaTemplates = new ArrayList<>();
deParaTemplates.add(deParaTemplateName);
deParaTemplates.add(deParaTemplateCpf);
deParaTemplates.add(deParaTemplateEnd);
```

Set your doc with class with the class [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate):

```java
DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder()
                .sandbox(false)
                .brand_primary_color("#000000")
                .lang("en")
                .signer_name("My Signer for template")
                .template_id("75a3a92b-...")
                .data(deParaTemplates)
                .build();
```

Call the method createDocFromTemplateAsync and receive the [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse) class or an error message as a response:

```java
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());
}
```

### Example:

```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 = "YOUR TOKEN";

        DeParaTemplate deParaTemplateName = DeParaTemplate.deParaTemplateBuilder()
                .de("{{FULL NAME}}")
                .para("Full Name")
                .build();
        
        DeParaTemplate deParaTemplateNumber= DeParaTemplate.deParaTemplateBuilder()
                .de("{{SOCIAL SECURITY NUMBER}}")
                .para("Social Security Number")
                .build();
        
        DeParaTemplate deParaTemplateAddress = DeParaTemplate.deParaTemplateBuilder()
                .de("{{FULL ADDRESS}}")
                .para("Full address")
                .build();

        ArrayList<DeParaTemplate> deParaTemplates = new ArrayList<>();
        deParaTemplates.add(deParaTemplateName);
        deParaTemplates.add(deParaTemplateCpf);
        deParaTemplates.add(deParaTemplateEnd);

        DocFromTemplate docFromTemplate = DocFromTemplate.docFromTemplateBuilder()
                .sandbox(false)
                .brand_primary_color("#000000")
                .lang("en")
                .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());
        }
    }
}
```


# addExtraDoc

### Overview

Parameters:

* [ExtraDoc](/english/facilitators/sdks/java-sdk/used-classes/body/extradoc)

Return:

* [ExtraDocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/extradocresponse) - success
* Exception - failure

To add this extra document, we need:

* set your api token.
* set your doc token.
* set your extra doc.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.ExtraDoc;
import docs.DocRequests;
import response.ExtraDocResponse;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your doc token.

```java
String docToken = "DOC TOKEN";
```

Set your extra doc with class with the class [ExtraDoc](/english/documentos/adicionar-anexo-documento-extra):

```java
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();

```

Call the method addExtraDoc and receive the [ExtraDocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/extradocresponse) class or an error message as a response:

```java
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());
}
```

### Example:

```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 = "YOUR TOKEN";

        String docToken = "DOC TOKEN";

        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());
        }
    }
}
```


# detailDoc

### Overview

Parameters:

* String - doc token

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To get this document we need:

* set your api token.
* set your doc token.
* call the method.

### Usage:

Import the relevant components:

```java
import docs.DocRequests;
import response.DocResponse;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your doc token.

```java
String docToken = "DOC TOKEN"
```

Call the method detailDoc and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
try {
    DocResponse docResponse = new DocRequests(apiToken).detailDoc(docToken);

    String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

public class DetailDoc {
    public static void main(String[] args) throws Exception {
    String apiToken = "YOUR TOKEN";
    String docToken = "DOC TOKEN"

        try {
            DocResponse docResponse = new DocRequests(apiToken).detailDoc(docToken);

            String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# getDocs

Listar documentos

### Overview

Return:

* [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse) - success
* Exception - failure

To get your documents we need:

* set your api token.
* call the method.

### Usage:

Import the relevant components:

```java
import docs.DocRequests;
import response.DocsResponse;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Call the method getDocs and receive the [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse) class or an error message as a response:

```java
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());
}
```

### Example:

<pre class="language-java"><code class="lang-java">import docs.DocRequests;
import response.DocsResponse;
import services.JsonConverter;

public class GetDocs {
    public static void main(String[] args) throws Exception {
<strong>    String apiToken = "YOUR TOKEN";
</strong>
        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());
        }
    }
}
</code></pre>


# deleteDoc

### Overview

Parameters:

* String - doc token

Return:

* [DocResponse ](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To delete this document we need:

* set your api token.
* set your doc token.
* call the method.

### Usage:

Import the relevant components:

```java
import docs.DocRequests;
import response.DocsResponse;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your doc token.

```java
String docToken = "DOC TOKEN"
```

Call the method deleteDoc and receive the [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
try {
    DocResponse docResponse = new DocRequests(apiToken).deleteDoc(docToken);

    String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

public class DeleteDoc {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR TOKEN";
        String docToken = "DOC TOKEN"

        try {
            DocResponse docResponse = new DocRequests(apiToken).deleteDoc(docToken);

            String jsonDocResponse = new JsonConverter().docResponseToJson(docResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# placeSignatures

### Overview

Parameters:

* String - doc token
* [RubricaList](/english/facilitators/sdks/java-sdk/used-classes/body/rubricalist)

Retorno:

* int- success
* Exception - failure

To place signatures in this doc we need::

* set your api token.
* set your doc token.
* set your signatures.
* call the method.

### Usage:

Import the relevant components:

```java
import body.doc.Rubrica;
import body.doc.RubricaList;
import docs.DocRequests;

import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your doc token:

```java
String docToken = "DOC TOKEN";
```

Set your signatures list with the class [RubricaList](/english/facilitators/sdks/java-sdk/used-classes/body/rubricalist) that contains arrays of [Rubrica](/english/facilitators/sdks/java-sdk/used-classes/body/rubrica) class:

```java
Rubrica rubrica1 = Rubrica.builder()
                .page(0)
                .relative_position_bottom(52.50)
                .relative_position_left(75.71)
                .relative_size_x(19.55)
                .relative_size_y(9.42)
                .type("signature")
                .signer_token("TOKEN SIGNER")
                .build();

Rubrica rubrica2 = Rubrica.builder()
        .page(0)
        .relative_position_bottom(13.50)
        .relative_position_left(20.71)
        .relative_size_x(19.55)
        .relative_size_y(9.42)
        .type("visto")
        .signer_token("TOKEN SIGNER"
        .build();

ArrayList<Rubrica> _rubricas = new ArrayList<>();
_rubricas.add(rubrica1);
_rubricas.add(rubrica2);

RubricaList rubricaList = RubricaList.builder()
                .rubricas(_rubricas)
                .build();
```

Call the method placeSignatures and receive as a response an integer containing the status code of the response or an error message:

```java
try {
    int statusCode = new DocRequests(apiToken).placeSignatures(docToken, rubricaList);
    System.out.println(statusCode);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

<pre class="language-java"><code class="lang-java">import body.doc.Rubrica;
import body.doc.RubricaList;
import docs.DocRequests;

import java.util.ArrayList;

public class PlaceSignatures {
    public static void main(String[] args) throws Exception {
<strong>        String apiToken = "YOUR TOKEN";
</strong>
        String docToken = "DOC TOKEN";

        Rubrica rubrica1 = Rubrica.builder()
                .page(0)
                .relative_position_bottom(52.50)
                .relative_position_left(75.71)
                .relative_size_x(19.55)
                .relative_size_y(9.42)
                .type("signature")
                .signer_token("TOKEN SIGNER")
                .build();

        Rubrica rubrica2 = Rubrica.builder()
                .page(0)
                .relative_position_bottom(13.50)
                .relative_position_left(20.71)
                .relative_size_x(19.55)
                .relative_size_y(9.42)
                .type("visto")
                .signer_token("TOKEN SIGNER")
                .build();

        ArrayList&#x3C;Rubrica> _rubricas = new ArrayList&#x3C;>();
        _rubricas.add(rubrica1);
        _rubricas.add(rubrica2);

        RubricaList rubricaList = RubricaList.builder()
                .rubricas(_rubricas)
                .build();

        try {
            int statusCode = new DocRequests(apiToken).placeSignatures(docToken, rubricaList);
            System.out.println(statusCode);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
</code></pre>


# Signers Requests

An overview of the request class for signers

### SignersRequests Class

This is the class responsible for issuing requests to the zapsign api. To build this class you just have to put the [api token](/english) as a reference:

```java
SignerRequests signerRequest = new SignerRequests(apiToken);
```

Using the SignerRequests class, it is possible to perform the following requests:

* [detailSigner](/english/facilitators/sdks/java-sdk/signers-requests/detailsigner)
* [updateSigner](/english/facilitators/sdks/java-sdk/signers-requests/updatesigner)
* [addSigner](/english/facilitators/sdks/java-sdk/signers-requests/addsigner)
* [deleteSigner](/english/facilitators/sdks/java-sdk/signers-requests/deletesigner)
* [signInBatch](/english/facilitators/sdks/java-sdk/signers-requests/signinbatch)


# detailSigner

### Overview

Parameters:

* String - signer token

Return:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response) - success
* Exception - failure

To get this signer we need:

* set your api token.
* set your signer token.
* call the method.

### Usage:

Import the relevant components:

```java
import body.signer.Signer;
import signers.SignerRequest;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signer token.

```java
String signerToken= "SIGNER TOKEN";
```

Call the method detailSigner and receive the [Signer](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response) class or an error message as a response:

```java
try {
    Signer signer = new SignerRequest(apiToken).detailSigner(signerToken);
    String jsonDocResponse = new JsonConverter().signerToJson(signer);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.signer.Signer;
import services.JsonConverter;
import signers.SignerRequest;

public class DetailSigner {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR TOKEN";
        String signerToken= "SIGNER TOKEN";

        try {
            Signer signer = new SignerRequest(apiToken).detailSigner(signerToken);
            String jsonDocResponse = new JsonConverter().signerToJson(signer);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# updateSigner

### Overview

Parameters:

* String - signer token
* [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer)

Return:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response) - success
* Exception - failure

To update this signer we need:

* set your api token.
* set your signer token.
* set the new signer values.
* call the method.

### Usage:

Import the relevant components:

```java
import body.signer.Signer;
import signers.SignerRequest;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signer token.

```
String signerToken= "SIGNER TOKEN";
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
Signer signer = Signer.builder()
                .name("New 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();
```

Call the method updateSigner and receive the [Signer ](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response)class or an error message as a response:

```java
try {
    Signer signerResponse = new SignerRequest(apiToken).updateSigner(signerToken, signer);
    String jsonDocResponse = new JsonConverter().signerToJson(signerResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.signer.Signer;
import services.JsonConverter;
import signers.SignerRequest;

public class UpdateSigner {
    public static void main(String[] args) throws Exception {
        String apiToken = "SEU TOKEN";
        String signerToken= "TOKEN DO SIGNATÁRIO";

        Signer signer = Signer.builder()
                .name("New 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).updateSigner(signerToken, signer);
            String jsonDocResponse = new JsonConverter().signerToJson(signerResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# addSigner

### Overview

Parameters:

* String - doc token
* [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer)

Return:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response) - success
* Exception - failure

To add this signer we need:

* set your api token.
* set your doc token.
* set your new signer.
* call the method.

### Usage:

Import the relevant components:

```java
import body.signer.Signer;
import signers.SignerRequest;

import services.JsonConverter;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your doc token.

```java
String docToken = "DOC TOKEN";
```

Set your signers with the class [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer):

```java
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();
```

Call the method addSigner and receive the [Signer ](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response)class or an error message as a response:

```java
try {
    Signer signerResponse = new SignerRequest(apiToken).updateSigner(signerToken, signer);
    String jsonDocResponse = new JsonConverter().signerToJson(signerResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import body.signer.Signer;
import services.JsonConverter;
import signers.SignerRequest;

public class AddSigner {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR TOKEN";
        String docToken = "DOC TOKEN";

        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());
        }
    }
}
```


# deleteSigner

### Overview

Parameters:

* String - signer token

Return:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response) - success
* Exception - failure

To delete this signer we need:

* set your api token.
* set your signer token.
* call the method.

### Usage:

Import the relevant components:

```java
import signers.SignerRequest;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

Set your signer token.

```java
String signerToken = "SIGNER TOKEN";
```

Call the method deleteSigner and receive as a response a string containing "Signatário removido com sucesso." or an error message:

```java
try {
    Signer signerResponse = new SignerRequest(apiToken).updateSigner(signerToken, signer);
    String jsonDocResponse = new JsonConverter().signerToJson(signerResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```java
import signers.SignerRequest;

public class DeleteSigner {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR TOKEN";
        String signerToken = "SIGNER TOKEN";

        try {
            String response = new SignerRequest(apiToken).deleteSigner(signerToken);
            System.out.println(response);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
```


# signInBatch

### Overview

Parameters:

* [SignBatch](/english/facilitators/sdks/java-sdk/used-classes/body/signbatch)

Return:

* String[ ](broken://pages/LNA023m1MfF7Iv92JTZd)- success
* Exception - failure

To sign in batch we need:

* set your api token.
* set your user token.
* set your signers token.
* set your SignInBatch class.
* call the method.

### Usage:

Import the relevant components:

```java
import body.signer.SignBatch;
import signers.SignerRequest;

import java.util.ArrayList;
```

Set your [Api Token](/english):

```java
String apiToken = "YOUR TOKEN";
```

set your user token, ([where to find](/english/signatarios/assinar-em-lote-via-api))

```java
String userToken = "USER TOKEN";
```

Salve o token de seus signatários

```java
String signer_token1 = "SIGNER TOKEN 1";
String signer_token2 = "SIGNER TOKEN 2";

ArrayList<String> signers_token = new ArrayList<>();
        signers_token.add(signer_token1);
        signers_token.add(signer_token2);
```

Set your [SignInBatch](/english/facilitators/sdks/java-sdk/signers-requests/signinbatch) class:

```java
SignBatch signBatch = SignBatch.builder()
                .user_token(userToken)
                .signer_tokens(signers_token)
                .build();
```

Call the method signInBatch and receive as a response a string containing a success message or an error message:

```java
try {
    Signer signerResponse = new SignerRequest(apiToken).updateSigner(signerToken, signer);
    String jsonDocResponse = new JsonConverter().signerToJson(signerResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

```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 = "YOUR TOKEN";
        String userToken = "USER TOKEN";
        String signer_token1 = "SIGNER TOKEN 1";
        String signer_token2 = "SIGNER TOKEN 2";

        ArrayList<String> 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());
        }
    }
}
```


# Used Classes

We separate this classes in:

* [Body](/english/facilitators/sdks/java-sdk/used-classes/body) - classes used to formulate the request body.
* [Response](/english/facilitators/sdks/java-sdk/used-classes/response) - classes used to formulate request responses.


# Body

classes used to formulate the request body

### Classes used in documents:

* [Doc](/english/facilitators/sdks/java-sdk/used-classes/body/doc)
  * [DocFromDocx](/english/facilitators/sdks/java-sdk/used-classes/body/docfromdocx)
  * [DocFromPdf](/english/facilitators/sdks/java-sdk/used-classes/body/docfrompdf)
  * [DocFromTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/docfromtemplate)
* [DeParaTemplate](/english/facilitators/sdks/java-sdk/used-classes/body/deparatemplate)
* [ExtraDoc](/english/facilitators/sdks/java-sdk/used-classes/body/extradoc)
* [Rubrica](/english/facilitators/sdks/java-sdk/used-classes/body/rubrica)
* [RubricaList](/english/facilitators/sdks/java-sdk/used-classes/body/rubricalist)

### Classes used in signers:

* [Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer)
* [SignBatch](/english/facilitators/sdks/java-sdk/used-classes/body/signbatch)


# Doc

Class to create documents

### Properties:

| name                         |                                      type                                      | description                                                                                                                                                                                                                                                                                                                                                                           |
| ---------------------------- | :----------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sandbox                      |                                     boolean                                    | If true, the document will be a test and will not have legal validity.                                                                                                                                                                                                                                                                                                                |
| name                         |                                     String                                     | document name                                                                                                                                                                                                                                                                                                                                                                         |
| lang                         |                                     String                                     | <p>document language. Possible values: </p><p>"pt-br" (Portuguese), </p><p>"es" (Spanish), </p><p>"en" (English). </p><p>Default: "pt-br"</p>                                                                                                                                                                                                                                         |
| disable\_signer\_emails      |                                     boolean                                    | <p>To disable emails sent to signers, send this parameter to true. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                          |
| signed\_file\_only\_finished |                                     boolean                                    | <p>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. </p><p>Default: false</p>                                                                                                                                                 |
| brand\_logo                  |                                     String                                     | <p>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). </p><p>Default: ""</p>                                                                                                                                                                                                          |
| brand\_primary\_color        |                                     String                                     | <p>If you want to customize the primary (button) color of the signing experience for this specific document, send it in rgb or hexadecimal. </p><p>Ex: "#0011ee". </p><p>Default: ""</p>                                                                                                                                                                                              |
| brand\_name                  |                                     String                                     | <p>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". </p><p>Max-length: 100 characters. </p><p>Default: ""</p>                                                                                                            |
| external\_id                 |                                     String                                     | <p>ID of the document in your application. </p><p>Default: ""</p>                                                                                                                                                                                                                                                                                                                     |
| folder\_path                 |                                     String                                     | <p>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. </p><p>Ex.: "/api/" or "/folder1/folder2/folder3/". Default: "/" (no folder).</p> |
| date\_limit\_to\_sign        |                                      Date                                      | Deadline for signing the document. (Accepted formats: YYYY-MM-DD, YYYY-MM-DDTH:m:s.ssssssZ)                                                                                                                                                                                                                                                                                           |
| signature\_order\_active     |                                     boolean                                    | <p>If true, the signer's signatures will be ordered sequentially. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                           |
| observers                    |                               ArrayList\<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                      |  List<[Signer](/english/facilitators/sdks/java-sdk/used-classes/body/signer)>  | Represents the document signers                                                                                                                                                                                                                                                                                                                                                       |
| reminder\_every\_n\_days     |                                       int                                      | Represents the interval of days between reminders that will be sent to signers, as long as they don\`t sign. There will be 3 tries at most. Observation: this field must only be filled if send\_automatic\_whatsapp or send\_automatic\_email are true. Example: if setted to 8 it will be sent one email every 7 days, until it's signed, for at most 21 days.                      |
| created\_by                  | [CreateBy](/english/facilitators/sdks/java-sdk/used-classes/response/createby) | <p>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. </p><p>Default: "" </p><p>(document will have account owner as creator)</p>                                                                                                         |


# DocFromDocx

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

| name      |  type  | description                    |
| --------- | :----: | ------------------------------ |
| url\_docx | String | docx url for document creation |


# DocFromPdf

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

| name     |  type  | description                   |
| -------- | :----: | ----------------------------- |
| url\_pdf | String | pdf url for document creation |


# DocFromPdfBase64

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

| name        |  type  | description  |
| ----------- | :----: | ------------ |
| base64\_pdf | String | pdf's Base64 |


# DocFromTemplate

Class to create documents

Class inherited from the [Doc ](/english/facilitators/sdks/java-sdk/used-classes/body/doc)class.

### Properties:

<table><thead><tr><th width="270.3333333333333">name</th><th align="center">type</th><th>description</th></tr></thead><tbody><tr><td>signer_name</td><td align="center">String</td><td>Signer name</td></tr><tr><td>template_id</td><td align="center">String</td><td>Template Id</td></tr><tr><td>data</td><td align="center">List&#x3C;<a href="/pages/IhAqipkx7h0MjuWmowJp">DeParaTemplate</a>></td><td>class list of variables</td></tr><tr><td>send_automatic_email</td><td align="center">boolean</td><td><p>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. </p><p>Note: For this to work, it is mandatory that the signer's email address is defined.</p></td></tr><tr><td>send_automatic_whatsapp</td><td align="center">boolean</td><td><p>If true, ZapSign will send a whatsapp 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. </p><p>Note: For this to work, it is mandatory that the signer's cell phone is defined.</p></td></tr><tr><td>custom_message </td><td align="center">String</td><td><p>The custom_message is the personalized message that you can insert in the email sent by ZapSign to the signer. </p><p>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: ""</p></td></tr><tr><td>signer_has_incomplete_fields </td><td align="center">boolean</td><td>If set to <em>true</em>, the signer will be redirected to fill out the template form before signing the document. Default: false</td></tr></tbody></table>

### Override:

DocFromTemplate não recebe signatários, então não é possivel realizar metodos como:&#x20;

* getSigners
* setSigners


# DeParaTemplate

Class to build the DocFromTemplate class

### Properties:

|      |        |                        |
| ---- | :----: | ---------------------- |
| de   | String | variable's name (from) |
| para | String | variable's value (to)  |


# ExtraDoc

Class to create extra documents

### Properties:

| name     |  type  | description                         |
| -------- | :----: | ----------------------------------- |
| name     | String | Extra doc's name                    |
| url\_pdf | String | pdf url for extra document creation |


# Rubrica

Class to create signatures

### Properties:

| name                       |   type  | description                                                    |
| -------------------------- | :-----: | -------------------------------------------------------------- |
| page                       | Integer | document page                                                  |
| relative\_position\_bottom |  float  | distance from 0 to 100 from the bottom edge of the page        |
| relative\_position\_left   |  float  | distance from 0 to 100 from the left edge of the page          |
| relative\_size\_x          |  float  | size from 0 to 100 of signature compared to page width         |
| relative\_size\_y          |  float  | size from 0 to 100 of signature compared to page height        |
| type                       |  String | signature type: "signature" for signature and "visto" for visa |
| signer\_token              |  String | signer token                                                   |


# RubricaList

List of signatures for placement in the document

### Properties:

| name     |                                      type                                      | description     |
| -------- | :----------------------------------------------------------------------------: | --------------- |
| rubricas | List<[Rubrica](/english/facilitators/sdks/java-sdk/used-classes/body/rubrica)> | signatures list |


# Signer

Class to create signers

### Properties:

|                           |         |                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                      |  String | You can set the signer's name.                                                                                                                                                                                                                                                                                                                                  |
| email                     |  String | You can set the signer's email.                                                                                                                                                                                                                                                                                                                                 |
| 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.                                                                              |
| send\_automatic\_email    | boolean | <p>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. </p><p>Note: For this to work, it is mandatory that the signer's email address is defined.</p> |
| send\_automatic\_whatsapp | boolean | <p>If true, ZapSign will send a whatsapp 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. </p><p>Note: For this to work, it is mandatory that the signer's cell phone is defined.</p>  |
| order\_group              |   int   | In case "signature\_order\_active" is active in the document, this field controls the signing order. Example: If the field is set to 1, then this signer will be the first to sign. If the field is set to 2, then this signer will be the second to sign and so on.                                                                                            |
| custom\_message           |  String | <p>(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. </p><p>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. </p><p>Default: ""</p>                 |
| 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 | <p>You can lock changes to the signer's email. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                        |
| blank\_email              | boolean | <p>You may not request the signer's email. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                            |
| hide\_email               | boolean | <p>You can hide the signer's email in the signatures report. </p><p>Default: false</p>                                                                                                                                                                                                                                                                          |
| lock\_phone               | boolean | <p>You can lock changes to the signer's phone. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                        |
| blank\_phone              | boolean | You may not ask for the signer's phone number. Default: false                                                                                                                                                                                                                                                                                                   |
| hide\_phone               | boolean | <p>You can hide the signer's phone number in the signature report. </p><p>Default: false</p>                                                                                                                                                                                                                                                                    |
| lock\_name                | boolean | <p>You can lock changes to the signer's name. </p><p>Default: false</p>                                                                                                                                                                                                                                                                                         |
| require\_selfie\_photo    | boolean | You can ask the signer to take a selfie while signing. Default: false.                                                                                                                                                                                                                                                                                          |
| selfie\_validation\_type  |  String | <p>You can ask the signer to take a photo of your personal document while signing. Default: falseIf you want to use facial recognition (liveness+document match validation) provided by Truora, please also define this field as "liveness-document-match". </p><p>Default: "none". Note that this feature has an extra cost, please contact sales. </p>        |
| qualification             |  String | <p>Qualification to appear in the signatures report. </p><p>Ex: "Witness" value will result in "Signed as a witness". </p><p>Default: ""</p>                                                                                                                                                                                                                    |
| external\_id              |  String | <p>ID of the signer in your application. </p><p>Default: ""</p>                                                                                                                                                                                                                                                                                                 |
| 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: ""                                                                             |


# SignBatch

Class used to Sign in batch

### Properties:

| name           |      type     | description                |
| -------------- | :-----------: | -------------------------- |
| user\_token    |     String    | user's token who will sign |
| signer\_tokens | List\<String> | list of signer's tokens    |


# Response

Classes Used to form the request response

### Classes to form requests responses:

* [DocAsyncResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docasyncresponse)
* [DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)
* [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse)
* [ExtraDocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/extradocresponse)
* [Answers](/english/facilitators/sdks/java-sdk/used-classes/response/answers)
* [CreateBy](/english/facilitators/sdks/java-sdk/used-classes/response/createby)
* [Template](/english/facilitators/sdks/java-sdk/used-classes/response/template)
* [Signer ](/english/facilitators/sdks/java-sdk/used-classes/response/signer-response)(response)


# DocAsyncResponse

Asynchronous request response class

### Properties:

| name  |  type  | description                           |
| ----- | :----: | ------------------------------------- |
| token | String | asynchronously created document token |


# DocResponse

document response class

Classe herdada de [Doc](broken://pages/7jnqioddfttdlvP3NZ0M).

### Properties:

<table><thead><tr><th width="202.33333333333331">name</th><th width="293" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>open_id</td><td align="center">int</td><td>the sequential number of this document inside your company</td></tr><tr><td>token</td><td align="center">String</td><td>Document token</td></tr><tr><td>status</td><td align="center">String</td><td>Document status: "em-curso", "assinado", "recusado" or "lixeira"</td></tr><tr><td>original_file</td><td align="center">String</td><td>Url of original file saved on amazon</td></tr><tr><td>signed_file</td><td align="center">String</td><td>Signed file url saved on amazon</td></tr><tr><td>created_through</td><td align="center">String</td><td>Where this document was created: "web" or "api"</td></tr><tr><td>extra_docs</td><td align="center">ArrayList&#x3C;<a href="/pages/DaRrUm7xMaLI07I6f9YT">ExtraDocResponse</a>></td><td>Document extra documents list</td></tr><tr><td>deleted</td><td align="center">boolean</td><td>If True, the document has been deleted</td></tr><tr><td>deleted_at</td><td align="center">String</td><td>Date the document was deleted</td></tr><tr><td>created_at</td><td align="center">String</td><td>Date the document was created</td></tr><tr><td>last_update_at</td><td align="center">String</td><td>Last date the document was updated</td></tr><tr><td>template</td><td align="center"><a href="/pages/LzFktcaTyyMaI94Sw8FG">Template</a></td><td>If the document was created by a model, it contains the model token</td></tr><tr><td>answers</td><td align="center">ArrayList&#x3C;<a href="/pages/irMwv4FoMr5K4hrVjY56">Answers</a>></td><td>List of variables and values ​​for creating this document</td></tr><tr><td>auto_reminder</td><td align="center">int</td><td>Number of times this document will notify signers</td></tr><tr><td>signers</td><td align="center">List&#x3C;<a href="/pages/2tgfF6OPg8ILy8jRTj3Q">Signer</a>></td><td>represents the list of signers saved in the document</td></tr></tbody></table>


# DocsResponse

Document list response class

### Properties:

| name     |                                               type                                              | description                                   |
| -------- | :---------------------------------------------------------------------------------------------: | --------------------------------------------- |
| count    |                                               int                                               | Number of documents found                     |
| next     |                                              String                                             | url for next request if it has pagination     |
| previous |                                              String                                             | url for previous request if it has pagination |
| results  | ArrayList<[DocResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)> | List of documents found                       |


# ExtraDocResponse

Response class that contains the extra document

### Properties:

| name           |  type  | description                                                 |
| -------------- | :----: | ----------------------------------------------------------- |
| open\_id       | String | the sequential number of this documento inside your company |
| token          | String | extra document token                                        |
| name           | String | extra document name                                         |
| original\_file | String | extra document url without signatures                       |
| signed\_file   | String | extra document url with signatures                          |


# Answers

Response class that contains the document variables and values

### Properties:

| name     |  type  | description              |
| -------- | :----: | ------------------------ |
| variable | String | variable name (question) |
| value    | String | variable value (answer)  |


# CreateBy

Response class that contains the user who created the document

### Properties:

| name  |  type  | description                 |
| ----- | :----: | --------------------------- |
| email | String | document creator user email |


# Template

Response class that contains the document creator template

### Properties:

| name  |  type  | description                     |
| ----- | :----: | ------------------------------- |
| token | String | document creator template token |


# Signer (Response)

Signer with all the information coming from the response

This class is the same as Signer, but contains more properties when coming from the request response.

### Properties:

<table><thead><tr><th width="259.3333333333333">name</th><th width="191" align="center">type</th><th>description</th></tr></thead><tbody><tr><td>name</td><td align="center">String</td><td>You can set the signer's name.</td></tr><tr><td>email</td><td align="center">String</td><td>You can set the signer's email.</td></tr><tr><td>auth_mode</td><td align="center">String</td><td>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.</td></tr><tr><td>send_automatic_email</td><td align="center">boolean</td><td><p>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. </p><p>Note: For this to work, it is mandatory that the signer's email address is defined.</p></td></tr><tr><td>send_automatic_whatsapp</td><td align="center">boolean</td><td>If true, ZapSign will send a whatsapp 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 cell phone is defined.</td></tr><tr><td>order_group</td><td align="center">int</td><td>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.</td></tr><tr><td>custom_message</td><td align="center">String</td><td><p>(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. </p><p>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. </p><p>Default: ""</p></td></tr><tr><td>phone_country</td><td align="center">String</td><td><p>You can set the phone (country code) of the signer.</p><p>Default: "" (ie. US is "1")</p></td></tr><tr><td>phone_number</td><td align="center">String</td><td><p>You can set the phone number of the signer. </p><p>Example: "11998989222".</p><p>Default: ""</p></td></tr><tr><td>lock_email</td><td align="center">boolean</td><td><p>You can lock changes to the signer's email. </p><p>Default: false</p></td></tr><tr><td>blank_email</td><td align="center">boolean</td><td><p>You may not request the signer's email. </p><p>Default: false</p></td></tr><tr><td>hide_email</td><td align="center">boolean</td><td><p>You can hide the signer's email in the signatures report. </p><p>Default: false</p></td></tr><tr><td>lock_phone</td><td align="center">boolean</td><td><p>You can lock changes to the signer's phone. </p><p>Default: false</p></td></tr><tr><td>blank_phone</td><td align="center">boolean</td><td><p>You may not ask for the signer's phone number. </p><p>Default: false</p></td></tr><tr><td>hide_phone</td><td align="center">boolean</td><td>You can hide the signer's phone number in the signature report. Default: false</td></tr><tr><td>lock_name</td><td align="center">boolean</td><td><p>You can lock changes to the signer's name. </p><p>Default: false</p></td></tr><tr><td>require_selfie_photo</td><td align="center">boolean</td><td><p>You can ask the signer to take a selfie while signing. </p><p>Default: false. </p></td></tr><tr><td>selfie_validation_type</td><td align="center">String</td><td>You can ask the signer to take a photo of your personal document while signing. Default: falseIf 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. </td></tr><tr><td>qualification</td><td align="center">String</td><td><p>Qualification to appear in the signatures report. Ex: "Witness" value will result in "Signed as a witness". </p><p>Default: ""</p></td></tr><tr><td>external_id</td><td align="center">String</td><td>ID of the signer in your application. Default: ""</td></tr><tr><td>redirect_link</td><td align="center">String</td><td><p>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. </p><p>Default: "" </p></td></tr><tr><td>sign_url</td><td align="center">String</td><td>url for the signer to sign the document</td></tr><tr><td>token</td><td align="center">String</td><td>signer token</td></tr><tr><td>status</td><td align="center">String</td><td>signer status: "novo" = new,  "abriu-link" = link-opened or "assinou" = signed</td></tr><tr><td>times_viewed</td><td align="center">int</td><td>how many times the signer has seen the document</td></tr><tr><td>last_view_at</td><td align="center">String</td><td>data da ultima vez que o signatário viu o documento</td></tr><tr><td>signed_at</td><td align="center">String</td><td>date when the signer signed the document</td></tr><tr><td>geo_latitude</td><td align="center">String</td><td>latitude from where the signer signed the document (if they allow it)</td></tr><tr><td>geo_longitude</td><td align="center">String</td><td>longitude from where the signer signed the document (if he allows it)</td></tr><tr><td>signature_image</td><td align="center">String</td><td>image containing the signer's signature</td></tr><tr><td>visto_image</td><td align="center">String</td><td>image containing the signer's rubric</td></tr><tr><td>document_photo_url</td><td align="center">String</td><td>url containing the signer's document photo</td></tr><tr><td>document_verse_photo_url</td><td align="center">String</td><td>url containing the back of the signer's photo</td></tr><tr><td>selfie_photo_url</td><td align="center">String</td><td>url containing the signer's selfie photo</td></tr><tr><td>selfie_photo_url2</td><td align="center">String</td><td>url containing the signer's selfie photo</td></tr><tr><td>send_via</td><td align="center">String</td><td>how the document was sent to the signer: "email", "whatsapp" or null</td></tr></tbody></table>




---

[Next Page](/llms-full.txt/1)

