Recupere la selfie capturada durante un proceso de Human Token.
Devuelve la selfie biométrica capturada por el usuario durante un proceso de Human Token. La imagen se devuelve como una cadena codificada en base64.
Disponible para cualquier proceso finalizado que haya ejecutado una captura biométrica — los cinco flujos de Human Token (api+humantoken, api+liveness+humantoken, api+liveness+humantoken+revalidation, humantoken, humantoken+revalidation). No disponible cuando el proceso finalizó sin captura biométrica, ya que no hay selfie para devolver.
La selfie está disponible durante 24 horas después de que el proceso finalice. Después de ese tiempo, la imagen se elimina permanentemente y este endpoint devuelve 404.
Endpoint
| Entorno | URL |
|---|---|
| Producción | GET https://humantoken.unico.app/client/v1/process/{processId}/selfie |
Solicitud
| Header | Valor |
|---|---|
x-unico-accesskey | <your_access_key> (ver Autenticación) |
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
processId | string (UUID) | sí | Identificador del proceso devuelto por Crear Proceso. |
Ejemplo
- cURL
- Node.js
curl -X GET https://humantoken.unico.app/client/v1/process/$PROCESS_ID/selfie \
-H "x-unico-accesskey: $UNICO_ACCESS_KEY"
import fetch from 'node-fetch';
const res = await fetch(
`https://humantoken.unico.app/client/v1/process/${processId}/selfie`,
{ headers: { 'x-unico-accesskey': process.env.UNICO_ACCESS_KEY } }
);
const { fileContents, contentType } = await res.json();
// fileContents is a base64-encoded image string
Respuestas
{
"fileContents": "/9j/4AAQSkZJR...",
"contentType": "image/jpeg"
}
| Campo | Tipo | Descripción |
|---|---|---|
fileContents | string (base64) | La selfie capturada, codificada en base64. |
contentType | string | Tipo MIME de la imagen — image/jpeg o image/png. |
Códigos de Error
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
El parámetro de ruta processId falta o tiene un formato incorrecto.
Clave de acceso ausente o inválida en el header x-unico-accesskey. Ver Autenticación.
Permisos insuficientes para acceder a la selfie de este proceso.
Proceso no encontrado, el proceso finalizó sin captura biométrica, o la ventana de retención de 24 horas ha expirado.
Rate limit reached. When your system receives an HTTP 429 error, you must implement mechanisms to prevent cascading failures and avoid worsening the restriction.
Best practices:
- Cool-down period (backoff): Immediately halt or throttle subsequent requests from your system. Do not continuously retry failed requests in a tight loop.
- Queueing & throttling: Buffer or queue outgoing requests on your end to control the traffic flow before re-sending them.
- Exponential backoff with jitter: When retrying, increase the waiting time exponentially between attempts (e.g., 1 s, 2 s, 4 s, 8 s) and add a small random delay ("jitter") to prevent a herd effect where all queued requests retry at the exact same millisecond.
Continuously hitting a rate-limited endpoint without backing off can prolong the restriction period and severely impact your system's operational throughput. Properly throttling requests on your side ensures a smoother, more resilient integration.
For default limits, increase requests and additional details, see Rate Limits.
Qué sigue
- Para el resultado completo del proceso, consulta Obtener Proceso.
- Vuelve a Crear Proceso para enviar una nueva selfie.