Eventos

Entenda os eventos que são enviados por webhooks

A ZapSign envia os seguintes eventos por webhook:

  • doc_created (enviado quando um documento é criado)

  • doc_signed (enviado quando algum signatário assina o documento)

  • doc_deleted (enviado quando um documento é deletado, via plataforma ou via API)

Você poderá diferenciar um do outro pelo atributo "event_type" que seguirá junto de todo webhook.

"event_type": "doc_created"

Abaixo seguem exemplos:

doc_created (exemplo)

{
"event_type": "doc_created",
"sandbox": false,
"external_id": "id-suaaplicacao-e32213ds-243",
"open_id": 23,
"token": "cce11abf-abcd-abcd-a657-25b55f185f16",
"name": "sample.pdf",
"folder_path": "/",
"status": "pending",
"lang": "pt-br",
"original_file": "https://zapsign.s3.amazonaws.com/c11c4f2c11c4f2/c11c4f2/c11c4f25-79c7-4eea-8dcf-5434996a4251.pdf",
"signed_file": null,
"created_through": "web",
"deleted": false,
"deleted_at": null,
"signed_file_only_finished": false,
"disable_signer_emails": false,
"brand_logo": "",
"brand_primary_color": "",
"created_at": "2021-06-07T19:21:59.609067Z",
"last_update_at": "2021-06-07T19:21:59.609094Z",
"signers": [
{
"external_id": "",
"token": "b14f141f-aaaa-425e-8dfa-0bdac0ec806a",
"status": "new",
"name": "[email protected]",
"lock_name": false,
"email": "[email protected]",
"lock_email": false,
"phone_country": "55",
"phone_number": "",
"lock_phone": false,
"times_viewed": 0,
"last_view_at": null,
"signed_at": null,
"auth_mode": "assinaturaTela",
"qualification": "",
"require_selfie_photo": false,
"require_document_photo": false,
"geo_latitude": null,
"geo_longitude": null
}
]
}

doc_signed (exemplo)

{
"event_type": "doc_signed",
"sandbox": false,
"external_id": "id-suaaplicacao-e32213ds-243",
"open_id": 23,
"token": "cce11abf-abcd-abcd-a657-25b55f185f16",
"name": "sample.pdf",
"folder_path": "/",
"status": "signed", //caso nem todos assinaram, continuará como "pending"
"lang": "pt-br",
"original_file": "https://zapsign.s3.amazonaws.com/asddasdasdasads08e1-48f5-8972-7b4e476dec9d/c11c4f25-79c7-4eea-8dcf-5434996a4251.pdf",
"signed_file": "https://zapsign.s3.amazonaws.com/saddas1d5as16d5asads-2b89-460e-8c30-1644fbe8f249/a5bf7fe0-05d0-4d09-bbeb-0beaa91abc56.pdf",
"created_through": "web",
"deleted": false,
"deleted_at": null,
"signed_file_only_finished": false,
"disable_signer_emails": false,
"brand_logo": "",
"brand_primary_color": "",
"created_at": "2021-06-07T19:21:59.609067Z",
"last_update_at": "2021-06-07T19:22:21.838310Z",
"signers": [
{
"external_id": "",
"token": "b14f141f-abcd-abcd-8dfa-0bdac0ec806a",
"status": "signed",
"name": "Fulano Silva",
"lock_name": false,
"email": "[email protected]",
"lock_email": false,
"phone_country": "55",
"phone_number": "1155551111",
"lock_phone": false,
"times_viewed": 1,
"last_view_at": "2021-06-07T19:22:12.875967Z",
"signed_at": "2021-06-07T19:22:19.956056Z",
"auth_mode": "assinaturaTela",
"qualification": "",
"require_selfie_photo": false,
"require_document_photo": false,
"geo_latitude": "-23.559298",
"geo_longitude": "-46.683343"
}
],
"signer_who_signed": { //objeto que trás quem assinou o documento.
"external_id": "",
"token": "b14f141f-abcd-abcd-8dfa-0bdac0ec806a",
"status": "signed",
"name": "Fulano Silva",
"lock_name": false,
"email": "[email protected]",
"lock_email": false,
"phone_country": "55",
"phone_number": "1155551111",
"lock_phone": false,
"times_viewed": 1,
"last_view_at": "2021-06-07T19:22:12.875967Z",
"signed_at": "2021-06-07T19:22:19.956056Z",
"auth_mode": "assinaturaTela",
"qualification": "",
"require_selfie_photo": false,
"require_document_photo": false,
"geo_latitude": "-23.559298",
"geo_longitude": "-46.683343"
}
}

doc_deleted (exemplo)

{
"event_type": "doc_deleted",
"sandbox": false,
"external_id": "id-suaaplicacao-e32213ds-243",
"open_id": 23,
"token": "cce11abf-abcd-abcd-a657-25b55f185f16",
"name": "sample.pdf",
"folder_path": "/",
"status": "signed",
"lang": "pt-br",
"original_file": "https://zapsign.s3.amazonaws.com/asddasdasdasads08e1-48f5-8972-7b4e476dec9d/c11c4f25-79c7-4eea-8dcf-5434996a4251.pdf",
"signed_file": "https://zapsign.s3.amazonaws.com/saddas1d5as16d5asads-2b89-460e-8c30-1644fbe8f249/a5bf7fe0-05d0-4d09-bbeb-0beaa91abc56.pdf",
"created_through": "web",
"deleted": true, // deleted: true significa que o documento foi excluído
"deleted_at": "2021-06-07T19:22:33.932981Z", // data e horário do delete
"signed_file_only_finished": false,
"disable_signer_emails": false,
"brand_logo": "",
"brand_primary_color": "",
"created_at": "2021-06-07T19:21:59.609067Z",
"last_update_at": "2021-06-07T19:22:21.838310Z",
"signers": [
{
"external_id": "",
"token": "b14f141f-abcd-abcd-8dfa-0bdac0ec806a",
"status": "signed",
"name": "Fulano Silva",
"lock_name": false,
"email": "[email protected]",
"lock_email": false,
"phone_country": "55",
"phone_number": "1155551111",
"lock_phone": false,
"times_viewed": 1,
"last_view_at": "2021-06-07T19:22:12.875967Z",
"signed_at": "2021-06-07T19:22:19.956056Z",
"auth_mode": "assinaturaTela",
"qualification": "",
"require_selfie_photo": false,
"require_document_photo": false,
"geo_latitude": "-23.559298",
"geo_longitude": "-46.683343"
}
]
}