import body.doc.Rubrica;
import body.doc.RubricaList;
import docs.DocRequests;
import java.util.ArrayList;
String apiToken = "SEU TOKEN";
String docToken = "TOKEN DOCUMENTO";
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();
Chame o método placeSignatures e receba como resposta um inteiro contendo o status code da resposta ou uma mensagem de erro:
try {
int statusCode = new DocRequests(apiToken).placeSignatures(docToken, rubricaList);
System.out.println(statusCode);
}
catch(Exception exceptionError) {
System.out.println(exceptionError.getMessage());
}
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 = "SEU TOKEN";
String docToken = "TOKEN DOCUMENTO";
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());
}
}
}