Download the PHP package irnoti/laravel-sms-panel-api without Composer
On this page you can find all versions of the php package irnoti/laravel-sms-panel-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download irnoti/laravel-sms-panel-api
More information about irnoti/laravel-sms-panel-api
Files in irnoti/laravel-sms-panel-api
Package laravel-sms-panel-api
Short Description Official Laravel SDK for the irnoti platform API — SMS (single, bulk, pattern, scheduled, gradual, SOS), provider services, phonebook, link tracker, number banks, verify, bots and VoIP, with a typed fluent client and webhook verification.
License MIT
Homepage https://github.com/irnoti/laravel-sms-panel-api
Informations about the package laravel-sms-panel-api
Laravel SDK for the irnoti SMS Panel API
Official, typed, fluent Laravel client for irnoti's public SMS panel API — send messages, run every service the panel offers, manage your phonebook and verify webhooks, without writing a single HTTP request by hand.
Why this package
irnoti gives every customer a REST API keyed by a per-account access key (irn_live_… / irn_test_…) — documented at irnoti.com/docs (interactive OpenAPI at /api/docs on the API host). This SDK is a thin, typed Laravel wrapper around it:
- Full API coverage — every endpoint reachable with an access key: SMS (send, quote, pattern, SOS, scheduled/gradual batches, message archive, lines), wallet, phonebook, provider services (regional, targeted, peyamap, smart, messenger, voice, international), link tracker, number banks, verify sessions, bot builder, VoIP — plus a webhook signature verifier.
- Typed errors — every failure is an
IrnotiApiExceptioncarrying the HTTP status and the API's stablecode(insufficient_balance,invalid_recipients,no_price, …) with convenience checks. - Laravel-native — auto-discovered provider, facade, publishable config, requests through
Illuminate\Http\ClientsoHttp::fake()works in your tests. - Multi-tenant friendly — bind a client to any key at runtime with
withApiKey(). - Money-safe — amounts are integer Rial values returned as strings; never cast them to float.
- Sandbox — an
irn_test_…key withlineId: 'sandbox'sends nothing and costs nothing.
Requirements
- PHP 8.2+
- Laravel 10, 11 or 12
- An irnoti access key from the Web service (وبسرویس) section of your panel. Each key has scopes, an optional IP whitelist and can be a sandbox key.
Installation
The key is shown once at creation and only its hash is stored. Keep it server-side, never in a browser or app.
Quick start
Or inject Irnoti\SmsPanelApi\IrnotiClient (a container singleton). Every method returns the decoded JSON of the response (see PHPDoc for shapes) or throws IrnotiApiException.
Quickstart
New here? Follow QUICKSTART.md: install, get a key, send your first (free, sandbox) SMS in 5 minutes.
What can this SDK do? (function reference)
Everything hangs off one client. Each row below is a resource, and links to its section in the API docs at irnoti.com/docs (open the docs panel and look for the section named in the "Docs section" column).
| Resource | Docs section | What it is for | Functions |
|---|---|---|---|
Irnoti::sms() |
SMS | Send text messages | send (single / bulk / group / scheduled / gradual), quote (exact price, no send), pattern (approved OTP/transactional template), sos (guaranteed delivery with failover) |
Irnoti::messages() |
SMS → Messages | Look up sent messages | list, get, check |
Irnoti::batches() |
SMS → Batches | Control scheduled/gradual sends | scheduled, cancel, pause, resume |
Irnoti::lines() |
SMS → Lines | Your sender numbers (you need a line id to send) | list |
Irnoti::wallet() |
Wallet | Balance and history | balance, transactions |
Irnoti::phonebook() |
Phonebook | Contact groups and contacts | groups, createGroup, deleteGroup, contacts, addContacts, importCsv, updateContact, deleteContact |
Irnoti::services() |
Services | Provider products: regional, targeted, peyamap, smart, messenger, voice, international |
prices, internationalRates, list, quote, create, get, refresh, cancel, regional, targeted, peyamap, smart, messenger, voice, international |
Irnoti::linkTracker() |
Link tracker | SMS with tracked links, A/B variants, holdout | send, holdouts, sendNow, campaigns, campaign |
Irnoti::numberBanks() |
Number banks | Send to purchased/filtered number banks | list, facets, quote, send |
Irnoti::verify() |
Verify | OTP verification sessions (SMS or bot) | info, create, list, get, cancel, stats |
Irnoti::bots() |
Bot builder | Read bots, send messages/OTP through them (creating bots is panel-only) | info, list, get, stats, subscribers, messages, send, otp, shopOrders, shopStats |
Irnoti::voip() |
VoIP | Click-to-call | calls, price, call |
Top-level helpers:
| Function | What it does |
|---|---|
Irnoti:: facade or inject IrnotiClient |
Create the client |
Irnoti::withApiKey($key) |
New independent client for another customer key (multi-tenant) |
Webhook::verify($rawBody, $signature, $secret) |
true/false: is this webhook really from irnoti? |
Webhook::parse($rawBody, $signature, $secret) |
Verify and return the decoded event; fails if the signature is bad |
IrnotiApiException |
Raised/returned on any non-2xx answer; has statusCode(), errorCode(), details() and helpers like isInsufficientBalance() |
Every function is a thin wrapper over one HTTP endpoint and returns the API's JSON. Each method has a PHPDoc block with arguments and return shape; see src/Resources/.
Typical flow:
Irnoti::lines()->list()→Irnoti::sms()->quote()→Irnoti::sms()->send()(withidempotencyKey) →Irnoti::messages()->get()/ webhook. Use anirn_test_…key and line idsandboxwhile experimenting: nothing is sent or charged.
Scopes at a glance
| Scope | Allows |
|---|---|
sms.send |
send, pattern, SOS, batch cancel/pause/resume, link-tracker send, number-bank send, service orders, VoIP calls |
sms.read |
quote, messages, lines, scheduled, service prices/orders, number banks, VoIP history |
wallet.read |
balance and transactions |
phonebook.read / phonebook.write |
read / change groups and contacts |
bot.send / bot.read |
bot builder send+OTP / bots, subscribers, stats |
verify.send / verify.read |
create+cancel / read verify sessions |
A missing scope answers 403. Sending also requires completed KYC (not for sandbox keys), and optional products (scheduled, gradual, SOS, pattern, link tracker, services, voip, …) must be enabled for your account.
Usage
Sending — Irnoti::sms()
Use idempotencyKey: on every send you might retry: the same key returns the original result with replayed: true instead of sending twice.
Messages, batches, lines
Wallet
Phonebook
Provider services — Irnoti::services()
Regional, targeted, peyamap, smart, messenger, voice and international orders share one flow: quote → create → refresh → cancel.
Link tracker
Number banks
Verify sessions
Bot builder & VoIP
Bot creation/configuration is panel-only; the to/message shapes follow the panel's bot sender.
Delivery webhooks
Register the URL and copy the whsec_… signing key in the panel, then verify every call against the raw body:
Webhook::verify() returns a bool instead of throwing. Events (message.sent|delivered|failed) may repeat or arrive out of order — de-duplicate on X-Irnoti-Delivery. Signatures older than 5 minutes are rejected. See examples/webhook-controller.php.
Error handling
| Status | Meaning | Helper |
|---|---|---|
| 400 | invalid request (validation_error, invalid_recipients, missing_params, invalid_schedule) |
isValidationError(), isInvalidRecipients() |
| 401 | bad/revoked key or IP not whitelisted | isUnauthenticated() |
| 402 | insufficient_balance |
isInsufficientBalance() |
| 403 | missing scope, KYC incomplete, feature disabled, template not approved | isForbidden() |
| 404 | not found | isNotFound() |
| 409 | conflict (duplicate group, no SOS route) | isConflict() |
| 422 | no_price — no tariff for the service |
isNoPrice() |
| 429 | rate limited (send 600/min, pattern 1200/min per IP) | isRateLimited() |
| 5xx | server error — retry with the same idempotency key | isServerError() |
Multi-tenant usage
If your application holds one irnoti access key per customer rather than a single global key, don't rely on the config-bound singleton — bind a client to the key you need at request time:
withApiKey() returns a new, independent client — it never mutates the shared singleton.
Configuration reference
config/sms-panel-api.php:
| Key | Environment variable | Default | Description |
|---|---|---|---|
base_url |
IRNOTI_API_BASE_URL |
https://api.irnoti.com |
Root of the API (the client appends /v1). |
key |
IRNOTI_API_KEY |
— | Your access key from the API keys page. |
timeout |
IRNOTI_API_TIMEOUT |
15 |
Per-request timeout, in seconds. |
retry.times |
IRNOTI_API_RETRY_TIMES |
1 |
Attempts for transient network failures (1 disables retrying). |
retry.sleep |
IRNOTI_API_RETRY_SLEEP |
200 |
Delay between retries, in milliseconds. |
Testing
The suite is built on Orchestra Testbench and Laravel's Http::fake() — no real access key or network access required. See tests/ for examples of faking success and error responses per resource.
Security
If you discover a security vulnerability in this SDK, please email [email protected] rather than opening a public issue.
Contributing
Contributions are welcome — see CONTRIBUTING.md.
Changelog
See CHANGELOG.md for release notes.
License
Released under the MIT License.
Built and maintained by irnoti — full API reference at irnoti.com/docs.
All versions of laravel-sms-panel-api with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0