### POST /webhook_test Request Example Source: https://sistema.firmaweb.app/Api Example JSON body for simulating a webhook reception. ```json { "IdProceso": 95, "IdDocumento": 87, "Estado": 1 } ``` -------------------------------- ### POST /notificar_movil Request Example Source: https://sistema.firmaweb.app/Api Example JSON body for sending a mobile notification to a signer. ```json { "idProceso": 95, "Email": "correo@empresa.cl" } ``` -------------------------------- ### POST /agregar_firmante Request Source: https://sistema.firmaweb.app/Api Example request body for adding a signer to a process. ```json { "idProceso": 95, "idGrupo": 96, "nombre": "Juan", "apellidoPaterno": "Pérez", "apellidoMaterno": "González", "rut": "11111111-1", "email": "correo@empresa.cl", "tipoFirma": 2 } ``` -------------------------------- ### POST /descargar_documento Request Source: https://sistema.firmaweb.app/Api Example request body to download a signed document by its ID. ```json { "idDocumento": 87 } ``` -------------------------------- ### POST /agregar_documento Request Source: https://sistema.firmaweb.app/Api Example request body for adding a PDF document encoded in Base64 to a process. ```json { "idProceso": 95, "idGrupo": 96, "nombre": "Contrato arrendamiento.pdf", "documento": "JVBERi0xLjQKJcfs... (Base64)" } ``` -------------------------------- ### Iniciar proceso: Petición y respuestas Source: https://sistema.firmaweb.app/Api Ejemplo de cuerpo de petición para activar un proceso de firma y las respuestas correspondientes, incluyendo la generación de URLs para firmantes. ```json { "idProceso": 95, "urlCorrecto": "https://miapp.cl/firma/correcto", "urlCancelado": "https://miapp.cl/firma/cancelado", "urlNotifica": "https://miapp.cl/webhook/firmaweb", "horasCaduca": 48 } ``` ```json { "Estado": 1, "Mensaje": "Proceso iniciado", "Firmantes": [ { "Email": "correo1@empresa.cl", "Url": "https://sistema.firmaweb.app/logint/74/d7AsL012/1", "Notificado": "NO" } ] } ``` ```json { "Estado": 95, "Mensaje": "Proceso sin documentos" } ``` -------------------------------- ### POST /webhook_test Source: https://sistema.firmaweb.app/Api Endpoint de prueba para simular la recepción de webhooks. FirmaWeb enviará un POST a tu urlNotifica cada vez que un documento sea firmado o rechazado. Sin autenticación. ```APIDOC ## POST /webhook_test ### Description Endpoint de prueba para simular la recepción de webhooks. FirmaWeb enviará un POST a tu urlNotifica cada vez que un documento sea firmado o rechazado. Usa este endpoint para validar tu implementación antes de ir a producción. ### Method POST ### Endpoint /webhook_test ### Authentication Sin autenticación ### Parameters #### Request Body - **IdProceso** (integer) - Requerido - ID del proceso. - **IdDocumento** (integer) - Requerido - ID del documento. - **Estado** (integer) - Requerido - Estado del documento. 1 = Firmado, 2 = Rechazado. ### Request Example { "IdProceso": 95, "IdDocumento": 87, "Estado": 1 } ### Response #### Success Response (200) Webhook recibido correctamente. ``` -------------------------------- ### POST /crear_proceso Source: https://sistema.firmaweb.app/Api Creates the main container that will group documents and signers. Returns IdProceso and IdGrupo needed in subsequent steps. ```APIDOC ## POST /crear_proceso ### Description Creates the main container that will group documents and signers. Returns IdProceso and IdGrupo needed in subsequent steps. ### Method POST ### Endpoint /crear_proceso ### Request Body - **nombre** (string, max 100) - Required - Descriptive name of the process. - **notificar** (integer) - Required - Send emails to signers. 1 = Yes, 2 = No. - **etiqueta** (string, max 15) - Optional - Label to classify the process. - **geolocalizar** (integer) - Optional - Request geolocation when signing. 1 = Yes, 0 = No. - **hojaFinal** (integer) - Required - Add final sheet with signatures and QR. 1 = Yes, 0 = No. ### Request Example ``` { "nombre": "Contrato de servicios", "notificar": 2, "etiqueta": "VENTAS2024", "geolocalizar": 0, "hojaFinal": 1 } ``` ### Response #### Success Response (200) - **IdProceso** (integer) - Process ID. - **IdGrupo** (integer) - Group ID. - **Estado** (integer) - Status code (1 = success).". - **Mensaje** (string) - Message. #### Response Example (200) ``` n{ "IdProceso": 95, "IdGrupo": 96, "Estado": 1, "Mensaje": "Proceso creado" n} ``` #### Warning Response (200) - **Estado** (integer) - Status code (97 = no signatures available). n- **Mensaje** (string) - Message. #### Response Example (200 Warning) ``` n{ "Estado": 97, "Mensaje": "No tiene firmas disponibles" n} ``` ``` -------------------------------- ### Crear proceso: Petición y respuestas Source: https://sistema.firmaweb.app/Api Ejemplo de cuerpo de petición para crear un proceso de firma y las posibles respuestas de éxito o advertencia por falta de saldo. ```json { "nombre": "Contrato de servicios", "notificar": 2, "etiqueta": "VENTAS2024", "geolocalizar": 0, "hojaFinal": 1 } ``` ```json { "IdProceso": 95, "IdGrupo": 96, "Estado": 1, "Mensaje": "Proceso creado" } ``` ```json { "Estado": 97, "Mensaje": "No tiene firmas disponibles" } ``` -------------------------------- ### POST /descargar_documento Source: https://sistema.firmaweb.app/Api Descarga el PDF firmado codificado en Base64. Disponible durante 20 días desde la fecha de firma. Pasado ese período el documento no estará disponible para descarga. ```APIDOC ## POST /descargar_documento ### Description Descarga el PDF firmado codificado en Base64. Disponible durante 20 días desde la fecha de firma. Pasado ese período el documento no estará disponible para descarga. ### Method POST ### Endpoint /descargar_documento ### Parameters #### Request Body - **idDocumento** (integer) - Requerido - ID del documento firmado a descargar. ### Request Example { "idDocumento": 87 } ### Response #### Success Response (200) - **Estado** (integer) - Código de estado (1 = éxito). - **Mensaje** (string) - Mensaje descriptivo. - **Documento** (string) - PDF codificado en Base64. #### Response Example { "Estado": 1, "Mensaje": "Correcto", "Documento": "JVBERi0xLjQKJcfs... (Base64)" } #### Warning Response (200) - **Estado** (integer) - Código de estado (96 = documento no apto para descarga). - **Mensaje** (string) - Mensaje descriptivo. #### Warning Response Example { "Estado": 96, "Mensaje": "Documento no apto para descarga" } #### Error Response (401) - **Mensaje** (string) - Token inválido o expirado. ### Authentication Requiere Bearer Token ``` -------------------------------- ### POST /agregar_documento Warning Response Source: https://sistema.firmaweb.app/Api Response indicating the process was not found. ```json { "Estado": 97, "Mensaje": "Proceso no encontrado" } ``` -------------------------------- ### POST /consultar_saldos Source: https://sistema.firmaweb.app/Api Retorna la cantidad de firmas FES (Firma Simple) y FAO (Firma Avanzada) disponibles para el cliente. No requiere cuerpo en la petición. ```APIDOC ## POST /consultar_saldos ### Description Retorna la cantidad de firmas FES (Firma Simple) y FAO (Firma Avanzada) disponibles para el cliente. No requiere cuerpo en la petición. ### Method POST ### Endpoint /consultar_saldos ### Parameters No requiere cuerpo en la petición. ### Response #### Success Response (200) - **fes_disponibles** (integer) - Cantidad de firmas FES disponibles. - **fao_disponibles** (integer) - Cantidad de firmas FAO disponibles. - **Estado** (integer) - Código de estado (1 = éxito). n- **Mensaje** (string) - Mensaje descriptivo. #### Response Example { "fes_disponibles": 350, "fao_disponibles": 100, "Estado": 1, "Mensaje": "Correcto" n} #### Error Response (401) - **Mensaje** (string) - Token inválido o expirado. ### Authentication Requiere Bearer Token ``` -------------------------------- ### POST /iniciar_proceso Source: https://sistema.firmaweb.app/Api Activates the signing flow: generates unique temporary URLs for each signer and, if notificar=1, sends automatic emails. Requires at least one document and one signer. ```APIDOC ## POST /iniciar_proceso ### Description Activates the signing flow: generates unique temporary URLs for each signer and, if notificar=1, sends automatic emails. Requires at least one document and one signer. ### Method POST ### Endpoint /iniciar_proceso ### Request Body - **idProceso** (integer) - Required - ID of the process to start. - **urlCorrecto** (string, max 250) - Required - Redirect URL upon successful signing. - **urlCancelado** (string, max 250) - Required - Redirect URL when signer cancels. - **urlNotifica** (string, max 250) - Required - Endpoint of your server that will receive webhook notifications. - **horasCaduca** (integer) - Optional - Validity of signing link in hours (1-360). Default: 48. ### Request Example ``` { "idProceso": 95, "urlCorrecto": "https://miapp.cl/firma/correcto", "urlCancelado": "https://miapp.cl/firma/cancelado", "urlNotifica": "https://miapp.cl/webhook/firmaweb", "horasCaduca": 48 } ``` ### Response #### Success Response (200) - **Estado** (integer) - Status code (1 = success). - **Mensaje** (string) - Message. - **Firmantes** (array) - List of signers with email, URL, and notification status. #### Response Example (200) ``` { "Estado": 1, "Mensaje": "Proceso iniciado", "Firmantes": [ { "Email": "correo1@empresa.cl", "Url": "https://sistema.firmaweb.app/logint/74/d7AsL012/1", "Notificado": "NO" } ] } ``` #### Warning Response (200) - **Estado** (integer) - Status code (95 = process without documents). - **Mensaje** (string) - Message. #### Response Example (200 Warning) ``` { "Estado": 95, "Mensaje": "Proceso sin documentos" } ``` ``` -------------------------------- ### POST /agregar_documento Source: https://sistema.firmaweb.app/Api Agrega un documento PDF codificado en Base64 al proceso. Retorna el IdDocumento para referenciarlo en la descarga. Se pueden agregar múltiples documentos por proceso. ```APIDOC ## POST /agregar_documento ### Description Agrega un documento PDF codificado en Base64 al proceso. Retorna el IdDocumento para referenciarlo en la descarga. Se pueden agregar múltiples documentos por proceso. ### Method POST ### Endpoint /agregar_documento ### Parameters #### Request Body - **idProceso** (integer) - Requerido - ID del proceso. - **idGrupo** (integer) - Requerido - ID del grupo del proceso. - **nombre** (string ≤150) - Requerido - Nombre del archivo con extensión `.pdf`. - **documento** (string) - Requerido - Contenido del PDF codificado en Base64. ### Request Example { "idProceso": 95, "idGrupo": 96, "nombre": "Contrato arrendamiento.pdf", "documento": "JVBERi0xLjQKJcfs... (Base64)" } ### Response #### Success Response (200) - **IdDocumento** (integer) - ID del documento cargado. - **Estado** (integer) - Código de estado (1 = éxito). - **Mensaje** (string) - Mensaje descriptivo. #### Response Example { "IdDocumento": 87, "Estado": 1, "Mensaje": "Documento cargado" } #### Warning Response (200) - **Estado** (integer) - Código de estado (97 = proceso no encontrado). - **Mensaje** (string) - Mensaje descriptivo. #### Warning Response Example { "Estado": 97, "Mensaje": "Proceso no encontrado" } #### Error Response (401) - **Mensaje** (string) - Token inválido o expirado. ### Authentication Requiere Bearer Token ``` -------------------------------- ### POST /consultar_saldos Response Source: https://sistema.firmaweb.app/Api Response showing the available FES and FAO signature balances. ```json { "fes_disponibles": 350, "fao_disponibles": 100, "Estado": 1, "Mensaje": "Correcto" } ``` -------------------------------- ### POST /descargar_documento Warning Response Source: https://sistema.firmaweb.app/Api Response indicating the document is not available for download. ```json { "Estado": 96, "Mensaje": "Documento no apto para descarga" } ``` -------------------------------- ### Autenticación: Respuestas del API Source: https://sistema.firmaweb.app/Api Ejemplos de respuestas JSON para intentos de autenticación exitosos, credenciales inválidas y límites de intentos excedidos. ```json { "Estado": 1, "Mensaje": "Correcto", "Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "Token_tipo": "Bearer", "Expira_en": 1696526915 } ``` ```json { "Estado": 93, "Mensaje": "No autorizado" } ``` ```json { "Estado": 429, "Mensaje": "Demasiados intentos. Intente nuevamente más tarde." } ``` -------------------------------- ### POST /notificar_movil Source: https://sistema.firmaweb.app/Api Envía una notificación push al firmante mediante la APP móvil de FirmaWeb. Requiere autenticación Bearer Token. ```APIDOC ## POST /notificar_movil ### Description Envía una notificación push al firmante mediante la APP móvil de FirmaWeb. Útil cuando el firmante tiene la app instalada y prefiere firmar desde su dispositivo móvil. ### Method POST ### Endpoint /notificar_movil ### Authentication Requiere Bearer Token ### Parameters #### Request Body - **idProceso** (integer) - Requerido - ID del proceso. - **Email** (string) - Requerido - Correo del firmante registrado en el proceso. ### Request Example { "idProceso": 95, "Email": "correo@empresa.cl" } ### Response #### Success Response (200) - **Estado** (integer) - Descripción: 1 = Notificado, 97 = Proceso no encontrado. - **Mensaje** (string) - Descripción: Mensaje descriptivo. #### Response Example { "Estado": 1, "Mensaje": "Notificado" } #### Warning Response (200) { "Estado": 97, "Mensaje": "Proceso no encontrado" } #### Error Response (401) Token inválido o expirado. ``` -------------------------------- ### POST /descargar_documento Success Response Source: https://sistema.firmaweb.app/Api Successful response containing the signed PDF encoded in Base64. ```json { "Estado": 1, "Mensaje": "Correcto", "Documento": "JVBERi0xLjQKJcfs... (Base64)" } ``` -------------------------------- ### POST /token Source: https://sistema.firmaweb.app/Api Authenticates the API client with Base64-encoded credentials (usuario:clave) and returns a JWT Bearer Token valid for 15 minutes. This token is required for all protected requests. ```APIDOC ## POST /token ### Description Authenticates the API client with credentials encoded in Base64 (usuario:clave). Returns a JWT Bearer Token valid for 15 minutes, required in all protected requests. ### Method POST ### Endpoint /token ### Headers - **Authorization** (string) - Required - Credentials in format `Bearer base64(usuario:clave)`. - **Content-Type** (string) - Required - Content type of the request. ### Request Example ``` Authorization: Bearer dXN1YXJpbzpwYXNzd29yZA== Content-Type: application/json ``` ### Response #### Success Response (200) - **Estado** (integer) - Status code (1 = success). - **Mensaje** (string) - Message. - **Token** (string) - JWT token. - **Token_tipo** (string) - Token type (Bearer). - **Expira_en** (integer) - Expiration timestamp. #### Response Example (200) ``` { "Estado": 1, "Mensaje": "Correcto", "Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "Token_tipo": "Bearer", "Expira_en": 1696526915 } ``` #### Error Response (401) - **Estado** (integer) - Status code (93 = invalid credentials). - **Mensaje** (string) - Error message. #### Response Example (401) ``` { "Estado": 93, "Mensaje": "No autorizado" } ``` #### Error Response (429) - **Estado** (integer) - Status code (429 = too many attempts). - **Mensaje** (string) - Error message. #### Response Example (429) ``` { "Estado": 429, "Mensaje": "Demasiados intentos. Intente nuevamente más tarde." } ``` ``` -------------------------------- ### Autenticación: Encabezados HTTP Source: https://sistema.firmaweb.app/Api Ejemplo de encabezados requeridos para autenticar al cliente API utilizando credenciales en formato Base64. ```http Authorization: Bearer dXN1YXJpbzpwYXNzd29yZA== Content-Type: application/json ``` -------------------------------- ### POST /agregar_firmante Source: https://sistema.firmaweb.app/Api Agrega un firmante al proceso y lo asocia a todos los documentos pendientes del grupo. El campo tipoFirma determina el tipo de saldo que se consumirá (FES o FAO). ```APIDOC ## POST /agregar_firmante ### Description Agrega un firmante al proceso y lo asocia a todos los documentos pendientes del grupo. El campo tipoFirma determina el tipo de saldo que se consumirá (FES o FAO). ### Method POST ### Endpoint /agregar_firmante ### Parameters #### Request Body - **idProceso** (integer) - Requerido - ID del proceso. - **idGrupo** (integer) - Requerido - ID del grupo del proceso. - **nombre** (string ≤100) - Requerido - Nombre del firmante. - **apellidoPaterno** (string ≤60) - Requerido - Apellido paterno del firmante. - **apellidoMaterno** (string ≤60) - Opcional - Apellido materno (opcional). - **rut** (string) - Requerido - RUT del firmante en formato `11111111-1`. - **email** (string) - Requerido - Correo electrónico del firmante. - **tipoFirma** (integer) - Requerido - Tipo de firma. `1` = Firma Avanzada (FAO) | `2` = Firma Simple (FES). - **paginaFirma** (integer) - Opcional - Página donde se imprimirá la firma (cuando `hojaFinal=0`). - **firmaPosX** (integer) - Opcional - Posición X de la firma en la página. - **firmaPosY** (integer) - Opcional - Posición Y de la firma en la página. ### Request Example { "idProceso": 95, "idGrupo": 96, "nombre": "Juan", "apellidoPaterno": "Pérez", "apellidoMaterno": "González", "rut": "11111111-1", "email": "correo@empresa.cl", "tipoFirma": 2 } ### Response #### Success Response (200) - **Estado** (integer) - Código de estado (1 = éxito). - **Mensaje** (string) - Mensaje descriptivo. #### Response Example { "Estado": 1, "Mensaje": "Firmante creado" } #### Warning Response (200) - **Estado** (integer) - Código de estado (97 = proceso no encontrado). - **Mensaje** (string) - Mensaje descriptivo. #### Warning Response Example { "Estado": 97, "Mensaje": "Proceso no encontrado" n} #### Error Response (401) - **Mensaje** (string) - Token inválido o expirado. ### Authentication Requiere Bearer Token ``` -------------------------------- ### POST /token Source: https://sistema.firmaweb.app/Api Authenticates with client credentials encoded in Base64 and returns a short-lived JWT Bearer Token. The token is valid for 15 minutes and must be used in the Authorization header for subsequent requests. ```APIDOC ## POST /token ### Description Authenticates with client credentials and returns a JWT Bearer Token for accessing the FirmaWeb API. ### Method POST ### Endpoint /token ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token containing base64(usuario:clave) ### Request Example No request body required. ### Response #### Success Response (200) - **token** (string) - JWT Bearer Token, valid for 15 minutes. #### Response Example { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ### Error Handling - **429 Too Many Requests** - Rate limit exceeded (5 attempts per minute per IP/user). Retry after the time specified in the `Retry-After` header. ``` -------------------------------- ### POST /agregar_documento Success Response Source: https://sistema.firmaweb.app/Api Successful response indicating the document was uploaded and providing the IdDocumento. ```json { "IdDocumento": 87, "Estado": 1, "Mensaje": "Documento cargado" } ``` -------------------------------- ### POST /agregar_firmante Success Response Source: https://sistema.firmaweb.app/Api Successful response indicating the signer was created. ```json { "Estado": 1, "Mensaje": "Firmante creado" } ``` -------------------------------- ### POST /notificar_movil Success Response Source: https://sistema.firmaweb.app/Api Response returned when the notification is sent successfully. ```json { "Estado": 1, "Mensaje": "Notificado" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.