Search by

akamomer / bulksmsiraq-sdk-v5

akamomer

This package is abandoned and no longer maintained. The author suggests using the bulksmsiraq/php-sdk package instead.

PHP SDK for the Bulk SMS Iraq OTP and SMS API (v5): WhatsApp, Telegram and SMS verification codes in Iraq with automatic fallback.

Package info

github.com/bulksmsiraq/php-sdk

Homepage

Documentation

pkg:composer/akamomer/bulksmsiraq-sdk-v5

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.3.0 2026-12-06 16:10 UTC

This package is auto-updated.

Last update: 2026-12-06 16:11:20 UTC


README

Packagist

Moving from akamomer/bulksmsiraq-sdk-v5? Same code, new name: run composer remove akamomer/bulksmsiraq-sdk-v5 && composer require bulksmsiraq/php-sdk. The PHP namespace (BulkSMSIraq) is unchanged.

Official PHP SDK for the Bulk SMS Iraq OTP and SMS API. Send verification codes on WhatsApp, Telegram and SMS to every Iraqi network (Zain, Asiacell, Korek) with automatic fallback, verify them, and send SMS and WhatsApp templates.

Installation

composer require bulksmsiraq/php-sdk

Requires PHP 7.4+ and Guzzle 7 (installed automatically).

Quick start

<?php
require 'vendor/autoload.php';

use BulkSMSIraq\BulkSmsIraqApiClient;

$client = new BulkSmsIraqApiClient(getenv('BSI_API_KEY')); // keep the key on your server
$phone  = '9647701234567';                                  // international format, no +
$sender = 'YourApp';                                        // your Sender ID

// 1) Send a code: WhatsApp first, SMS if WhatsApp can't deliver
$res = $client->sendAutoOtpWithSmsFallback($phone, $sender, 'ar');
if ($res['status'] !== 'success') {
    exit('Error ' . $res['error']['code'] . ': ' . $res['error']['message']);
}
$otpId = $res['id']; // store with the user's session

// 2) Verify the code the user typed (same phone number)
$check = $client->verifyOtp($phone, $_POST['code'], $otpId);
if ($check['status'] === 'success') {
    // verified
} elseif ($check['error']['code'] === '1507') {
    // expired or locked: ask for a new code
}

Methods

Method What it does
sendAutoOtpWithSmsFallback($phone, $sender, $lang) We generate the code; WhatsApp, then SMS
sendAutoOtpWithTelegramFallback($phone, $sender, $lang) WhatsApp, then Telegram
sendCustomOtpWithSmsFallback($phone, $sender, $code, $lang) Your own numeric code; WhatsApp, then SMS
sendCustomOtpWithTelegramFallback(...) Your own code; WhatsApp, then Telegram
sendOtpWhatsAppWithoutFallback / sendOtpSmsWithoutFallback / sendOtpTelegramWithoutFallback(...) One channel only
verifyOtp($phone, $code, $id) Check a code. Optional 5th argument true disables expiry (only if you handle it yourself)
sendSms($phone, $sender, $text) SMS under your registered Sender ID, any language
sendWhatsAppTemplate($phone, $sender, '(template)(param1)(param2)', $lang) Approved WhatsApp template (en/ar)
getBalance() Your balance in US dollars: ['userid' => …, 'balance' => 25.43] (same API key)

API address: https://api.bulksmsiraq.com/api/v5/ (default since v1.2.0). The previous address gateway.standingtech.com keeps working; pass it as the 2nd constructor argument if you need it.

Every method returns the decoded JSON: ['status' => 'success', ...] or ['status' => 'failed', 'error' => ['code' => '1907', 'message' => '...']]. API errors are returned, never thrown; only network failures throw GuzzleHttp\Exception\GuzzleException.

Good to know

Topic Details
Code expiry WhatsApp: the message tells the user 3 minutes (verify accepts up to 30). SMS: 30 minutes. Telegram: 2 minutes. Locked after 5 wrong attempts.
Languages en, ar, ku (Kurdish Sorani), fa. WhatsApp codes: English or Arabic only (Meta's limit); Kurdish and Persian text on SMS.
Billing WhatsApp: you pay only for delivered messages; if it falls back to SMS you pay the SMS price only.
Limits Per number: 2 codes / 30 s (1907), 10 / hour (1906), 15 / day (1905). Test numbers can be whitelisted.
Errors Full list: https://bulksmsiraq.com/docs/#errors
Security Never put the API key in a mobile app, browser code or a public repo. Restrict the key to your server IPs in the dashboard.

Support

Bulk SMS Iraq (StandingTech), Four Towers, Erbil · Official Meta Tech Partner Technical support (WhatsApp): +964 750 217 1212 · Sales: +964 750 216 1212 · https://bulksmsiraq.com/contact/

License

MIT