Skip to main content

WhatsApp API

Integrate WhatsApp Business messaging into your affiliate marketing workflow. Send notifications, create broadcast campaigns, and generate status content.

Prerequisites

WhatsApp features require a connected WhatsApp Business account via the Meta Business Platform. Configure your phone number and notification preferences in Settings.

Generate Status Content

Create optimized text content for WhatsApp Status (Stories) with embedded tracking links.

curl -X POST https://api.affilync.com/api/whatsapp/status/generate \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_name": "FitPro Supplements",
"price": "$49.99",
"offer": "50% OFF today only!",
"tracking_url": "https://track.affilync.com/s/abc123"
}'

Response (200):

{
"status_post": {
"content": "🔥 50% OFF today only!\n\n*FitPro Supplements* — $49.99\n\nTap to shop 👉 https://track.affilync.com/s/abc123"
}
}

Mark Status as Posted

After posting to WhatsApp Status, confirm to enable analytics tracking.

curl -X POST https://api.affilync.com/api/whatsapp/status/{post_id}/posted \
-H "Authorization: Bearer YOUR_TOKEN"

Status Analytics

curl https://api.affilync.com/api/whatsapp/status/analytics?limit=20 \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"posts": [
{
"id": "sp_abc123",
"content_text": "🔥 50% OFF...",
"tracking_url": "https://track.affilync.com/s/abc123",
"posted": true,
"clicks": 47,
"conversions": 3,
"revenue": 149.97,
"posted_at": "2026-03-20T09:00:00Z",
"expires_at": "2026-03-21T09:00:00Z"
}
],
"totals": {
"total_posts": 15,
"posted_count": 12
}
}

Broadcast Analytics

Track performance of WhatsApp broadcast campaigns sent to subscriber lists.

curl https://api.affilync.com/api/whatsapp/broadcasts/analytics?limit=10 \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"broadcasts": [
{
"id": "bc_abc123",
"name": "Weekend Flash Sale",
"recipients": 250,
"delivered": 242,
"read": 189,
"clicked": 67,
"conversions": 12,
"revenue": 599.88,
"status": "completed",
"sent_at": "2026-03-19T10:00:00Z"
}
],
"totals": {
"total_broadcasts": 8,
"total_recipients": 1200,
"total_delivered": 1150,
"total_clicked": 340,
"total_revenue": 4250.00
}
}

Create Broadcast

curl -X POST https://api.affilync.com/api/whatsapp/broadcasts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New Product Launch",
"campaign_id": "camp_abc123",
"message_template": "🚀 New launch! Check out {{product_name}} — {{price}}. Shop now: {{link}}",
"recipient_count": 500
}'

Campaign WhatsApp Stats

View WhatsApp-specific metrics for a campaign (Click-to-WhatsApp attribution).

curl https://api.affilync.com/api/whatsapp/campaigns/{campaign_id}/stats \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"conversations": 89,
"attributed": 34,
"conversion_rate": 38.2
}

Catalog Sharing

Generate shareable product text for WhatsApp messages.

curl -X POST https://api.affilync.com/api/whatsapp/catalog/share \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_name": "Premium Fitness Kit",
"price": "$149.99",
"description": "Everything you need for home workouts",
"tracking_url": "https://track.affilync.com/s/xyz789",
"affiliate_name": "FitReviews"
}'

Response (200):

{
"share_text": "🛍️ Premium Fitness Kit — $149.99\nEverything you need for home workouts\n\nShop with FitReviews: https://track.affilync.com/s/xyz789"
}

Webhooks

WhatsApp events are delivered to your webhook endpoint. See Webhooks API for setup.

EventDescription
whatsapp.message.receivedIncoming message from a contact
whatsapp.broadcast.deliveredBroadcast delivery confirmed
whatsapp.broadcast.readBroadcast read receipt
whatsapp.status.clickedClick on a status tracking link