Authentification API
L'API B2B utilise une authentification par clé API.
En-tête requis
Chaque requête doit inclure :
X-Api-Key: votre-cle-api
Exemple
- cURL
- PowerShell
- Python
curl -X GET "https://api.macartememembre.com/b2b/v1/employe" \
-H "X-Api-Key: votre-cle-api" \
-H "Accept: application/json"
$headers = @{
"X-Api-Key" = "votre-cle-api"
"Accept" = "application/json"
}
Invoke-RestMethod -Uri "https://api.macartememembre.com/b2b/v1/employe" `
-Headers $headers
import requests
headers = {
"X-Api-Key": "votre-cle-api",
"Accept": "application/json"
}
response = requests.get(
"https://api.macartememembre.com/b2b/v1/employe",
headers=headers
)
data = response.json()
Erreurs d'authentification
401 Unauthorized
La clé API est manquante ou invalide.
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Unauthorized",
"status": 401,
"detail": "Clé API invalide"
}
403 Forbidden
La clé API est valide mais n'a pas accès à cette ressource.
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.3",
"title": "Forbidden",
"status": 403,
"detail": "Accès refusé à cette ressource"
}
Obtenir une clé API
Contactez l'équipe MCM pour obtenir votre clé API. Vous devrez fournir :
- Nom de votre organisation
- Cas d'utilisation prévu
- Contact technique
- Environnement souhaité (production/staging)