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 Starter subscription or higher
  • Create broadcast campaigns with Business tier and above
  • For brand-side WhatsApp Business configuration, contact your brand manager

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

Retrieve analytics for your WhatsApp Status posts.

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 Campaigns

Create and manage WhatsApp broadcast campaigns (Business tier required).

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
}'

Response (201):

{
"id": "bc_abc123",
"name": "New Product Launch",
"status": "draft",
"recipient_count": 500,
"created_at": "2026-03-20T10:00:00Z"
}

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
}
}

Send Broadcast

Send a broadcast to a list of phone numbers (Business tier required).

curl -X POST https://api.affilync.com/api/whatsapp/broadcasts/{broadcast_id}/send \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipients": ["+1234567890", "+0987654321"],
"template_name": "commission_alert",
"template_params": ["param1", "param2"]
}'

Response (200):

{
"success": true,
"broadcast_id": "bc_abc123",
"recipients_count": 2,
"task_id": "task_xyz",
"status": "queued",
"message": "Sending to 2 recipients. This may take a few minutes."
}

Broadcast Status

Check the status and metrics of a broadcast.

curl https://api.affilync.com/api/whatsapp/broadcasts/{broadcast_id}/status \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"id": "bc_abc123",
"name": "Weekend Flash Sale",
"status": "sent",
"recipients": 250,
"delivered": 242,
"read": 189,
"clicked": 67,
"conversions": 12,
"revenue": 599.88,
"sent_at": "2026-03-19T10:00:00Z"
}

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