Overview
Ultramsg is a WhatsApp API service that enables programmatic sending of WhatsApp messages. The WhatsApp Attendance Bot uses Ultramsg to deliver automated attendance messages to your designated WhatsApp group.Ultramsg offers a free tier with limited messages per month, suitable for testing and small-scale deployments.
Why Ultramsg?
The bot uses Ultramsg because it provides:- Simple REST API: Easy integration with Python using the
requestslibrary - No Official WhatsApp Business Account Required: Works with regular WhatsApp accounts
- Group Messaging Support: Can send messages to WhatsApp groups
- Free Tier Available: Perfect for automated attendance tracking with limited daily messages
Creating Your Ultramsg Account
Visit Ultramsg Website
Navigate to https://ultramsg.com in your web browser.
Sign Up
Click the Sign Up or Register button and provide:
- Email address
- Password
- Accept terms of service
Verify Email
Check your email inbox for a verification message from Ultramsg. Click the verification link to activate your account.
Log In
Return to ultramsg.com and log in with your credentials.
Creating a WhatsApp Instance
An “instance” in Ultramsg represents a connection to a WhatsApp account. You’ll need to create one and connect it to your WhatsApp.Create New Instance
Click Create Instance or Add Instance button.Provide a name for your instance (e.g., “Attendance Bot”).
Connect WhatsApp
Ultramsg will display a QR code. Follow these steps:
- Open WhatsApp on your phone
- Go to Settings > Linked Devices
- Tap Link a Device
- Scan the QR code displayed on Ultramsg
Obtaining API Credentials
After creating and connecting your instance, you need to retrieve three pieces of information for the bot configuration.1. Instance ID
2. API Token
3. WhatsApp Group ID
You need to obtain the ID of the WhatsApp group where attendance messages will be sent.Send Test Message to Group
Using your phone, send any message to the WhatsApp group where you want attendance messages delivered.
Access Webhook or Chat List
In Ultramsg dashboard:
- Go to Chats or Messages section
- Or check Webhooks > Messages Log
Find Group ID
Look for your group in the chat list. The Group ID will be displayed next to or under the group name.Format:
[email protected]Structure:- Starts with country code + phone number of group creator
- Contains a dash followed by more numbers
- Ends with
@g.us(indicating it’s a group)
Individual chat IDs end with
@c.us, while group IDs end with @g.us.Testing Your Connection
Before configuring the bot, test that your credentials work correctly.Using Ultramsg Dashboard
Using cURL Command
YOUR_INSTANCE_IDwith your Instance IDYOUR_TOKENwith your API TokenYOUR_GROUP_IDwith your Group ID
Using Python
Test the exact code used by the bot:test_ultramsg.py
API Endpoint Used by the Bot
The bot constructs the API URL and makes POST requests as follows:bot.py
https://api.ultramsg.com/{instance_id}/messages/chat
Method: POST
Headers: Content-Type: application/x-www-form-urlencoded
Payload Parameters:
token: Your API token for authenticationto: Recipient (group ID or individual ID)body: Message text content
Managing Your Ultramsg Account
Monitoring Usage
Check Dashboard
Your Ultramsg dashboard displays:
- Total messages sent
- Remaining message quota
- Active instance status
Upgrading Your Plan
If you exceed the free tier limits:Free Tier
- Limited messages per month
- 1 instance
- Basic support
- Perfect for testing
Paid Plans
- Higher message quotas
- Multiple instances
- Priority support
- Advanced features
- Go to Billing or Plans in your dashboard
- Select a plan that meets your needs
- Complete payment
Keeping Your Instance Active
Best practices:- Keep your phone connected to the internet
- Regularly check instance status in Ultramsg dashboard
- Don’t spam or send excessive messages
- Follow WhatsApp’s terms of service
Security Considerations
Protect Your Token
Never share your API token publicly or commit it to version control. Always use environment variables.
Secure Your Account
Use a strong password for your Ultramsg account and enable 2FA if available.
Monitor Activity
Regularly review message logs for unauthorized API usage.
Rotate Credentials
Periodically regenerate your API token and update it in GitHub Secrets.
Troubleshooting
Instance Not Connecting
Solutions:- Ensure your phone has stable internet connection
- Try unlinking and re-linking using a new QR code
- Restart WhatsApp on your phone
- Check if WhatsApp has any pending updates
Messages Not Sending
Check:- Instance status is “Active” or “Connected” in dashboard
- API token is correct and hasn’t been regenerated
- Group ID format includes
@g.ussuffix - You haven’t exceeded your message quota
- Your phone’s WhatsApp is running and connected
Invalid Token Error
Solutions:- Verify you copied the complete token without spaces
- Check if token was regenerated (old token becomes invalid)
- Ensure token is passed in the correct parameter (
tokenin payload)
Group Not Found Error
Solutions:- Verify Group ID format:
[email protected] - Confirm the connected WhatsApp account is a member of the group
- Try retrieving the Group ID again using the API
- Ensure there are no extra spaces in the Group ID
Rate Limits and Best Practices
Ultramsg and WhatsApp impose rate limits to prevent spam. Follow these guidelines to avoid issues.
- Don’t send more than 1 message per minute to the same chat
- Space out messages if sending to multiple groups
- Avoid sending identical messages repeatedly
- Keep message content varied and natural
- Sends 2 messages per day (morning and afternoon)
- Only on weekdays (Monday-Friday)
- To a single group
- Well within rate limits
Next Steps
Once you have your Ultramsg credentials:Configure GitHub Secrets
Add these values as environment variables in your repository.See Environment Variables Guide →
Test the Bot
Use manual workflow dispatch to test the complete setup.See Scheduling Guide →
Additional Resources
Ultramsg Documentation
Official API documentation and reference
Ultramsg Support
Contact support for account-specific issues
Environment Variables
Configure your bot credentials
Bot Function Reference
Detailed bot function documentation