PortalFirma

api-integration · Document

Documentos

Envío a firma, consulta por proceso, operación o teléfono, listados por fecha y reenvíos.

POST{URL}/document/sendToSign

Envía un PDF (base64) a firma con firmantes y coordenadas.

Body
{
  signatories: [
    {
      signatory: {
        rut: string,
        name: string,
        paternalLastName: string,
        maternalLastName: string,
        address: string,
        district: string,
        email: string,
        phone: string
      },
      signature: {
        xCoordinate: number,
        yCoordinate: number,
        pageNumber: number,
        type: number,
        alias: string
      }
    }
  ],
  document: base64,
  withProtocolization: boolean
}
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: {
    processId: uuid,
    createdDateAt: timestamp
  },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
GET{URL}/document/getByProcessId/:processId

Detalle de proceso por UUID.

  • Ya no se retorna `document` (base64). Usa `files.signed` u otros archivos por `id`.
  • `files.signed` corresponde al documento firmado (antes `url` en el contrato).
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: {
    processId: uuid,
    operation: number,
    signatories: [
      {
        id: uuid,
        rut: string,
        name: string,
        paternalLastName: string,
        maternalLastName: string,
        address: string,
        districtId: string,
        email: string,
        phone: string,
        signed: boolean,
        url: string
      }
    ],
    protocolizationNumber: string,
    repertoireNumber: string,
    files: {
      attachment1: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      attachment2: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      attachment3: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      legalized: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      original: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      signed: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      }
    },
    status: number,
    createdDateAt: timestamp,
    updatedDateAt: timestamp
  },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
GET{URL}/document/getByOperation/:operation

Detalle de proceso por número de operación.

  • Misma forma de respuesta que `getByProcessId`.
  • `:operation` es el número de operación (string), no un UUID.
  • Ya no se retorna `document` (base64). Usa `files.signed` u otros archivos por `id`.
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: {
    processId: uuid,
    operation: number,
    signatories: [
      {
        id: uuid,
        rut: string,
        name: string,
        paternalLastName: string,
        maternalLastName: string,
        address: string,
        districtId: string,
        email: string,
        phone: string,
        signed: boolean,
        url: string
      }
    ],
    protocolizationNumber: string,
    repertoireNumber: string,
    files: {
      attachment1: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      attachment2: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      attachment3: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      legalized: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      original: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      },
      signed: {
        id: uuid,
        name: string,
        summary: [
          {
            id: uuid,
            summary: string,
            type: "long" | "short"
          }
        ]
      }
    },
    status: number,
    createdDateAt: timestamp,
    updatedDateAt: timestamp
  },
  error: null
}
Error
{
  success: false,
  data: null,
  error: "El numero de Operación no existe"
}
GET{URL}/document/getAll/:startDate/:endDate

Lista documentos del customer en un rango de fechas.

  • Fechas en formato aceptado por el pipe de la API (YYYY-MM-DD).
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: [ /* documentos */ ],
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
POST{URL}/document/getOperationsByPhone

Busca operaciones por teléfono de firmante en un rango de fechas.

  • El teléfono se normaliza a dígitos (se ignoran espacios, `+` y guiones).
  • `startDate` y `endDate` son ISO (`YYYY-MM-DD`). El rango no puede superar 366 días.
  • `limit` es obligatorio, entre 1 y 100. `totalInRange` es el total del rango; `operations` viene recortado por `limit`.
Body
{
  phone: string,
  startDate: "YYYY-MM-DD",
  endDate: "YYYY-MM-DD",
  limit: number
}
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: {
    phone: string,
    startDate: "YYYY-MM-DD",
    endDate: "YYYY-MM-DD",
    limit: number,
    totalInRange: number,
    operations: [
      {
        contract_id: uuid,
        operation: number,
        contractSignatoryId: uuid,
        signed: boolean,
        stage: string,
        document_name: string,
        createdDateAt: timestamp,
        updatedDateAt: timestamp
      }
    ]
  },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
POST{URL}/document/resendToSign

Reenvía notificaciones de firma del proceso.

Body
{
  processId: uuid
}
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: { /* resultado */ },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
POST{URL}/document/resendSignatoryToSign

Reenvía a un firmante específico.

Body
{
  processId: uuid,
  signatoryId: uuid
}
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: { /* resultado */ },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}
POST{URL}/document/changeSignatureType

Cambia tipo de firma del firmante (1 | 2 | 3).

Body
{
  processId: uuid,
  signatoryId: uuid,
  signatureType: 1 | 2 | 3
}
Headers
id
{api-key}
Auth
Bearer
{token}

Response

Success
{
  success: true,
  data: { /* resultado */ },
  error: null
}
Error
{
  success: false,
  data: null,
  error: <error description>
}