SourceAfis API
API REST pour l'enrôlement, la vérification (1:1) et l'identification (1:N) d'empreintes digitales.
URL de base : /api
Tester avec Swagger
- Ouvrez /swagger.
- Les endpoints
enroll,verifyetidentifyacceptentmultipart/form-dataavec un champ fichierImage. - Les endpoints citoyens utilisent du
application/json.
Citoyens
Créer un citoyen
POST /api/citizens — application/json
{
"firstName": "Jean",
"lastName": "Dupont",
"phone": "+33600000000"
}
Réponse 201 : { id, firstName, lastName, phone, createdAt }
Lister les citoyens
GET /api/citizens
Réponse 200 : tableau de citoyens.
Détail d'un citoyen
GET /api/citizens/{id}
Réponse 200 : détail du citoyen · 404 si introuvable.
EnrĂ´ler une empreinte
POST /api/fingerprints/enroll — multipart/form-data
| Champ | Type | Description |
|---|---|---|
| CitizenId | long | Identifiant du citoyen |
| FingerName | string | Ex. RightThumb, LeftIndex |
| Image | fichier | PNG, JPEG, BMP ou TIFF |
Si une empreinte existe déjà pour le même citoyen et le même doigt, elle est remplacée par la nouvelle capture.
Réponse 200 :
{
"fingerprintId": 1,
"citizenId": 1,
"fingerName": "RightThumb",
"imagePath": "/uploads/fingerprints/xxx.png"
}
Vérifier une empreinte (1:1)
POST /api/fingerprints/verify — multipart/form-data
| Champ | Type | Description |
|---|---|---|
| FingerprintId | long | Empreinte enregistrée à comparer |
| Image | fichier | Nouvelle capture |
Réponse 200 :
{
"isMatch": true,
"score": 52.3,
"threshold": 40,
"citizenId": 1,
"fingerprintId": 1,
"citizenName": "Jean Dupont",
"matchCategory": "Match"
}
Identifier une empreinte (1:N)
POST /api/fingerprints/identify — multipart/form-data
| Champ | Type | Description |
|---|---|---|
| Image | fichier | Empreinte Ă identifier (obligatoire) |
| Threshold | double | Seuil de correspondance (défaut : 40) |
Réponse 200 : les 10 meilleurs candidats (même structure que verify), triés par score décroissant.
Empreintes d'un citoyen
GET /api/fingerprints/citizen/{citizenId}
Réponse 200 : liste des empreintes enregistrées pour ce citoyen.
Règles de score
| Score | Résultat | matchCategory |
|---|---|---|
| ≥ 40 | MATCH | Match |
| 25 – 39 | SUSPECT — validation humaine | Suspect |
| < 25 | NON MATCH | NoMatch |
Récapitulatif des endpoints
| Méthode | Route | Format | Description |
|---|---|---|---|
| POST | /api/citizens | JSON | Créer un citoyen |
| GET | /api/citizens | — | Lister les citoyens |
| GET | /api/citizens/{id} | — | Détail citoyen |
| POST | /api/fingerprints/enroll | multipart | EnrĂ´ler une empreinte |
| POST | /api/fingerprints/verify | multipart | Vérification 1:1 |
| POST | /api/fingerprints/identify | multipart | Identification 1:N |
| GET | /api/fingerprints/citizen/{id} | — | Empreintes d'un citoyen |
Erreurs
Format : { "error": "message" }
- 400 — image manquante, format invalide
- 404 — citoyen ou empreinte introuvable