Passer au contenu principal
POST
/
whatsapp
/
contacts
/
update
Créer/Mettre à jour un contact
curl --request POST \
  --url https://api.wachap.com/v1/whatsapp/contacts/update \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "phone": "<string>",
  "name": "<string>",
  "businessName": "<string>"
}
'

Endpoint

/v1/whatsapp/contacts/update

Headers

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

Body Parameters

accountId
string
requis
L’identifiant du compte WhatsApp
phone
string
requis
Le numéro de téléphone au format international
name
string
requis
Le nom du contact
businessName
string
Le nom business du contact (optionnel)

Notes

  • Si le contact existe déjà, il sera mis à jour
  • Si le contact n’existe pas, il sera créé dans le store local
  • Le numéro doit être au format international (+…)
  • Le businessName est optionnel

Exemples de requêtes

curl -X POST https://api.wachap.com/v1/whatsapp/contacts/update \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer VOTRE_CLE_SECRETE" \
  -d '{
    "accountId": "account_xxx",
    "phone": "+22962861571",
    "name": "John Doe",
    "businessName": "John'\''s Business"
  }'

Exemple de réponse

{
  "success": true,
  "message": "Contact mis à jour avec succès",
  "contact": {
    "jid": "[email protected]",
    "phoneNumber": "22962861571",
    "name": "John Doe",
    "businessName": "John's Business"
  }
}

Codes d’erreur

CodeDescription
400MISSING_ACCOUNT_ID - accountId manquant
400MISSING_PHONE - phone manquant
400MISSING_NAME - name 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
phone
string
name
string
businessName
string

Réponse

200

OK