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
The most reliable SMS, WhatsApp, and Telegram verification platform for your business in Iraq and Kurdistan.
OTPIQ provides a simple and powerful Laravel package to send verification codes and custom messages through multiple channels including SMS, WhatsApp, and Telegram with automatic fallback support.
Features
- 🚀 Multiple Channels: SMS, WhatsApp, Telegram with automatic fallback
- 🔐 Verification Codes: Send OTP codes with ease
- 💬 Custom Messages: Send transactional and marketing messages
- 📱 WhatsApp Templates: Support for WhatsApp Business templates
- 🔄 Auto Fallback: Automatic channel switching for delivery guarantee
- 📊 Delivery Tracking: Real-time SMS delivery status tracking
- 🎯 Custom Sender IDs: Use your own branded sender IDs
- ⚡ Fast & Reliable: Optimized for performance
- 🛡️ Exception Handling: Comprehensive error handling
Requirements
- PHP 8.1, 8.2, 8.3, or 8.4
- Laravel 10, 11, 12, or 13
Installation
Install the package via Composer:
Configuration
Publish the configuration file:
Add your OTPIQ API key to your .env file:
You can get your API key from the OTPIQ Dashboard.
Usage
Get Project Information
Retrieve your project details and remaining credits:
Response:
Send Verification Code
Send a verification code to a phone number:
Response:
With Custom Sender ID
With Delivery Report Webhook
Send Custom Message
Send a custom transactional or marketing message:
Send WhatsApp Template Message
Send a message using a pre-approved WhatsApp template:
Track SMS Status
Track the delivery status of a sent message:
Response:
Get Sender IDs
Retrieve all your available sender IDs:
Response:
Provider Options
The provider parameter allows you to choose how your message is delivered:
auto- Automatic channel selection (default)whatsapp-sms- Try WhatsApp first, fallback to SMStelegram-sms- Try Telegram first, fallback to SMSwhatsapp-telegram-sms- Try WhatsApp, then Telegram, then SMSsms- SMS onlywhatsapp- WhatsApp onlytelegram- Telegram only
Error Handling
The package provides comprehensive error handling through the OtpiqApiException class:
Available Exception Methods
isAuthError()- Check if error is authentication relatedisCreditError()- Check if error is due to insufficient creditisRateLimitError()- Check if rate limit was exceededisTrialModeError()- Check if account is in trial modeisSpendingThresholdError()- Check if spending threshold was exceededisSenderIdError()- Check if sender ID is invalidisValidationError()- Check if error is validation relatedgetRemainingCredit()- Get remaining credit balancegetRequiredCredit()- Get required credit for the requestgetRateLimitWaitMinutes()- Get wait time in minutesgetFirstError()- Get first validation error messagegetResponseData()- Get full API response data
Testing
You can use the OTPIQ dashboard to test your integration:
- Visit the OTPIQ Dashboard
- Navigate to Messaging → Send SMS
- Build and test your API calls interactively
API Reference
sendSms(array $data): array
Send an SMS message.
Parameters:
Verification Message
Custom Message
WhatsApp Template Message
getProjectInfo(): array
Get project information and remaining credits.
Returns:
trackSms(string $smsId): array
Track SMS delivery status.
Parameters:
$smsId- The SMS ID returned from sendSms()
Returns:
getSenderIds(): array
Get all available sender IDs.
Returns:
Support
- Email: [email protected]
- Issues: GitHub Issues
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.
Credits
All versions of otpiq with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.0