Endpoints
| Méthode | Endpoint |
|---|
POST | /api/v1/number-lookups |
GET | /api/v1/number-lookups |
GET | /api/v1/number-lookups/{id} |
POST | /api/v1/number-lookups/{id}/import-contacts |
Règles
instanceId est obligatoire
- moins de
1000 numéros : traitement synchrone
1000 numéros ou plus : traitement asynchrone
- seuls les numéros trouvés sur WhatsApp peuvent être importés en contacts
Lancer une vérification
curl -X POST https://srv.msgflash.com/api/v1/number-lookups \
-H "x-api-key: msgf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"instanceId": "INSTANCE_UUID",
"numbers": ["+41791234567", "+81476222311"]
}'
Réponse synchrone
{
"data": {
"mode": "sync",
"lookupId": "lookup_uuid",
"status": "done",
"requested": 2,
"normalized": 2,
"checked": 2,
"onWhatsAppCount": 1,
"notOnWhatsAppCount": 1,
"invalidCount": 0,
"result": {
"onWhatsApp": [],
"notOnWhatsApp": [],
"invalid": []
}
}
}
Réponse asynchrone
{
"data": {
"mode": "async",
"lookupId": "lookup_uuid",
"status": "pending",
"requested": 1250,
"message": "Lookup in progress. Check status later."
}
}
Lire le statut
curl https://srv.msgflash.com/api/v1/number-lookups/LOOKUP_ID \
-H "x-api-key: msgf_live_your_api_key_here"
curl -X POST https://srv.msgflash.com/api/v1/number-lookups/LOOKUP_ID/import-contacts \
-H "x-api-key: msgf_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"tag": "verified-whatsapp"
}'
La vérification dépend toujours d’une instance connectée de votre compte.