Saltar al contenido principal

Inicio rápido

Esta guía recorre la vida completa de un documento en MobbSign Server: tu backend lo sube, el firmante lo firma en el navegador con el Web SDK y tu backend descarga el PDF firmado. Necesitas curl, tu API_KEY y tu APP_ID, y un PDF.

Cómo funciona​

Tu backendIntegradorWeb SDKNavegadorMobbSign ServerAPIPREPARACIÓN01 Sube el documento y sus firmantesPOST /documents02 documentIdFIRMA03 documentId04 Carga y firmaload(documentId)05 Cambio de estadowebhookRESULTADO06 Descarga el PDF firmadoGET /documents/{id}/content
01
PreparaciónTu backend MobbSign ServerSube el documento y sus firmantesPOST /documents
01 / 06
FiguraTu backend gestiona el documento; el Web SDK captura la firma en el navegador.

1. Sube el documento​

Envía el PDF, codificado en base64, con su título, el tipo de firma y sus firmantes:

curl -X POST 'https://mobbsign.mobbeel.com/api/v1/documents' \
-H 'API_KEY: YOUR_API_KEY' \
-H 'APP_ID: YOUR_APP_ID' \
-H 'Content-Type: application/json' \
-d '{
"title": "Service contract",
"content": "'"$(base64 -w0 contract.pdf)"'",
"signatureType": "HANDWRITTEN",
"signers": [
{"name": "Jane Doe", "rol": "Client",
"signaturePosition": {"x": 360, "y": 120, "width": 180, "height": 70, "numPage": 1}}
]
}'

La respuesta contiene el documentId y el identificador de cada firmante:

{
"documentId": "6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5",
"title": "Service contract",
"signatureType": "HANDWRITTEN",
"status": "PENDING",
"signers": [{"id": "4438", "name": "Jane Doe", "rol": "Client", "status": "PENDING"}]
}

2. Fírmalo en el navegador​

Pasa el documentId a tu página web y cárgalo en el Web SDK:

new MobbSign(options).then((mobbsign) => mobbsign.load(documentId));

El firmante lee el documento, lo firma y pulsa Finalizar.

3. Sigue el estado​

Consulta el documento para conocer su estado (PENDING, IN_PROGRESS, SIGNED…):

curl 'https://mobbsign.mobbeel.com/api/v1/documents/6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5' \
-H 'API_KEY: YOUR_API_KEY' \
-H 'APP_ID: YOUR_APP_ID'

En lugar de consultarlo periódicamente, registra un webhook para recibir una notificación de cada cambio.

4. Descarga el documento firmado​

curl 'https://mobbsign.mobbeel.com/api/v1/documents/6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5/content' \
-H 'API_KEY: YOUR_API_KEY' \
-H 'APP_ID: YOUR_APP_ID' \
| jq -r .content | base64 -d > contract-signed.pdf

Abre contract-signed.pdf en cualquier lector de PDF: su panel de firmas muestra la firma electrónica y confirma que el documento no se ha modificado.

Siguiente paso​

Conoce el ciclo de vida de un documento, los tipos de firma y los webhooks en la Guía de integración.