# Integración de BCC Services

## Introducción

BCC Services es un componente de software utilizado para captura biométrica. BCC Services se usa para recopilar imágenes biométricas, pero no las envía automáticamente al servidor. Puede ver cómo enviar una captura al GBDS en la sección [Registro en el GBDS](#cadastro-no-gbds).

{% hint style="warning" %}
BCC Services no guarda los datos biométricos recopilados y solo los mantiene en la RAM mientras esté activo. Reiniciar o apagar la computadora o cerrar BCC Services resultará en la pérdida de las colecciones.
{% endhint %}

Este manual describe el flujo de trabajo y la solución de problemas estándar de captura biométrica de BCC Services. Consulte la [especificación de la API de BCC Services](/apis/bcc-services.md) para obtener más información sobre las llamadas de API.

Este manual está actualizado para la versión 2.8.8 de BCC Services.

## Flujo de Captura

Esta sección describirá el flujo de captura y las opciones de capturas biométricas que puede realizar con BCC Services. Un ejemplo de las llamadas y respuestas del endpoint puede verse en el [Ejemplo de Flujo de Captura](#exemplo-de-fluxo-de-captura)

Para iniciar una captura, necesita llamar a uno de los endpoints de captura biométrica. Estos son:

* [Captura de Iris](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-irises)
* [Captura de Palmar](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-palm)
* [Captura de Firma](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-signature)
* [Captura de Huella Dactilar](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-fingerprint)
* [Captura Palmar de Recién Nacido](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-baby-palm)
* [Captura de Rostro](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-face)
* [Captura de Imagen Auxiliar](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-auxiliary-image)
* [Captura de Perfil Completo](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-profile)

Estas capturas pueden devolver una de dos respuestas:

* **200**, para OK
* **400**, para ERROR

El estado **200** tendrá un campo `tguid` que debe guardar. Cada llamada de Captura Biométrica tendrá su ID único, independiente de cuántas capturas se realicen en la misma llamada. es decir, puede realizar la llamada [Captura de Huella Dactilar](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-fingerprint) para recopilar los diez dedos, generando un tguid para todas las capturas, o usando el mismo endpoint diez veces, generando un tguid para cada huella dactilar.

La captura biométrica genera una ventana de captura. Para obtener el estado de captura, ejecute la [llamada de estado](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture-status). Este endpoint devolverá el estado de captura, la información del sensor y una información parcial de qué biometrías están capturadas.

Debe realizar la llamada de `estado` hasta que el valor del campo `estado` sea `captured`. Esto indicará que la captura fue completada. Otros estados pueden verse si la captura está incompleta, como `capturing` si la ventana de captura aún está abierta o `closed` si la ventana de captura se ha cerrado sin completar la captura.

Al obtener el estado `captured`, necesita ejecutar la llamada de [getProfile](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture). La respuesta de esta llamada contiene las imágenes `.wsq` y `.jpeg`. Estas están en el campo `buffer` y `convertido-buffer`, respectivamente, como bytearrays en formato base64.

Tras la finalización de una captura, recomendamos guardar las imágenes en una base de datos local hasta enviarlas al servidor.

{% hint style="danger" %}
BCC Services guarda la captura en la RAM. Salir de BCC Services, apagar o reiniciar la computadora sin persistir los datos de la transacción resultará en pérdida de datos.
{% endhint %}

Después de que todas las capturas necesarias se hayan realizado, reinicie los servicios BCC usando la llamada [restartBcc](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#delete-bcc-capture-restart).

{% hint style="warning" %}
Reiniciar BCC Services limpiará todos los datos de transacciones en la RAM. Asegúrese de que sus datos estén guardados antes de reiniciar BCC Services.
{% endhint %}

La llamada `restartBcc` cerrará BCC Services y lo reabrirá automáticamente. Para asegurar que el software esté en ejecución después del reinicio, ejecute la llamada [serviceStatus](https://gitbook.griaule.com/apis/bcc-services/bcc-service-status#get-bcc-running) y verifique si el valor del campo `serverState` es `running`.

### Reabrir ventana de captura incompleta

Si el usuario cerró la ventana de captura sin finalizar la captura, la [llamada de estado](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture-status) devolverá el valor del `estado` como `closed`. Puede continuar una captura interrumpida con la llamada [openCapture](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture-open) pasando el `tguid` proporcionado por la llamada de captura biométrica. Esto mantendrá el progreso de la captura.

### Recuperando TGUID

Si perdió un TGUID por cualquier motivo, podrá recuperar el TGUID usando la llamada [listCaptureInstances](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture-instances). Dentro del array de `instances`, puede encontrar todas las capturas biométricas realizadas mientras BCC Services estaba activo (si el historial de transacciones no fue limpiado). Listará en el orden de ejecución, la primera será la primera Captura Biométrica llamada y la última será la última Captura Biométrica llamada. Un ejemplo de respuesta se muestra a continuación.

```json
{
	"result": "OK",
	"instances": [
		{
			"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77",
			"type": "FINGERPRINT"
		},
		{
			"tguid": "DD08CEAA-B508-421D-8484-717DF01C0C55",
			"type": "SIGNATURE"
		},
		{
			"tguid": "EB321A10-F2B2-46DB-9479-8A6E5A1A485D",
			"type": "PROFILE"
		}
	]
}
```

## Solución de Problemas

BCC Services tiene algunas llamadas para solución de problemas que puede hacer para asegurarse de que las cosas estén funcionando correctamente. Por ejemplo, si sus equipos están siendo identificados y si la versión del software es conocida por usted y por el equipo de soporte que puede ayudarlo con su problema. Estas llamadas se presentan a continuación.

### Versión

Verificar la versión del software es esencial para el escenario de solución de problemas. Para verificar la versión de BCC Services, ejecute la [llamada de versión](https://gitbook.griaule.com/apis/bcc-services/bcc-service-status).

### Ejecución

Para verificar si el programa está ejecutándose, use la [llamada de serviceStatus](https://gitbook.griaule.com/apis/bcc-services/bcc-service-status#get-bcc-running) y observe el valor del campo `serverState`.

### Dispositivos

BCC Services ofrece una opción para mostrar todos los dispositivos que están conectados a él. Para mostrar la lista de dispositivos, ejecute la llamada [deviceStatus](https://gitbook.griaule.com/apis/bcc-services/bcc-service-status#get-bcc-status-devices).

## Apagado

Para apagar BCC Services, llame a [finishService](https://gitbook.griaule.com/apis/bcc-services/bcc-service-status#get-bcc-bye)

## Ejemplo de Flujo de Captura

En este ejemplo, describiremos cómo realizar las llamadas para un registro de una captura rodada de todos los dedos de la mano izquierda.

Primero, ejecute la [Llamada de Captura de Huella Dactilar](https://gitbook.griaule.com/apis/bcc-services/biometric-capture#post-bcc-capture-fingerprint) con la siguiente query:

{% hint style="info" %}
El campo `captureMode` no afecta el comportamiento de la captura de BCC Services. Este campo se utiliza para identificar la operación en el BCC.
{% endhint %}

```json
{
	"captureMode": "REGISTER",
	"notifyUrl": "",
	"theme": "DARK",
	"captureType": "ROLLED",
	"type": "FINGERPRINT",
	"sequenceControlType": "NONE",
	"indexes": [
		{
			"index": "LEFT_LITTLE"
		},
		{
			"index": "LEFT_RING"
		},
		{
			"index": "LEFT_MIDDLE"
		},
		{
			"index": "LEFT_INDEX"
		},
		{
			"index": "LEFT_THUMB"
		}
	],
	"exceptionSetType": "SIMPLIFIED",
	"functions": [
		{
			"type": "RESET",
			"enabled": true
		},
		{
			"type": "CONFIG",
			"enabled": true
		},
		{
			"type": "CLEAR",
			"enabled": true
		},
		{
			"type": "CAPTURE",
			"enabled": true
		},
		{
			"type": "CANCEL",
			"enabled": true
		},
		{
			"type": "CAPTURE_NEW_IMAGE",
			"enabled": true
		},
		{
			"type": "IMAGE_PREVIEW",
			"enabled": true
		},
		{
			"type": "NEXT",
			"enabled": true
		},
		{
			"type": "OK",
			"enabled": true
		},
		{
			"type": "UPDATE_IMAGE",
			"enabled": true
		},
		{
			"type": "REMOVE_IMAGE",
			"enabled": true
		},
		{
			"type": "LIVE",
			"enabled": true
		},
		{
			"type": "ACQUIRE",
			"enabled": true
		},
		{
			"type": "SAVE",
			"enabled": true
		},
		{
			"type": "IMPORT",
			"enabled": true
		}
	]
}
```

Si la pantalla se abre con éxito, recibirá este JSON:

```json
{
	"result": "OK",
	"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77"
}
```

Copie este TGUID y comience a llamar a [estado](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture-status). hasta recibir el estado `captured`.

{% hint style="warning" %}
Recuerde que otros estados, como `closed`, también pueden devolversi el operador no completa la captura.
{% endhint %}

Si ningún dedo fue capturado, la respuesta debe ser:

```json
{
	"result": "OK",
	"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77",
	"type": "FINGERPRINT",
	"status": "CAPTURING",
	"operation": "INIT",
	"command": "INIT",
	"profile": {},
	"profileMetadata": {
		"profileVersion": "GBS BCC profile v2.8.7",
		"appName": "GBS BCC",
		"macAddress": [
			"08-62-66-80-D5-5C",
			"42-E2-30-11-DB-15",
			"42-E2-30-11-D3-15",
			"08-62-66-80-D4-94",
			"40-E2-30-13-F7-8A",
			"40-E2-30-11-D3-15"
		],
		"softwareStatus": {
			"vendor": "Griaule Biometrics Ltda.",
			"version": "2.8.7.10805",
			"name": "GBS BCC Service"
		},
		"fingerprintPluggedDevices": [],
		"fingerprintStartedDevices": [],
		"faceDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"bodyDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"signatureDevice": {
			"serialNumber": "N/A"
		},
		"irisDevice": "IRITECH",
		"fields": [],
		"fingerprints": [],
		"palms": [],
		"bodyImages": []
	},
	"windowInfo": {
		"x": 683.0,
		"y": 237.0,
		"width": 685.0,
		"height": 579.0,
		"state": "NORMAL"
	}
}
```

Si algunos dedos fueron capturados, pero la captura no fue finalizada, el `estado` responderá con la información de captura parcial, como se muestra:

```json
{
	"result": "OK",
	"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77",
	"type": "FINGERPRINT",
	"status": "CAPTURING",
	"operation": "INIT",
	"command": "INIT",
	"profileMetadata": {
		"profileVersion": "GBS BCC profile v2.8.7",
		"appName": "GBS BCC",
		"macAddress": [
			"08-62-66-80-D5-5C",
			"42-E2-30-11-DB-15",
			"42-E2-30-11-D3-15",
			"08-62-66-80-D4-94",
			"40-E2-30-13-F7-8A",
			"40-E2-30-11-D3-15"
		],
		"softwareStatus": {
			"vendor": "Griaule Biometrics Ltda.",
			"version": "2.8.7.10805",
			"name": "GBS BCC Service"
		},
		"fingerprintPluggedDevices": [],
		"fingerprintStartedDevices": [],
		"faceDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"bodyDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"signatureDevice": {
			"serialNumber": "N/A"
		},
		"irisDevice": "IRITECH",
		"fields": [],
		"fingerprints": [
			{
				"index": "LEFT_LITTLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left little",
				"image": {
					"resolution": 500
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 96
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 72,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_RING",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left ring",
				"image": {
					"resolution": 500
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 66,
				"captured": false,
				"extracted": true
			}
		],
		"palms": [],
		"bodyImages": []
	},
	"windowInfo": {
		"x": 683.0,
		"y": 237.0,
		"width": 685.0,
		"height": 579.0,
		"state": "NORMAL"
	}
}
```

Tras el fin de la captura, el campo de `estado` cambiará a `captured` y la llamada de `estado` responderá con:

{% hint style="warning" %}
Los valores `BYTEARRAY` son cadenas en formato base64.
{% endhint %}

```json
{
	"result": "OK",
	"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77",
	"type": "FINGERPRINT",
	"status": "CAPTURED",
	"operation": "INIT",
	"command": "NONE",
	"profileMetadata": {
		"profileVersion": "GBS BCC profile v2.8.7",
		"appName": "GBS BCC",
		"macAddress": [
			"08-62-66-80-D5-5C",
			"42-E2-30-11-DB-15",
			"42-E2-30-11-D3-15",
			"08-62-66-80-D4-94",
			"40-E2-30-13-F7-8A",
			"40-E2-30-11-D3-15"
		],
		"softwareStatus": {
			"vendor": "Griaule Biometrics Ltda.",
			"version": "2.8.7.10805",
			"name": "GBS BCC Service"
		},
		"fingerprintPluggedDevices": [],
		"fingerprintStartedDevices": [],
		"faceDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"bodyDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"signatureDevice": {
			"serialNumber": "N/A"
		},
		"irisDevice": "IRITECH",
		"fields": [],
		"fingerprints": [
			{
				"index": "LEFT_LITTLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left little",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 96
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 72,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_RING",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left ring",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 66,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_MIDDLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left middle",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 76,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_INDEX",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left index",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 71,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_THUMB",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left thumb",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 70,
				"captured": false,
				"extracted": true
			}
		],
		"palms": [],
		"bodyImages": []
	},
	"windowInfo": {
		"x": 683.0,
		"y": 237.0,
		"width": 1000.0,
		"height": 579.0,
		"state": "NORMAL"
	}
}
```

{% hint style="info" %}
Después de una transacción completa, la llamada de estado responde con las imágenes `.jpeg`.
{% endhint %}

Ahora es hora de realizar la llamada [getProfile](https://gitbook.griaule.com/apis/bcc-services/capture-instance-status#get-bcc-capture). Esta llamada responderá con las imágenes en imágenes `.wsq` y `.jpeg`. El campo `buffer` contiene las imágenes `.wsq` mientras que el campo `converted-buffer` contiene las imágenes `.jpeg`.

```json
{
	"result": "OK",
	"tguid": "F1F14ADA-6A00-4A67-B887-F574764ECC77",
	"type": "FINGERPRINT",
	"status": "CAPTURED",
	"operation": "INIT",
	"command": "NONE",
	"profile": {
		"fingerprints": [
			{
				"index": "LEFT_LITTLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left little",
				"image": {
					"buffer": "BYTEARRAY",
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"buffer": "BYTEARRAY",
					"quality": 96
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 72,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_RING",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left ring",
				"image": {
					"buffer": "BYTEARRAY",
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"buffer": "BYTEARRAY",
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 66,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_MIDDLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left middle",
				"image": {
					"buffer": "BYTEARRAY",
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"buffer": "BYTEARRAY",
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 76,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_INDEX",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left index",
				"image": {
					"buffer": "BYTEARRAY",
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"buffer": "BYTEARRAY",
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 71,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_THUMB",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left thumb",
				"image": {
					"buffer": "BYTEARRAY",
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"buffer": "BYTEARRAY",
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 70,
				"captured": false,
				"extracted": true
			}
		]
	},
	"profileMetadata": {
		"profileVersion": "GBS BCC profile v2.8.7",
		"appName": "GBS BCC",
		"macAddress": [
			"08-62-66-80-D5-5C",
			"42-E2-30-11-DB-15",
			"42-E2-30-11-D3-15",
			"08-62-66-80-D4-94",
			"40-E2-30-13-F7-8A",
			"40-E2-30-11-D3-15"
		],
		"softwareStatus": {
			"vendor": "Griaule Biometrics Ltda.",
			"version": "2.8.7.10805",
			"name": "GBS BCC Service"
		},
		"fingerprintPluggedDevices": [],
		"fingerprintStartedDevices": [],
		"faceDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"bodyDevice": {
			"productName": "OBS Virtual Camera",
			"serialNumber": "N/A",
			"firmwareVersion": "N/A"
		},
		"signatureDevice": {
			"serialNumber": "N/A"
		},
		"irisDevice": "IRITECH",
		"fields": [],
		"fingerprints": [
			{
				"index": "LEFT_LITTLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left little",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 96
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 72,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_RING",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left ring",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 66,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_MIDDLE",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left middle",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 98
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 76,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_INDEX",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left index",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 71,
				"captured": false,
				"extracted": true
			},
			{
				"index": "LEFT_THUMB",
				"type": "ROLLED",
				"typeIndexKey": "ROLLED-left thumb",
				"image": {
					"resolution": 500,
					"converted-buffer": "BYTEARRAY"
				},
				"height": 480,
				"width": 320,
				"template": {
					"quality": 100
				},
				"captureType": "FLAT",
				"nfiq": 1,
				"contrast": 70,
				"captured": false,
				"extracted": true
			}
		],
		"palms": [],
		"bodyImages": []
	},
	"windowInfo": {
		"x": 683.0,
		"y": 237.0,
		"width": 685.0,
		"height": 579.0,
		"state": "NORMAL"
	}
}
```

Después de la captura, puede enviar las imágenes al servidor. Para entender cómo registrar la biometría capturada en el GBDS, vaya a la siguiente sección.

### Registro en el GBDS

Llame al [endpoint de enroll](https://gitbook.griaule.com/apis/gbds-4/people#post-people) si desea registrar las imágenes capturadas anteriormente en el GBDS.

En el payload necesita insertar la información de las claves (keys) y biográficos (biographics). Dentro del array `biometric`, necesitará insertar los datos del endpoint `getCapture` de BCC Services.

El valor del campo `buffer` BCC Services necesita ser colocado en el valor del campo `content` en el payload del JSON para el GBDS.

{% hint style="info" %}
Para obtener más información sobre operaciones en el GBDS, consulte el Manual de Integración del GBDS.
{% endhint %}

El payload de ejemplo para realizar el registro se muestra a continuación:

```json
{
	"meta": {
		"priority": "DEFAULT_PRIORITY",
		"timeout": "-1"
	},
	"data": {
		"keys": [
			{
				"id": "CPF",
				"value": "618.323.606-44"
			}
		],
		"biographics": [
			{
				"id": "name",
				"value": "John Doe"
			}
		],
		"biometric": [
			{
				"source": "ORIGINAL",
				"type": "FINGERPRINT",
				"format": "WSQ",
				"properties": {
					"width": 0,
					"height": 0,
					"resolution": 500,
					"ratio": 0.0,
					"matcherId": 0,
					"extractorId": 0
				},
				"index": 0,
				"content": "BYTEARRAY"
			},
			{
				"source": "ORIGINAL",
				"type": "FINGERPRINT",
				"format": "WSQ",
				"properties": {
					"width": 0,
					"height": 0,
					"resolution": 500,
					"ratio": 0.0,
					"matcherId": 0,
					"extractorId": 0
				},
				"index": 1,
				"content": "BYTEARRAY"
			},
			{
				"source": "ORIGINAL",
				"type": "FINGERPRINT",
				"format": "WSQ",
				"properties": {
					"width": 0,
					"height": 0,
					"resolution": 500,
					"ratio": 0.0,
					"matcherId": 0,
					"extractorId": 0
				},
				"index": 2,
				"content": "BYTEARRAY"
			},
			{
				"source": "ORIGINAL",
				"type": "FINGERPRINT",
				"format": "WSQ",
				"properties": {
					"width": 0,
					"height": 0,
					"resolution": 500,
					"ratio": 0.0,
					"matcherId": 0,
					"extractorId": 0
				},
				"index": 3,
				"content": "BYTEARRAY"
			},
			{
				"source": "ORIGINAL",
				"type": "FINGERPRINT",
				"format": "WSQ",
				"properties": {
					"width": 0,
					"height": 0,
					"resolution": 500,
					"ratio": 0.0,
					"matcherId": 0,
					"extractorId": 0
				},
				"index": 4,
				"content": "BYTEARRAY"
			}
		]
	}
}
```

### Anotación de anomalía en la captura

Para que una anomalía en la captura de la huella dactilar sea registrada, el metadato de la transacción debe incluir el objeto `fingerprints`. Este objeto debe contener los índices de los dedos y sus respectivas anomalías.

**Ejemplo**:

```json
"fingerprints": [
    {
        "index": "LEFT_LITTLE",
        "anomaly": "AMPUTATED"
    }
]
```

**Los índices son ENUMs:**

* `LEFT_LITTLE`
* `LEFT_RING`
* `LEFT_MIDDLE`
* `LEFT_INDEX`
* `LEFT_THUMB`
* `RIGHT_THUMB`
* `RIGHT_INDEX`
* `RIGHT_MIDDLE`
* `RIGHT_RING`
* `RIGHT_LITTLE`

**Los tipos de anomalías son:**

* `DAMAGED`
* `BANDAGED`
* `IGNORED`
* `AMPUTATED`

El **metadato** debe ser añadido al *enroll* en formato base64, de la siguiente manera:

{% code fullWidth="false" %}

```json
"data": {
    "keys": [
		...
    ],
    "biographics": [
    	...
    ],
    "labels": [
        ...
    ],
    "metadata": "ewoJInByb2ZpbGVWZXJzaW9uIjogIkdCRFMgcHJvZmlsZSIsCgkiYXBwTmFtZSI6ICJHQkRTIiwKCSJmaW5nZXJwcmludHMiOiBbCgkJewoJCQkiaW5kZXgiOiAiTEVGVF9MSVRUTEUiLAoJCQkidHlwZSI6ICJST0xMRUQiLAoJCQkidHlwZUluZGV4S2V5IjogIlJPTExFRC1MRUZUX0xJVFRMRSIsCgkJCSJjYXB0dXJlVHlwZSI6ICJST0xMRUQiLAoJCQkiYW5vbWFseSI6ICJEQU1BR0VEIiwKCQkJIm5maXEiOiAwLAoJCQkiY29udHJhc3QiOiAwLAoJCQkiY2FwdHVyZWQiOiBmYWxzZSwKCQkJImV4dHJhY3RlZCI6IGZhbHNlCgkJfSwKCQl7CgkJCSJpbmRleCI6ICJMRUZUX1JJTkciLAoJCQkidHlwZSI6ICJST0xMRUQiLAoJCQkidHlwZUluZGV4S2V5IjogIlJPTExFRC1MRUZUX1JJTkciLAoJCQkiY2FwdHVyZVR5cGUiOiAiUk9MTEVEIiwKCQkJImFub21hbHkiOiAiQkFOREFHRUQiLAoJCQkibmZpcSI6IDAsCgkJCSJjb250cmFzdCI6IDAsCgkJCSJjYXB0dXJlZCI6IGZhbHNlLAoJCQkiZXh0cmFjdGVkIjogZmFsc2UKCQl9LAoJCXsKCQkJImluZGV4IjogIkxFRlRfTUlERExFIiwKCQkJInR5cGUiOiAiUk9MTEVEIiwKCQkJInR5cGVJbmRleEtleSI6ICJST0xMRUQtTEVGVF9NSURETEUiLAoJCQkiY2FwdHVyZVR5cGUiOiAiUk9MTEVEIiwKCQkJImFub21hbHkiOiAiSUdOT1JFRCIsCgkJCSJuZmlxIjogMCwKCQkJImNvbnRyYXN0IjogMCwKCQkJImNhcHR1cmVkIjogZmFsc2UsCgkJCSJleHRyYWN0ZWQiOiBmYWxzZQoJCX0sCgkJewoJCQkiaW5kZXgiOiAiTEVGVF9JTkRFWCIsCgkJCSJ0eXBlIjogIlJPTExFRCIsCgkJCSJ0eXBlSW5kZXhLZXkiOiAiUk9MTEVELUxFRlRfSU5ERVgiLAoJCQkiY2FwdHVyZVR5cGUiOiAiUk9MTEVEIiwKCQkJImFub21hbHkiOiAiQU1QVVRBVEVEIiwKCQkJIm5maXEiOiAwLAoJCQkiY29udHJhc3QiOiAwLAoJCQkiY2FwdHVyZWQiOiBmYWxzZSwKCQkJImV4dHJhY3RlZCI6IGZhbHNlCgkJfQogICAgXQp9",
    "biometric": [
		...
    ]
}
```

{% endcode %}

El campo `"metadata"`, representado en base64 en el ejemplo anterior, corresponde al siguiente JSON:

{% hint style="info" %}
El JSON debe contener al menos el campo “*fingerprints*” y dentro de cada ítem como mínimo los campos "index" y "anomaly".
{% endhint %}

```json
{
    "profileVersion": "GBDS profile",
    "appName": "GBDS",
    "fingerprints": [
        {
            "index": "LEFT_LITTLE",
            "type": "ROLLED",
            "typeIndexKey": "ROLLED-LEFT_LITTLE",
            "captureType": "ROLLED",
            "anomaly": "DAMAGED",
            "nfiq": 0,
            "contrast": 0,
            "captured": false,
            "extracted": false
        },
        {
            "index": "LEFT_RING",
            "type": "ROLLED",
            "typeIndexKey": "ROLLED-LEFT_RING",
            "captureType": "ROLLED",
            "anomaly": "BANDAGED",
            "nfiq": 0,
            "contrast": 0,
            "captured": false,
            "extracted": false
        },
        {
            "index": "LEFT_MIDDLE",
            "type": "ROLLED",
            "typeIndexKey": "ROLLED-LEFT_MIDDLE",
            "captureType": "ROLLED",
            "anomaly": "IGNORED",
            "nfiq": 0,
            "contrast": 0,
            "captured": false,
            "extracted": false
        },
        {
            "index": "LEFT_INDEX",
            "type": "ROLLED",
            "typeIndexKey": "ROLLED-LEFT_INDEX",
            "captureType": "ROLLED",
            "anomaly": "AMPUTATED",
            "nfiq": 0,
            "contrast": 0,
            "captured": false,
            "extracted": false
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.griaule.com/gbs/es/integracion-de-gbds/bccservicesintegration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
