Download the PHP package devriyad/giosms without Composer
On this page you can find all versions of the php package devriyad/giosms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package giosms
GioSMS PHP SDK
The official PHP SDK for GioSMS — a fast, reliable SMS gateway for Bangladesh. Works with Laravel 9+ (zero config, auto-discovery) and any standalone PHP 8.1+ project.
Table of Contents
- Requirements
- Installation
- Setup — Laravel
- Setup — Standalone PHP (Without Laravel)
- Usage
- Send Single SMS
- Send OTP (High Priority)
- Send Bulk SMS
- Send to Contacts
- Send to Groups
- Check Delivery Status
- Check Balance & Cost Estimate
- Batch Tracking
- Health Check
- Error Handling
- Laravel Dependency Injection
- Reference
- All Methods at a Glance
- SMS Types & Priority
- Encoding & Character Limits
- HTTP Status Codes & Exceptions
- License
Requirements
- PHP 8.1 or higher
- Guzzle 7.x (installed automatically via Composer)
- A GioSMS account and API token from api.giosms.com
Installation
That's it. Guzzle is pulled in automatically if you don't already have it.
Setup — Laravel
Zero config. The service provider and facade are auto-discovered. No need to edit
config/app.php.
Step 1: Add credentials to .env
| Variable | Required | Description |
|---|---|---|
GIOSMS_TOKEN |
Yes | Your API bearer token from the GioSMS dashboard |
GIOSMS_SENDER_ID |
No | Default sender ID (max 16 chars). Can be overridden per request. |
GIOSMS_BASE_URL |
No | API base URL. Default: https://api.giosms.com/api/v1 |
GIOSMS_TIMEOUT |
No | Request timeout in seconds. Default: 30 |
GIOSMS_SSL_VERIFY |
No | SSL certificate verification. Default: true. Set false for local dev. |
Step 2 (Optional): Publish the config file
This creates config/giosms.php if you need to customize anything beyond .env variables.
Step 3: Start sending
Setup — Standalone PHP (Without Laravel)
For any PHP project that doesn't use Laravel — plain PHP, Symfony, CodeIgniter, Slim, etc.
Option A: Pass config directly
Option B: Use a .env file (recommended for production)
If you want to keep secrets out of your code, use the popular vlucas/phpdotenv package:
Create a .env file in your project root:
Then load it in your code:
Note: Add
.envto your.gitignoreso your API token is never committed to version control.
Constructor Parameters
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
token |
string | Yes | — | Your GioSMS API bearer token |
sender_id |
string | No | null |
Default sender ID. Can be overridden per request. |
base_url |
string | No | https://api.giosms.com/api/v1 |
API base URL |
timeout |
int | No | 30 |
HTTP request timeout in seconds |
ssl_verify |
bool | No | true |
SSL certificate verification. Set false for local dev without SSL. |
Usage
All examples below use the Laravel Facade syntax. For standalone PHP, replace GioSMS::method(...) with $sms->method(...) where $sms is your new GioSMS([...]) instance.
Send Single SMS
Parameters
| Key | Type | Required | Description |
|---|---|---|---|
to |
string | Yes | Phone number with country code (e.g. 8801712345678) |
message |
string | Yes | Message body. Max 1000 characters. |
sender_id |
string | No | Override default sender ID. Max 16 characters. |
type |
string | No | otp, transactional, or promotional. Default: transactional |
Send OTP (High Priority)
OTP messages are processed in the highest priority queue for the fastest possible delivery.
The
typeis automatically set tootp— you don't need to specify it.
Send Bulk SMS
Send the same message to multiple phone numbers at once. Pass to as an array — the SDK handles the comma-separated conversion.
Send to Contacts
Send to contacts stored in your GioSMS account by their IDs.
Send to Groups
Send to all contacts in one or more groups. Duplicate phone numbers across groups are automatically deduplicated by the API.
Provide either
messageortemplate_id, not both.
Check Delivery Status
Status flow: queued → submitted → delivered or failed
Check Balance & Cost Estimate
Batch Tracking
Health Check
Check if the GioSMS API is up. This endpoint requires no authentication.
Error Handling
The SDK throws specific exceptions for each error type. All exceptions extend GioSMSException, so you can catch them broadly or specifically.
Standalone PHP — same approach:
Laravel Dependency Injection
Instead of using the Facade, you can type-hint GioSMS anywhere Laravel resolves dependencies — controllers, jobs, commands, etc.
In a queued job:
Reference
All Methods at a Glance
| Method | Description | Returns |
|---|---|---|
send(array $params) |
Send single SMS | Message data with message_id |
otp(array $params) |
Send OTP (high priority) | Message data with message_id |
bulk(array $params) |
Send to multiple numbers | Batch data with batch_id |
toContacts(array $params) |
Send to contact IDs | Batch data with batch_id |
toGroups(array $params) |
Send to group IDs | Batch data with batch_id |
status(array $params) |
Get delivery status | Status data |
balance(array $params) |
Check balance / estimate cost | Balance and rates data |
batch(array $params) |
Get batch report | Batch stats with live progress |
activeBatches() |
List active batches | Array of active batches |
batchHistory(array $params) |
Get batch history | Array of past batches |
health() |
API health check | Status and version |
SMS Types & Priority
| Type | Value | Queue Priority | Best For |
|---|---|---|---|
| OTP | otp |
🔴 Highest | One-time passwords, verification codes |
| Transactional | transactional |
🟡 Medium | Order confirmations, alerts, notifications |
| Promotional | promotional |
🟢 Low | Marketing campaigns, offers, newsletters |
Default type is transactional for send(), otp(), and toContacts(), and promotional for bulk() and toGroups().
Encoding & Character Limits
| Encoding | Single SMS | Multipart (per part) | Triggered By |
|---|---|---|---|
| GSM 7-bit | 160 chars | 153 chars | Latin-only text |
| Unicode (UCS-2) | 70 chars | 67 chars | Bengali, Arabic, emoji, etc. |
Encoding is detected automatically by the API based on your message content. No configuration needed.
HTTP Status Codes & Exceptions
| HTTP Code | Exception Class | Meaning |
|---|---|---|
200 |
— | Success |
202 |
— | Accepted — SMS queued for delivery |
400 |
ValidationException |
Bad request — check your parameters |
401 |
AuthenticationException |
Invalid or missing API token |
402 |
InsufficientBalanceException |
Not enough balance |
404 |
GioSMSException |
Resource not found (wrong message_id, batch_id, etc.) |
422 |
ValidationException |
Validation error |
429 |
RateLimitException |
Rate limit exceeded |
500 |
GioSMSException |
Server error — try again later |
License
MIT — see LICENSE for details.
Built with ❤️ by Riyad Munauwar