Passer au contenu principal
POST
/
whatsapp
/
contacts
/
list
Lister les contacts
curl --request POST \
  --url https://api.wachap.com/v1/whatsapp/contacts/list \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>"
}
'

Endpoint

/v1/whatsapp/contacts/list

Headers

Authorization
string
requis
Bearer token avec votre Secret Key (format: Bearer sk_...)

Body Parameters

accountId
string
requis
L’identifiant du compte WhatsApp

Exemples de requêtes

curl -X POST https://api.wachap.com/v1/whatsapp/contacts/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer VOTRE_CLE_SECRETE" \
  -d '{
    "accountId": "account_xxx"
  }'

Exemple de réponse

{
  "success": true,
  "total": 150,
  "message": "150 contact(s) trouvé(s)",
  "contacts": [
    {
      "jid": "[email protected]",
      "phoneNumber": "22962861571",
      "name": "John Doe",
      "businessName": "John's Business"
    },
    {
      "jid": "[email protected]",
      "phoneNumber": "33612345678",
      "name": "Marie Dupont"
    }
  ]
}

Codes d’erreur

CodeDescription
400MISSING_ACCOUNT_ID - accountId manquant
401INVALID_SECRET_KEY - Clé secrète invalide
404ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corps

application/json
accountId
string

Réponse

200

OK