Portfolio Project

Bulk Message & Auto-Solve for Zendesk

A Python automation tool that sends templated messages to hundreds of customers via Sunshine Conversations API and auto-solves their tickets, handling mass incidents in minutes instead of hours.

Python Zendesk REST API Sunshine Conversations Google Colab Exponential Backoff
Zendesk View
Python Script
Sunshine API

Live Simulation

Click to simulate the bulk messaging process with mock data

Total in View ๐Ÿ“‹
0
Sent & Solved โœ…
0
Template / Skip โŠ˜
0
Failed โš ๏ธ
0

๐Ÿ–ฅ๏ธ Console Output

Idle
Waiting for bulk send to start...

๐Ÿ’ฌ WhatsApp Conversation Preview

active: 03h 12m

Payment saya gagal tapi saldo sudah terpotong. Tolong dicek ya.

Customer ยท WhatsApp ยท 3 hours ago

Hi! We're writing to let you know that the scheduled maintenance on our payment system has been completed. All services are now back to normal. If you still experience any issues, please reply to this message and our team will assist you. Thank you for your patience! ๐Ÿ™

Business reply ยท no Meta template needed
Send condition channel = WhatsApp, conversation_id exists, last inbound โ‰ค 24h, not already tagged.

๐Ÿ“„ Tickets in View (Mock Data)

0 tickets
ID Subject Requester Status Tags Result

โšก How It Works

Key implementation highlights from the Python script

1. Fetch Tickets from View
def list_view_tickets_pages(view_id):
    url = f"{ZD_BASE}/views/{view_id}/tickets.json"
    while url:
        r = req_with_retry("GET", url, auth=ZD_AUTH)
        data = r.json()
        yield data.get("tickets", [])
        url = data.get("next_page")
2. Resolve Conversation ID
def get_conversation_id_for_ticket(ticket):
    # Try direct from ticket metadata
    via = ticket.get("via") or {}
    conv = via.get("source", {}).get("to", {})
        .get("conversation_id")
    if conv:
        return conv.strip()

    # Fallback: user identity โ†’ conversation
    messaging_id = get_messaging_identity(
        ticket["requester_id"]
    )
    return get_default_conversation(messaging_id)
3. Send Message & Solve
def send_text_message(conversation_id, text):
    url = f"{SC_BASE}/conversations/"
        f"{conversation_id}/messages"
    payload = {
        "author": {"type": "business"},
        "content": {"type": "text", "text": text}
    }
    req_with_retry("POST", url, auth=SC_AUTH,
                   json=payload)

def solve_and_tag_ticket(ticket_id, tags):
    payload = {"ticket": {
        "status": "solved", "tags": tags
    }}
    req_with_retry("PUT", url, auth=ZD_AUTH,
                   json=payload)

โœจ Key Features

๐ŸŽฏ

View-Based Targeting

Processes only tickets from a specific Zendesk View. Precise targeting without affecting other queues.

๐Ÿ”„

Retry with Backoff

Handles rate limits (429) and server errors (5xx) with exponential backoff, up to 5 attempts per request.

๐Ÿ›ก๏ธ

Idempotent Processing

Tags processed tickets to prevent duplicate sends. Safe to re-run without sending messages twice.

๐Ÿ“Š

Progress Reporting

Real-time console output with per-ticket status and final summary of sent, skipped, and failed counts.

๐Ÿ” WhatsApp Bulk Capability Comparison

How this tool compares to other platforms for bulk WhatsApp replies within the 24-hour service window.

โšก

No Meta Template Approval Required (Inside 24h)

This tool uses Sunshine Conversations API to send structured messages (text, cards, carousels) within the 24-hour session window, without submitting templates to Meta for approval. It routes messages to the specific conversation_id tied to each ticket, ensuring replies land in the correct thread.

๐Ÿ“Š Platform Comparison

24h window rules
Platform / Approach Bulk WhatsApp Inside 24h Outside 24h Best Fit
This Tool (Sunshine API) โœ… Yes, ticket reply โš ๏ธ Template or skip Mass incident replies from Zendesk Views
Front โœ… Bulk reply โš ๏ธ Template rule Shared inbox teams with native bulk
Kommo / DoubleTick / Manychat โœ… Active sessions โš ๏ธ Template required WhatsApp-first broadcast to contacts
Zoho Desk โŒ Not main flow โš ๏ธ Template Mass template messages to tickets
Qontak / WATI / respond.io โš ๏ธ Campaign-specific โš ๏ธ Template Approved-template blast workflows
Freshdesk / Gorgias โš ๏ธ Possible as reply โš ๏ธ Template rule Support tickets and agent macros
๐Ÿ’ก Why no template inside 24h? Sunshine Conversations sends structured messages within the active session window. Unlike platforms that require Meta-approved templates even for simple replies, this tool sends directly via the API without any approval process, as long as the customer messaged within 24 hours.
๐Ÿ’ฌ Conversation-based routing The tool sends to the specific conversation_id linked to the ticket. It first checks ticket metadata, then falls back to the user's default conversation. This is conversation-based delivery: the message reaches the same thread the customer used, not a generic channel broadcast.

๐Ÿ›ก๏ธ Implementation Guardrails

โฑ๏ธ

Check the Window

Do not assume every ticket is eligible. Verify the last inbound customer message timestamp is within 24 hours before sending.

๐Ÿ“จ

Reply โ‰  Broadcast

This is bulk reply to existing conversations, not cold outbound broadcast. The customer initiated contact first.

๐Ÿท๏ธ

Idempotency via Tags

Tag processed tickets so reruns skip previously handled tickets and avoid duplicate customer messages.

๐Ÿ”„ Adaptable to Other Platforms

The same "reply to active conversation via API" pattern can be replicated on other helpdesk platforms with their respective APIs.

Intercom Low effort
POST /conversations/{id}/reply

Almost identical pattern. Reply as admin to existing conversations. Free-form text, no template needed.

Admin reply Free-form text Close conversation
Freshchat Medium effort
POST /v2/conversations/{id}/messages

Send messages to existing Freshchat conversations. Requires mapping Freshdesk tickets to Freshchat conversation IDs.

Agent message Ticket-chat mapping Resolve action
HubSpot Medium effort
POST /conversations/v3/.../threads/{id}/messages

New Conversations API v3 supports sending messages to existing threads. Also supports custom channels.

Thread reply Custom channels Newer API
Transferable skill: The core pattern (fetch tickets โ†’ find conversation โ†’ send reply โ†’ update status) works across platforms. Only the API endpoints and authentication methods change.