placeSignatures

Overview

Parameters:

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:

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

import java.util.ArrayList;

Set your Api Token:

String apiToken = "YOUR TOKEN";

Set your doc token:

String docToken = "DOC TOKEN";

Set your signatures list with the class RubricaList that contains arrays of Rubrica class:

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:

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

Example:

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 {
        String apiToken = "YOUR TOKEN";

        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<Rubrica> _rubricas = new ArrayList<>();
        _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());
        }
    }
}

Last updated