Avant de commencer
Créer un canal
Connecter WhatsApp
Générer la clé API
Webhooks (optionnel)
URL de l'API
GET
https://whazora.com/api/v1/health
POST
https://whazora.com/api/v1/messages
POST
https://whazora.com/api/v1/media
Authentification
Exemple
Authorization: Bearer whz_live_VOTRE_CLE_ICI
Paramètre channel
Envoyer des messages
Contrôle de disponibilité
Exemple
curl -sS "https://whazora.com/api/v1/health"
Message texte
| Champ | Obligatoire | Description |
|---|---|---|
channel | oui | |
to | oui | |
type | oui | text |
text.body | oui |
Exemple
curl -sS -X POST "https://whazora.com/api/v1/messages" \
-H "Authorization: Bearer whz_live_VOTRE_CLE" \
-H "Content-Type: application/json" \
-d '{
"channel": "oaza",
"to": "243971106771",
"type": "text",
"text": { "body": "Bonjour, merci pour votre commande." }
}'
Image
type | oui | image |
image.id | id ou link | |
image.link | id ou link | |
image.caption | non |
Exemple
{
"channel": "oaza",
"to": "243971106771",
"type": "image",
"image": {
"id": "MEDIA_ID_APRES_UPLOAD",
"caption": "Photo du produit"
}
}
Vidéo
type | oui | video |
video.id | id ou link | |
video.link | id ou link | |
video.caption | non |
Exemple
{
"channel": "oaza",
"to": "243971106771",
"type": "video",
"video": { "id": "MEDIA_ID", "caption": "Démonstration" }
}
Audio
type | oui | audio |
audio.id | oui |
Exemple
{
"channel": "oaza",
"to": "243971106771",
"type": "audio",
"audio": { "id": "MEDIA_ID" }
}
Sticker
type | oui | sticker |
sticker.id | oui |
Exemple
{
"channel": "oaza",
"to": "243971106771",
"type": "sticker",
"sticker": { "id": "MEDIA_ID_STICKER" }
}
Réaction
type | oui | reaction |
reaction.message_id | oui | |
reaction.emoji | oui* |
Exemple
{
"channel": "oaza",
"to": "243971106771",
"type": "reaction",
"reaction": {
"message_id": "wamid.HBgLMjQzOTcxMTA2NzcxFQIAERgUM0VBN0QyQ0E4NkM1MzJCMzAA",
"emoji": "👍"
}
}
Téléverser un fichier
Exemple
curl -sS -X POST "https://whazora.com/api/v1/media" \ -H "Authorization: Bearer whz_live_VOTRE_CLE" \ -F "channel=oaza" \ -F "type=image/jpeg" \ -F "file=@./photo.jpg"
Recevoir des messages (webhooks)
Exemple — corps reçu sur votre webhook
{
"object": "whatsapp_business_account",
"channel": "oaza",
"channel_id": "identifiant-interne",
"field": "messages",
"value": {
"messages": [{
"from": "243971106771",
"id": "wamid.xxx",
"type": "text",
"text": { "body": "Bonjour" }
}]
}
}
Crédits
Limites
Codes d'erreur
| Code | HTTP | Que faire |
|---|---|---|
invalid_api_key | 401 | |
channel_not_found | 404 | |
whatsapp_not_connected | 409 | |
channel_not_configured | 503 | |
insufficient_credits | 402 | |
subscription_required | 402 | |
graph_send_failed | 5xx | |
rate_limit_exceeded | 429 | |
channel_required | 400 | |
to_required | 400 | |
invalid_message_type | 400 | |
test_key_no_send | 403 | |
insufficient_scope | 403 | |
invalid_json | 400 | |
not_found | 404 |