PHPackages                             supreme/usmsgh-api-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. supreme/usmsgh-api-sdk

ActiveLibrary[API Development](/categories/api)

supreme/usmsgh-api-sdk
======================

PHP SDK for the Urhitech Bulk SMS API

2.0.0(6mo ago)07MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Jan 19Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/urhitech/usmsgh-api-sdk)[ Packagist](https://packagist.org/packages/supreme/usmsgh-api-sdk)[ RSS](/packages/supreme-usmsgh-api-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Urhitech SMS PHP SDK &amp; notifications channel for Laravel
============================================================

[](#urhitech-sms-php-sdk--notifications-channel-for-laravel)

The Urhitech SMS PHP SDK provides a suitable approach to the USMSGH API from applications written in PHP. It includes pre-defined set of classes and functions for API resource that initialize themeselves from API responses.

The library provides other features. For Example:

1. Easy configuration path for fast setup and use
2. Helpers for pagination.

[![Latest Version on Packagist](https://camo.githubusercontent.com/0ec78211fe1ae9099ffbbcca15752c6630628c0c8afd03ad0977005863e3bcb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75736d7367682f75736d7367682d6170692d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/usmsgh/usmsgh-api-sdk)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/f1239df411b05d8e5cd4fa10f79b1e331235f677b00cdb56635e29f21e46af03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75736d7367682f75736d7367682d6170692d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/usmsgh/usmsgh-api-sdk)[![PHP Version](https://camo.githubusercontent.com/23d185d525f163fc848f019029815f96e8ef3ff225f3db81b14a9ed18339e74d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e302d626c75652e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/dbdeabdbc255774969f2dcd2ca4b2b96af33c09874ead6b47b1162f6ed58791e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d382e78253230253743253230392e7825323025374325323031302e7825323025374325323031312e782d7265642e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)

This package makes it easy to send notifications using [USMSGH](https://www.usmsgh.com) with Laravel 8.x, 9.x, 10.x, and 11.x

You can sign up for a USMSGH account at [usmsgh.com](https://www.usmsgh.com)

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the USMSGH service](#setting-up-the-Usmsgh-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Prerequisites
-------------

[](#prerequisites)

PHP 8.0 or later

Installation
------------

[](#installation)

Via [Composer](http://getcomposer.org/)

```
$ composer require usmsgh/usmsgh-api-sdk

```

Via Git Bash

```
git clone git@github.com:urhitech/usmsgh-api-sdk.git

```

Documentation
-------------

[](#documentation)

Please see  for up-to-date documentation

Usage
-----

[](#usage)

### Step 1:

[](#step-1)

If you install the Urhitech SMS PHP SDK via Git Clone then load the Urhitech SMS PHP API class file and use namespace.

```
require_once '/path/to/src/Usms.php';
use Urhitech\Usmsgh\Usms;
```

If you install Urhitech SMS PHP SDK via [Composer](http://getcomposer.org/) the Require the autoload.php file in the index.php of your project or whatever file you need to use Urhitech SMS PHP API classes.

```
require __DIR__ . '/vendor/autoload.php';
use Urhitech\Usmsgh\Usms;
```

The Urhitech SMS PHP SDK endpoints are RESTful, and consume and return JSON. All Http endpoints requires an API Key in the request header.

For more information on how to get an API Key visit [here](https://webapp.usmsgh.com/developers) to copy or generate new key for authorization.

HTTP ENDPOINTS
--------------

[](#http-endpoints)

-
- [https://webapp.usmsgh.com/api/sms/{uid}](https://webapp.usmsgh.com/api/sms/%7Buid%7D)
-
-
-
-
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/show/](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/show/)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/store](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/store)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/search/{uid}](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/search/%7Buid%7D)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/update/{uid}](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/update/%7Buid%7D)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/delete/{uid}](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/delete/%7Buid%7D)
- [https://webapp.usmsgh.com/api/contacts/{group\_id}/all](https://webapp.usmsgh.com/api/contacts/%7Bgroup_id%7D/all)

For Laravel Usage:

### Setting up the Usmsgh .env

[](#setting-up-the-usmsgh-env)

Add the following code to you `.env`:

```
USMSGH_ENDPOINT=
USMSGH_API_TOKEN=
USMSGH_SENDER=
#USMSGH_UNIVERSAL_TO=
```

### Setting up the Usmsgh service

[](#setting-up-the-usmsgh-service)

Add the following code to you `config/services.php`:

```
// config/services.php
...
'usmsgh' => [
    'sender_endpoint' => env('USMSGH_ENDPOINT', 'https://webapp.usmsgh.com/api/sms/send'),
    'api_token' => env('USMSGH_API_TOKEN'),
    'sender_id' => env('USMSGH_SENDER'),
    'universal_to' => env('USMSGH_UNIVERSAL_TO'),
],
...
```

Usage
-----

[](#usage-1)

Now you can use the channel in your `via()` method inside the notification:

```
use Urhitech\Usmsgh\UsmsChannel;
use Urhitech\Usmsgh\UsmsMessage;
use Illuminate\Notifications\Notification;

class ProjectCreated extends Notification
{
    public function via($notifiable)
    {
        return [UsmsChannel::class]; // or 'usmsgh'
    }

    public function toUsms($notifiable)
    {
        return new UsmsMessage('Content');
    }
}
```

In order to let your Notification know which phone number to use, add the `routeNotificationForUsmsgh` method to your Notifiable model.

This method needs to return a phone number.

```
public function routeNotificationForUsmsgh(Notification $notification)
{
    return $this->phone_number;
}
```

### Local development

[](#local-development)

When developing an application that sends SMS, you probably don't want to actually send SMS to live phone numbers. You may set a universal recipient of all SMS sent. This can be done by the `USMSGH_UNIVERSAL_TO` environment variable or the `universal_to` option.

### Available Message methods

[](#available-message-methods)

- `content(string $content)`: Accepts a string value for the sms content.
- `sender(string $sender_id)`: Accepts a string value for the sender name.
- `campaign(string $campaign)`: Accepts a string value for the sms campaign name.
- `sendAt(\DateTimeInterface|string $sendAt)`: Accepts a DateTimeInterface or string for the sms due date.
- `parameters(array $parameters)`: Accepts an array for the sms parameters.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

### Step 2:

[](#step-2)

Instantiate the Urhitech SMS PHP API

```
$client = new Urhitech\Usmsgh\Usms;
```

Send SMS
--------

[](#send-sms)

```
$api_key = "Enter Your API Key here";

$url = "https://webapp.usmsgh.com/api/sms/send";

$recipients = "233500000000,233540000000";
$message = "Hello world";
$senderid = "Enter your approved sender ID here";

$response = $client->send_sms($url, $api_key, $senderid, $recipients, $message);
```

Check SMS Credit Balance
------------------------

[](#check-sms-credit-balance)

```
$api_key = "Enter Your API TOKEN here";

$url = "https://webapp.usmsgh.com/api/balance";

$get_credit_balance = $client->check_balance($url, $api_key);
```

View Profile
------------

[](#view-profile)

```
$api_key = "Enter Your API Key here";

$url = "https://webapp.usmsgh.com/api/me";

$get_profile = $client->profile($url, $api_key);
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Majesty](https://github.com/majesty2017)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance66

Regular maintenance activity

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~264 days

Total

5

Last Release

203d ago

Major Versions

v1.0.3 → 2.0.02025-12-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/aed89f2f1372fa13f0e7354d50fa287cbeccc900c9fe75595defd5264224c19c?d=identicon)[urhitech](/maintainers/urhitech)

---

Top Contributors

[![urhitech](https://avatars.githubusercontent.com/u/82146061?v=4)](https://github.com/urhitech "urhitech (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/supreme-usmsgh-api-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/supreme-usmsgh-api-sdk/health.svg)](https://phpackages.com/packages/supreme-usmsgh-api-sdk)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.8M142](/packages/laravel-cashier)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M162](/packages/spatie-laravel-health)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
