Automate WhatsApp Image Sharing with Shell Scripts
Looking to automate WhatsApp image sharing, visual notifications, or media delivery directly from your terminal? This guide walks you through sending images to WhatsApp users using a simple shell script and the WhatsMate WA Gateway REST API. Perfect for system administrators, developers, and automation enthusiasts who want to integrate visual content delivery into their messaging workflows.
📋 Prerequisites
Before you begin, ensure you have:
- A WhatsMate WA Gateway account - Required for API access
- Recipient registration - Each recipient must register with the Gateway first
- Basic shell scripting knowledge - Familiarity with terminal commands
- Image file ready - Have the image you want to send available locally
- Base64 utility - The
base64command must be available on your system
⚠️ Important: Recipients must register with the WhatsMate WA Gateway before they can receive messages. Unregistered users will not receive any messages from the Gateway. Registration instructions are available on the official WhatsMate site.
📝 Step-by-Step Implementation
Follow these steps to send your first image to a WhatsApp user from a shell script:
1. Copy the Script Template
Start by copying the following source code into your script file:
2. Configure a few Parameters
Customize these key parameters in the script:
- Line 13: Replace
YOUR_OWN_INSTANCE_ID_HEREwith your WhatsApp gateway instance ID - Lines 14-15: Update
YOUR_OWN_CLIENT_ID_HEREandYOUR_OWN_SECRET_HEREwith your Client ID and Secret - Line 18: Replace
12025550108with the target phone number (including the country code) - Line 19: Replace
../assets/cute-girl.jpgwith the path to your image file - Line 24: Replace
Lovely Galwith an optional caption for your image
3. Make the Script Executable
Set execute permissions on your script:
chmod 755 send-whatsapp-image.sh
4. Send Your Image
Run the script to deliver your image to WhatsApp:
./send-whatsapp-image.sh
🔧 Common Use Cases
This automation approach is ideal for:
- Visual system monitoring - Send server status screenshots or graphs to WhatsApp
- Automated photo sharing - Deliver daily photos or visual updates via WhatsApp
- Image-based reports - Share charts, diagrams, or visual data through WhatsApp
- Media content delivery - Distribute images as part of automated WhatsApp workflows
- Integration with image processing - Combine with scripts that generate or modify images for WhatsApp delivery
🚀 Get Started Today
Ready to automate your image sharing over WhatsApp? You’ll need a trial account to access the API. Sign up for a 2-week trial and start sending images within minutes!
Next Steps: Once you’ve mastered basic image sending, explore advanced features like sending documents or group messages through the WhatsMate WA Gateway API documentation.