⬅ Accueil

PRCA — API

Base locale: https://prca-api.prca-demo-mapp.workers.dev. CORS activé. Retour JSON.

GET /api/license

Informations licence & mentions légales.

curl https://prca-api.prca-demo-mapp.workers.dev/api/license

GET /api/reco/metrics

KPI agrégés : ménages enrôlés, montants distribués, packages appliqués.

curl https://prca-api.prca-demo-mapp.workers.dev/api/reco/metrics

POST /api/reco/register-entity

Enrôle un ménage (registre social unifié). Exemple :

curl -X POST https://prca-api.prca-demo-mapp.workers.dev/api/reco/register-entity ^
  -H "Content-Type: application/json" ^
  -d "{"phone": "+261340000099", "head_name": "Test Demo",
       "members":[{"full_name":"Test Demo","age":28,"sex":"F"}],
       "location":{"fokontany":"Ankorondrano","lat":-18.90,"lon":47.52}}"

GET /api/reco/check-vulnerability/:householdId

Calcule le score de vulnérabilité & recommandations d’aide.

curl https://prca-api.prca-demo-mapp.workers.dev/api/reco/check-vulnerability/{householdId}

POST /api/reco/apply-cash-transfer

Versement cash via mobile money (simulé).

curl -X POST https://prca-api.prca-demo-mapp.workers.dev/api/reco/apply-cash-transfer ^
  -H "Content-Type: application/json" ^
  -d "{"householdId":"{ID}","provider":"mvola","amount":60000}"

Éléments de langage (prêts à l’emploi)