Skip to content

Client API

Base URL : http://localhost:9081/api/v1

Serveurs

Liste des serveurs

http
GET /api/v1/servers

Réponse :

json
[
  {
    "id": 1,
    "name": "BNP Paribas",
    "host": "pesitwizard.bnpparibas.com",
    "port": 5000,
    "serverId": "BNPP_SERVER",
    "clientId": "MON_ENTREPRISE",
    "tlsEnabled": true,
    "status": "CONNECTED"
  }
]

Créer un serveur

http
POST /api/v1/servers
Content-Type: application/json

{
  "name": "BNP Paribas",
  "host": "pesitwizard.bnpparibas.com",
  "port": 5000,
  "serverId": "BNPP_SERVER",
  "clientId": "MON_ENTREPRISE",
  "password": "secret123",
  "tlsEnabled": true
}

Modifier un serveur

http
PUT /api/v1/servers/{id}
Content-Type: application/json

{
  "name": "BNP Paribas Production",
  "password": "newpassword"
}

Supprimer un serveur

http
DELETE /api/v1/servers/{id}

Tester la connexion

http
POST /api/v1/servers/{id}/test

Réponse :

json
{
  "success": true,
  "latency": 45,
  "serverVersion": 2,
  "message": "Connection successful"
}

Transferts

Envoyer un fichier

http
POST /api/v1/transfers/send
Content-Type: application/json

file: (binary)
serverId: 1
remoteFilename: VIREMENT_20250110.XML
partnerId: MON_ENTREPRISE
virtualFile: VIREMENTS

Réponse :

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "COMPLETED",
  "direction": "SEND",
  "filename": "VIREMENT_20250110.XML",
  "size": 15234,
  "startTime": "2025-01-10T10:30:00Z",
  "endTime": "2025-01-10T10:30:05Z",
  "duration": 5000
}

Recevoir un fichier

http
POST /api/v1/transfers/receive
Content-Type: application/json

{
  "serverId": 1,
  "remoteFilename": "RELEVE_20250110.XML",
  "partnerId": "MON_ENTREPRISE",
  "virtualFile": "RELEVES"
}

Réponse :

json
{
  "id": "550e8400-e29b-41d4-a716-446655440001",
  "status": "COMPLETED",
  "direction": "RECEIVE",
  "filename": "RELEVE_20250110.XML",
  "localPath": "/data/received/RELEVE_20250110.XML",
  "size": 8542
}

Télécharger un fichier reçu

http
GET /api/v1/transfers/{id}

Retourne le fichier binaire avec les headers appropriés.

Liste des transferts

http
GET /api/v1/transfers/history?page=0&size=20

Query parameters :

ParamètreTypeDescription
pageintNuméro de page (0-indexed)
sizeintTaille de page (défaut: 20)
sortstringTri (ex: startTime,desc)
statusstringFiltrer par statut
directionstringSEND ou RECEIVE
serverIdintFiltrer par serveur
fromdateDate de début
todateDate de fin

Réponse :

json
{
  "content": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "COMPLETED",
      "direction": "SEND",
      "filename": "VIREMENT_20250110.XML",
      "serverName": "BNP Paribas",
      "size": 15234,
      "startTime": "2025-01-10T10:30:00Z"
    }
  ],
  "totalElements": 150,
  "totalPages": 8,
  "number": 0,
  "size": 20
}

Détail d'un transfert

http
GET /api/v1/transfers/{id}

Rejouer un transfert

http
POST /api/v1/transfers/{id}/replay

Statistiques

http
GET /api/v1/transfers/stats

Statuts de transfert

StatutDescription
PENDINGEn attente
IN_PROGRESSEn cours
COMPLETEDTerminé avec succès
FAILEDÉchec
CANCELLEDAnnulé

Codes d'erreur

CodeDescription
SERVER_NOT_FOUNDServeur non trouvé
CONNECTION_FAILEDConnexion impossible
AUTH_FAILEDAuthentification échouée
PARTNER_UNKNOWNPartenaire non reconnu
FILE_NOT_FOUNDFichier non trouvé
TRANSFER_FAILEDÉchec du transfert
TIMEOUTDélai dépassé

PeSIT Wizard - Solution PeSIT moderne pour les entreprises