Download the PHP package rstacode/otpiq without Composer
On this page you can find all versions of the php package rstacode/otpiq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rstacode/otpiq
More information about rstacode/otpiq
Files in rstacode/otpiq
Package otpiq
Short Description A Laravel package for handling OTP verification, The most reliable SMS & WhatsApp & Telegram verification platform for your business in Iraq
License MIT
Homepage https://github.com/rstacode/otpiq
Informations about the package otpiq
OTPIQ Laravel Package
A Laravel package for seamless integration with the OTPIQ SMS service API. Send verification codes and custom messages via SMS, WhatsApp, or Telegram with ease.
🔗 Quick Links
✨ Features
- Multi-Channel Messaging: Send messages via SMS, WhatsApp, or Telegram.
- Verification Codes: Send OTP verification codes easily.
- Custom Messages: Send personalized messages with approved sender IDs.
- Delivery Tracking: Track the status of sent messages with detailed channel flow.
- Credit Management: Monitor your remaining credits and usage.
- Sender ID Management: Retrieve and manage your approved sender IDs.
- Webhooks Support: Real-time notifications for message status updates.
- Error Handling: Comprehensive exception handling.
- Laravel 10-12 Support: Fully compatible with Laravel 10, 11, and 12.
- PHP 8.1-8.4 Support: Built for modern PHP applications.
🛠️ Requirements
- PHP 8.1, 8.2, 8.3, or 8.4
- Laravel 10, 11, or 12
- Guzzle HTTP 7.0+
🚀 Installation
-
Install the package via Composer:
-
Publish the configuration file:
- Add your OTPIQ API key to your
.env
file:
⚙️ Configuration
The configuration file (config/otpiq.php
) includes the following options:
🎯 Usage
Send Verification Code
Send Custom Message
Track SMS Status
Get Project Information
Get Sender IDs
🚨 Error Handling
The package provides comprehensive error handling. Here's how to handle errors:
🔌 Available Providers
OTPIQ offers 6 provider options including smart fallback routes:
whatsapp-telegram-sms
(recommended): Try WhatsApp → Telegram → SMS (maximum delivery success)whatsapp-sms
: Try WhatsApp first, fallback to SMStelegram-sms
: Try Telegram first, fallback to SMSsms
: SMS onlywhatsapp
: WhatsApp onlytelegram
: Telegram only
Note: For custom messages, the provider is typically set to sms
since sender IDs are mainly supported via SMS.
🔗 Webhooks
OTPIQ provides real-time delivery status notifications via webhooks. When you configure webhooks, you'll receive instant updates about message delivery status directly to your server.
How to Configure Webhooks
Include a deliveryReport
object in your SMS request:
Webhook Configuration Fields
Field | Type | Required | Description |
---|---|---|---|
webhookUrl |
string | Yes | HTTPS URL where status updates are sent |
deliveryReportType |
string | No | "all" for all updates, "final" for final status only |
webhookSecret |
string | No | Secret key for webhook authentication |
Webhook Payload Structure
Each webhook request contains a JSON payload with these fields:
Required Fields:
smsId
: Unique message identifierdeliveryReportType
: Your configured report typeisFinal
: Whether this is the final statuschannel
: Messaging channel (sms, whatsapp, telegram)status
: Delivery status (sent, delivered, failed)
Optional Fields:
reason
: Failure reason (only when status is 'failed')senderId
: Sender ID used (only for SMS with custom sender IDs)
Delivery Status Flow
SMS Messages:
sent
→ Message accepted by carrierdelivered
→ Message confirmed delivered to recipientfailed
→ Message could not be delivered
WhatsApp Messages:
sent
→ Message sent to WhatsApp serversdelivered
→ Message delivered to recipient's devicefailed
→ Message could not be sent or delivered
Telegram Messages:
sent
→ Message sent to Telegram serversdelivered
→ Message delivered to recipientfailed
→ Message could not be sent
Webhook Examples
Example 1: SMS with Custom Sender ID
Request:
Webhook Payloads Received:
Sent Status:
Delivered Status:
Example 2: WhatsApp with Final-Only Reports
Request:
Webhook Payload (Final Status Only):
Example 3: Failed Message
Request:
Webhook Payload (Failure):
Laravel Event Integration
For handling webhook events in Laravel:
📜 License
This package is licensed under the MIT License. See the LICENSE file for details.
🔒 Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
💡 Credits
- Rstacode
- All Contributors
🤝 Contributing
Thank you for considering contributing to the OTPIQ Laravel package!
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature
). - Commit your changes (
git commit -m 'Add some amazing feature'
). - Push to the branch (
git push origin feature/amazing-feature
). - Open a Pull Request.
📞 Support
For support, email GitHub repository.
All versions of otpiq with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0