Passer au contenu principal
POST
/
whatsapp
/
contacts
/
profile-picture
Photo de profil
curl --request POST \
  --url https://api.wachap.com/v1/whatsapp/contacts/profile-picture \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "phone": "<string>",
  "preview": true
}
'

Endpoint

/v1/whatsapp/contacts/profile-picture

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
preview
boolean
true = petite image, false = grande image (défaut: false)

Notes

  • Le paramètre preview permet de choisir entre :
    • true : Image en basse résolution (plus rapide à charger)
    • false : Image en haute résolution (défaut)
  • Si le contact n’a pas de photo de profil, une erreur sera retournée

Exemples de requêtes

curl -X POST https://api.wachap.com/v1/whatsapp/contacts/profile-picture \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer VOTRE_CLE_SECRETE" \
  -d '{
    "accountId": "account_xxx",
    "phone": "+22962861571",
    "preview": false
  }'

Exemple de réponse

{
  "success": true,
  "message": "Photo de profil récupérée",
  "url": "https://pps.whatsapp.net/v/t61.24694-24/123456789_abcdefghijk.jpg",
  "id": "1234567890",
  "type": "image",
  "directUrl": "/v/t61.24694-24/123456789_abcdefghijk.jpg"
}

Champs de la réponse

ChampTypeDescription
urlstringURL complète de la photo de profil
idstringID unique de la photo
typestringType de média (toujours “image”)
directUrlstringChemin relatif de l’URL

Codes d’erreur

CodeDescription
400MISSING_ACCOUNT_ID - accountId manquant
400MISSING_PHONE - phone manquant
401INVALID_SECRET_KEY - Clé secrète invalide
404ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé
404PROFILE_PICTURE_NOT_FOUND - Photo de profil non disponible

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
preview
boolean

Réponse

200

OK