Skip to main content

Webhook

Todas as notificações do evento atrelado à batch_group_key serão notificados no endereço registrado aqui, e em todas as chamadas de webhook o payload irá conter os dados do batch_group, batches, related_parties, signer_groups e signer.

Estados

Nós enviamos um payload via webhook com todos os dados do batch nas seguintes mudanças de internal_status:

Mudanças de status interno (internal_status)
  • criação do evento -> pending - este evento pode ser ignorado
  • pending -> waiting_zip_file - Neste ponto o signature_status será signed, mas os documentos ainda não podem ser baixados
  • waiting_zip_file ->finished - Nesta notificação o evento foi finalizado, todas as assinaturas foram feitas e os documentos podem ser baixados pelo link no campo all_files_url. Também notificamos as mudanças nos signature_status das related_parties e do batch_group.
Mudanças no status de assinatura (signature_status)

Para as related_parties:

  • pending -> signed - Notificamos via webhook e os assinantes via e-mail

Para o batch_group:

  • pending -> signed - Notificamos via webhook e os assinantes via e-mail quando o evento é totalmente assinado
  • pending -> rejected - Notificamos via webhook e os assinantes via e-mail caso um assinante rejeite o evento
  • pending -> cancel_signature - Notificamos via webhook.

Os dados do evento podem ser consultados através do endpoint GET /batch_group/{batch_group_key}. Os dados retornados neste endpoint contém todas as informações de internal_status e signature_status de todos os objetos.

Mudanças de status interno (internal_status)

O evento de assinatura está assinado quando o signature_status do batch_group for signed. Caso seja necessário o download do zip com todos os arquivos referente à assinatura, é necessário esperar pelo internal_status = finished.

Exemplos de Webhooks

Finalização da assinatura de um grupo de assinantes

Response Body
{
"batch_group_key": "d445060c-7ecf-4a18-870a-feebaadf2618",
"name": "aaa",
"main_related_party": "aaa",
"number_of_documents": 1,
"total_value": 0,
"all_files_url": "",
"send_to_fund_administrator": 0,
"signature_expiration_date": null,
"webhook_key": "e4bbb09d-97d0-4cd7-b4fc-71ed7368a650",
"client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
"requester_key": null,
"signature_status": "pending",
"internal_status": "pending",
"attached_document_number": "59860422000180",
"current_signature_position": "1",
"control_number": null,
"internal_webhook_key": null,
"created_at": "2023-05-18 00:02:49",
"batch_group_type": "icp_signature",
"requester_identifier": null,
"send_emails": true,
"batches": [
{
"document_batch_key": "a34bd069-9ae9-4baf-8204-7559e84e6947",
"name": "Outros",
"document_type": "other",
"signature_type": "cades",
"signature_status": "pending",
"created_at": "2023-05-18 00:02:49",
"related_parties": [
{
"related_party_key": "b972beb3-7659-40ac-8999-8574cfe42191",
"name": "Savio",
"role": "assignor",
"signature_status": "signed",
"signature_position": "1",
"created_at": "2023-05-18 00:02:49",
"auto_signature": 0,
"notify_to": [],
"signer_groups": [
{
"id": 38598,
"expiration": null,
"minimum_required_signers": 1,
"signable_limit": null,
"signature_status": "signed",
"created_at": "2023-05-18 00:02:49",
"signers": [
{
"id": 65095,
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"name": "Savio",
"is_group_mandatory": true,
"email": "savio.gama@qitech.com.br",
"document_number": "43141581827",
"created_at": "2023-05-18 00:02:49"
}
]
}
]
},
{
"related_party_key": "e19d038e-5c60-47db-aa44-d4d948592705",
"name": "Turing",
"role": "guarantor",
"signature_status": "pending",
"signature_position": "1",
"created_at": "2023-05-18 00:02:49",
"auto_signature": 0,
"notify_to": [],
"signer_groups": [
{
"id": 38599,
"expiration": null,
"minimum_required_signers": 1,
"signable_limit": null,
"signature_status": "pending",
"created_at": "2023-05-18 00:02:49",
"signers": [
{
"id": 65096,
"signer_control_number": "1",
"signature_timestamp": null,
"signature_status": "pending",
"name": "Turing",
"is_group_mandatory": true,
"email": "teste@gmail.com",
"document_number": "56072386105",
"created_at": "2023-05-18 00:02:49"
}
]
}
]
}
],
"documents": [
{
"document_key": "40c0940a-3db5-489b-86d6-ebf2717e0a9c",
"control_number": "9f907aef-04b5-4adb-9f4e-e2c53293c4d7",
"file_size": 1669,
"file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
"name": "teste_of.pdf",
"original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
"status": "pending",
"signed_file_url": null,
"created_at": "2023-05-18 00:02:49",
"signatures": [
{
"signer": {
"id": 65095,
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"name": "Savio",
"is_group_mandatory": true,
"email": "savio.gama@qitech.com.br",
"document_number": "43141581827",
"created_at": "2023-05-18 00:02:49"
},
"signed_hash": "ldp+t2F5MpgLtA++sIaFxEKXxsVJGnXeco2+cN7v3KSlsvxIwm2xMwQ4JjE8Mm3s93swB0dYBb5m/BBmCuRhzRsopQtVVRgRkdhKSwa5JBWVIgEd7gsb/CMIQqmG4wZLM9XZNUrx60LwfrdAnyjDEg8/JBdoeks3whOeQ1eai04dZyBAHkd6yplnFvi89PhEjLNU93C2CqyjCaSVr5HviLQovlpTxmiPYfRR+cqzlljbYLMqat2LXvjaW2T6AvtYWQRmL3HJ5GmDQytjNXsHBOQFKQ+Nyu+KnEnxg2ofqmNXlhID78YaGFpmZVLT9aLeFflJIFazaHWq6wPq8M5Hqg==",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"role": "assignor",
"created_at": "2023-05-18 00:06:13"
}
]
}
]
}
],
"watcher_clients": []
}

Finalização do evento

Response Body
{
"batch_group_key": "d445060c-7ecf-4a18-870a-feebaadf2618",
"name": "aaa",
"main_related_party": "aaa",
"number_of_documents": 1,
"total_value": 0,
"all_files_url": "https://storage.googleapis.com/certifier-worker-storage-sandbox/d445060c-7ecf-4a18-870a-feebaadf2618/d445060c-7ecf-4a18-870a-feebaadf2618.zip",
"send_to_fund_administrator": 0,
"signature_expiration_date": null,
"webhook_key": "e4bbb09d-97d0-4cd7-b4fc-71ed7368a650",
"client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
"requester_key": null,
"signature_status": "signed",
"internal_status": "finished",
"attached_document_number": "59860422000180",
"current_signature_position": "1",
"control_number": null,
"internal_webhook_key": null,
"created_at": "2023-05-18 00:02:49",
"batch_group_type": "icp_signature",
"requester_identifier": null,
"send_emails": true,
"batches": [
{
"document_batch_key": "a34bd069-9ae9-4baf-8204-7559e84e6947",
"name": "Outros",
"document_type": "other",
"signature_type": "cades",
"signature_status": "signed",
"created_at": "2023-05-18 00:02:49",
"related_parties": [
{
"related_party_key": "b972beb3-7659-40ac-8999-8574cfe42191",
"name": "Savio",
"role": "assignor",
"signature_status": "signed",
"signature_position": "1",
"created_at": "2023-05-18 00:02:49",
"auto_signature": 0,
"notify_to": [],
"signer_groups": [
{
"expiration": null,
"minimum_required_signers": 1,
"signable_limit": null,
"signature_status": "signed",
"created_at": "2023-05-18 00:02:49",
"signers": [
{
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"name": "Savio",
"is_group_mandatory": true,
"email": "savio.gama@qitech.com.br",
"document_number": "43141581827",
"created_at": "2023-05-18 00:02:49"
}
]
}
]
},
{
"related_party_key": "e19d038e-5c60-47db-aa44-d4d948592705",
"name": "Turing",
"role": "guarantor",
"signature_status": "signed",
"signature_position": "1",
"created_at": "2023-05-18 00:02:49",
"auto_signature": 0,
"notify_to": [],
"signer_groups": [
{
"expiration": null,
"minimum_required_signers": 1,
"signable_limit": null,
"signature_status": "signed",
"created_at": "2023-05-18 00:02:49",
"signers": [
{
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:09:44",
"signature_status": "signed",
"name": "Turing",
"is_group_mandatory": true,
"email": "teste@gmail.com",
"document_number": "56072386105",
"created_at": "2023-05-18 00:02:49"
}
]
}
]
}
],
"documents": [
{
"document_key": "40c0940a-3db5-489b-86d6-ebf2717e0a9c",
"control_number": "9f907aef-04b5-4adb-9f4e-e2c53293c4d7",
"file_size": 1669,
"file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.p7s",
"name": "teste_of.pdf",
"original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
"status": "signed",
"signed_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.pdf",
"created_at": "2023-05-18 00:02:49",
"signatures": [
{
"signer": {
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"name": "Savio",
"is_group_mandatory": true,
"email": "savio.gama@qitech.com.br",
"document_number": "43141581827",
"created_at": "2023-05-18 00:02:49"
},
"signed_hash": "ldp+t2F5MpgLtA++sIaFxEKXxsVJGnXeco2+cN7v3KSlsvxIwm2xMwQ4JjE8Mm3s93swB0dYBb5m/BBmCuRhzRsopQtVVRgRkdhKSwa5JBWVIgEd7gsb/CMIQqmG4wZLM9XZNUrx60LwfrdAnyjDEg8/JBdoeks3whOeQ1eai04dZyBAHkd6yplnFvi89PhEjLNU93C2CqyjCaSVr5HviLQovlpTxmiPYfRR+cqzlljbYLMqat2LXvjaW2T6AvtYWQRmL3HJ5GmDQytjNXsHBOQFKQ+Nyu+KnEnxg2ofqmNXlhID78YaGFpmZVLT9aLeFflJIFazaHWq6wPq8M5Hqg==",
"signature_timestamp": "2023-05-18 00:06:08",
"signature_status": "signed",
"role": "assignor",
"created_at": "2023-05-18 00:06:13"
},
{
"signer": {
"signer_control_number": "1",
"signature_timestamp": "2023-05-18 00:09:44",
"signature_status": "signed",
"name": "Turing",
"is_group_mandatory": true,
"email": "teste@gmail.com",
"document_number": "56072386105",
"created_at": "2023-05-18 00:02:49"
},
"signed_hash": "Djc8YDrgdrHdhpyfP6rmp/6HIPfA1NdzSU3gov1A0PbhrJhW1toOOGZ5VHCM82EHT77fB5G7gmJSIaufU9+Mz9o3pzWqY3GRQe3g9vqO01ejonIf1HOEpkx5Q/9bB23L/OlnzGfrQ2JCzsuExpTzkmG65zKMzNdHFdmz3PtdpssTl3kQNIG00piKxHE5GiRC67uYcZyFDWQbHEeNSczrCodIlKVCtfc7V8dzsfIr+4u6vtkQYhj6GTRYIxcJjgtYJfHnMlgsQUstl0Vyt3tQzfkAq021HmvlMtf/N3WZRZGThLTb1NczEEVnD/AXllQvW08mtOHQKBnVkxB8xQikEw==",
"signature_timestamp": "2023-05-18 00:09:44",
"signature_status": "signed",
"role": "guarantor",
"created_at": "2023-05-18 00:09:45"
}
]
}
]
}
],
"watcher_clients": []
}