PHPackages                             ahmad-klfr/sms - 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. ahmad-klfr/sms

ActiveLibrary

ahmad-klfr/sms
==============

This is a client of Opilo (www.opilo.com) Web Service

09PHP

Since Jan 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ahmad-klfr/sms)[ Packagist](https://packagist.org/packages/ahmad-klfr/sms)[ RSS](/packages/ahmad-klfr-sms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Webservice Client for opilo.com panel
=====================================

[](#webservice-client-for-opilocom-panel)

In order to send and receive SMS via opilo.com panel, you should first create an instance object of class OpiloClient\\V2\\HttpClient. For that, first you need to configure your webservice in [the configuration page](http://bpanel.opilo.com/api).

Create a Client Object
----------------------

[](#create-a-client-object)

```
use OpiloClient\Configs\Account;
use OpiloClient\Configs\ConnectionConfig;
use OpiloClient\V2\HttpClient;
...
$config = new ConnectionConfig('http://bpanel.opilo.com');
$account = new Account('YOUR_WEBSERVICE_USERNAME'), 'YOUR_WEBSERVICE_PASSWORD');
$client = new HttpClient($config, $account);
```

Sending SMS
-----------

[](#sending-sms)

### Sending a Single SMS

[](#sending-a-single-sms)

```
use OpiloClient\Request\OutgoingSMS;
...
$message = new OutgoingSMS('3000****', '0912*******', 'Hello World!');
$responses = $client->sendSMS($message);
```

### Sending a Batch of SMS at Once

[](#sending-a-batch-of-sms-at-once)

```
$messages = [
    new OutgoingSMS('3000****', '0912*******', 'Hello World!'),
    new OutgoingSMS('3000****', '0912*******', 'Hello World!'),
];
$response = $client->sendSMS($messages);
```

### Parsing The Return Value of sendSMS()

[](#parsing-the-return-value-of-sendsms)

```
use OpiloClient\Response\SMSId;
use OpiloClient\Response\SendError;
...
for ($i = 0; $i < count($response); $i++) {
    if ($response[$i] instanceof SMSId) {
        //store $response[$i]->id as the id of $messages[$i] in your database and schedule for checking status if needed
    } else //$response[$i] instanceof SendError {
        //It could be that you run out of credit, the line number is invalid, or the receiver number is invalid.
        //To find out more examine $response[$i]->error and compare it against constants in SendError class
    }
}
```

Check the Inbox by Pagination
-----------------------------

[](#check-the-inbox-by-pagination)

```
$minId = 0;
while (true) {
    $inbox = $client->checkInbox($minId);
    $messages = $inbox->getMessages();
    if (count($messages)) {
        foreach ($messages as $message) {
            //Process $message->opiloId(), $message->getFrom(), $message->getTo(), $message->getText(), and $message->getReceivedAt() and store them in your database
            $minId = max($minId, $message->getOpiloId() + 1);
        }
    } else {
        //no new SMS
        //Store $minId in your database for later use of this while loop! You don't need to start from 0 tomorrow!
        break;
    }
}
```

Checking the Delivery Status of Sent Messages
---------------------------------------------

[](#checking-the-delivery-status-of-sent-messages)

```
$opiloIds = $yourDatabaseRepository->getArrayOfOpiloIdsOfMessagesSentViaSendSMSFunction();
$response = $client->checkStatus($opiloIds);
foreach ($response->getStatusArray() as $opiloId => $status) {
    //process and store the status code $status->getCode() for the SMS with Id $opiloId
    //Take a look at constants in OpiloClient\Response\Status class and their meanings
}
```

Getting Your SMS Credit
-----------------------

[](#getting-your-sms-credit)

```
$numberOfSMSYouCanSendBeforeNeedToCharge = $client->getCredit()->getSmsPageCount();
```

Exception Handling
------------------

[](#exception-handling)

All the functions in HttpClient may throw CommunicationException if the credentials or configurations are invalid, or if there is a network or server error. Prepare to catch the exceptions appropriately.

```
use OpiloClient\Response\CommunicationException;
...
try {
    ...
    $client->sendSMS(...);
    ...
} catch (CommunicationException $e) {
    //process the exception by comparing $e->getCode() against constants defined in CommunicationException class.
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/00bd007a39d4635b9362e2b0bdcd6ec81f894d6439eb242ea1b36213edf4f35a?d=identicon)[ahmadklfr](/maintainers/ahmadklfr)

---

Top Contributors

[![ahmad-klfr](https://avatars.githubusercontent.com/u/5068505?v=4)](https://github.com/ahmad-klfr "ahmad-klfr (5 commits)")

### Embed Badge

![Health badge](/badges/ahmad-klfr-sms/health.svg)

```
[![Health](https://phpackages.com/badges/ahmad-klfr-sms/health.svg)](https://phpackages.com/packages/ahmad-klfr-sms)
```

PHPackages © 2026

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