PHPackages                             ochui/d7sms - 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. ochui/d7sms

AbandonedArchivedLibrary[API Development](/categories/api)

ochui/d7sms
===========

D7 SMS allows you to reach your customers via SMS over D7's own connectivity to global mobile networks. D7 provides reliable and cost-effective SMS services to businesses across all industries and aims to connect all countries and territories via direct connections.

1.0.0(5y ago)0217[1 PRs](https://github.com/ochui/D7SMS-PHP-SDK/pulls)MITPHPPHP &gt;=5.4.0

Since Aug 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ochui/D7SMS-PHP-SDK)[ Packagist](https://packagist.org/packages/ochui/d7sms)[ Docs](https://d7networks.com/)[ RSS](/packages/ochui-d7sms/feed)WikiDiscussions master Synced 5d ago

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

Getting started
===============

[](#getting-started)

D7 SMS allows you to reach your customers via SMS over D7's own connectivity to global mobile networks. D7 provides reliable and cost-effective SMS services to businesses across all industries and aims to connect all countries and territories via direct connections.

How to Build
------------

[](#how-to-build)

The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the `composer.json` file that comes with the SDK. To resolve these dependencies, we use the Composer package manager which requires PHP greater than 5.3.2 installed in your system. Visit  to download the installer file for Composer and run it in your system. Open command prompt and type `composer --version`. This should display the current version of the Composer installed if the installation was successful.

- Using command line, navigate to the directory containing the generated files (including `composer.json`) for the SDK.
- Run the command `composer install`. This should install all the required dependencies and create the `vendor` directory in your project directory.

[![Building SDK - Step 1](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_1.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_1.svg)

### \[For Windows Users Only\] Configuring CURL Certificate Path in php.ini

[](#for-windows-users-only-configuring-curl-certificate-path-in-phpini)

CURL used to include a list of accepted CAs, but no longer bundles ANY CA certs. So by default it will reject all SSL certificates as unverifiable. You will have to get your CA's cert and point curl at it. The steps are as follows:

1. Download the certificate bundle (.pem file) from  on to your system.
2. Add curl.cainfo = "PATH\_TO/cacert.pem" to your php.ini file located in your php installation. “PATH\_TO” must be an absolute path containing the .pem file.

```
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
```

How to Use
----------

[](#how-to-use)

The following section explains how to use the D7SMS library in a new project.

### 1. Open Project in an IDE

[](#1-open-project-in-an-ide)

Open an IDE for PHP like PhpStorm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

[![Open project in PHPStorm - Step 1](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_2.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_2.svg)

Click on `Open` in PhpStorm to browse to your generated SDK directory and then click `OK`.

[![Open project in PHPStorm - Step 2](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_3.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_3.svg)

### 2. Add a new Test Project

[](#2-add-a-new-test-project)

Create a new directory by right clicking on the solution name as shown below:

[![Add a new project in PHPStorm - Step 1](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_4.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_4.svg)

Name the directory as "test"

[![Add a new project in PHPStorm - Step 2](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_5.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_5.svg)

Add a PHP file to this project

[![Add a new project in PHPStorm - Step 3](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_6.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_6.svg)

Name it "testSDK"

[![Add a new project in PHPStorm - Step 4](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_7.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_7.svg)

Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes.

```
require_once "../vendor/autoload.php";
```

It is important that the path inside require\_once correctly points to the file `autoload.php` inside the vendor directory created during dependency installations.

[![Add a new project in PHPStorm - Step 4](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_8.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_8.svg)

After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.

### 3. Run the Test Project

[](#3-run-the-test-project)

To run your project you must set the Interpreter for your project. Interpreter is the PHP engine installed on your computer.

Open `Settings` from `File` menu.

[![Run Test Project - Step 1](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_9.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_9.svg)

Select `PHP` from within `Languages & Frameworks`

[![Run Test Project - Step 2](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_10.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_10.svg)

Browse for Interpreters near the `Interpreter` option and choose your interpreter.

[![Run Test Project - Step 3](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_11.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_11.svg)

Once the interpreter is selected, click `OK`

[![Run Test Project - Step 4](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_12.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_12.svg)

To run your project, right click on your PHP file inside your Test project and click on `Run`

[![Run Test Project - Step 5](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/php_13.svg)](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/php_13.svg)

How to Test
-----------

[](#how-to-test)

Unit tests in this SDK can be run using PHPUnit.

1. First install the dependencies using composer including the `require-dev` dependencies.
2. Run `vendor\bin\phpunit --verbose` from commandline to execute tests. If you have installed PHPUnit globally, run tests using `phpunit --verbose` instead.

You can change the PHPUnit test configuration in the `phpunit.xml` file.

Initialization
--------------

[](#initialization)

### Authentication

[](#authentication)

In order to setup authentication and initialization of the API client, you need the following information.

ParameterDescriptionaPIUsernameAPI KeyaPIPasswordAPI TokenAPI client can be initialized as following.

```
$aPIUsername = 'aPIUsername'; // API Key
$aPIPassword = 'aPIPassword'; // API Token

$client = new D7SMSLib\D7SMSClient($aPIUsername, $aPIPassword);
```

Class Reference
===============

[](#class-reference)

List of Controllers
------------------------------------------------------------------

[](#list-of-controllers)

- [APIController](#api_controller)

[![Class: ](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/class.png ".APIController")](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/class.png) APIController
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#-apicontroller)

### Get singleton instance

[](#get-singleton-instance)

The singleton instance of the `APIController` class can be accessed from the API Client.

```
$client = $client->getClient();
```

### [![Method: ](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/method.png ".APIController.getBalance")](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/method.png) getBalance

[](#-getbalance)

> Check account balance

```
function getBalance()
```

#### Example Usage

[](#example-usage)

```
$client->getBalance();
```

#### Errors

[](#errors)

Error CodeError Description500Internal Server Error### [![Method: ](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/method.png ".APIController.createSendSMS")](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/method.png) createSendSMS

[](#-createsendsms)

> Send SMS to recipients using D7 SMS Gateway

```
function createSendSMS($options)
```

#### Parameters

[](#parameters)

ParameterTagsDescriptionbody`Required`Message BodycontentType`Required`TODO: Add a parameter descriptionaccept`Required`TODO: Add a parameter description#### Example Usage

[](#example-usage-1)

```
$body = new SendSMSRequest();
$collect['body'] = $body;

$contentType = 'Content-Type';
$collect['contentType'] = $contentType;

$accept = 'Accept';
$collect['accept'] = $accept;

$client->createSendSMS($collect);
```

#### Errors

[](#errors-1)

Error CodeError Description500Internal Server Error### [![Method: ](https://github.com/d7networks/D7SMS-SDKs/raw/master/D7SMS-PHP/images/method.png ".APIController.createBulkSMS")](https://github.com/d7networks/D7SMS-SDKs/blob/master/D7SMS-PHP/images/method.png) createBulkSMS

[](#-createbulksms)

> Send Bulk SMS to multiple recipients using D7 SMS Gateway

```
function createBulkSMS(
        $body,
        $contentType,
        $accept)
```

#### Parameters

[](#parameters-1)

ParameterTagsDescriptionbody`Required`Message BodycontentType`Required`TODO: Add a parameter descriptionaccept`Required`TODO: Add a parameter description#### Example Usage

[](#example-usage-2)

```
$bodyValue = "{  \"messages\": [    {      \"to\": [        \"971562316353\",        \"971562316354\",        \"971562316355\"      ],      \"content\": \"Same content goes to three numbers\",      \"from\": \"SignSMS\"    }  ]}";
$body = APIHelper::deserialize($bodyValue);
$contentType = 'application/json';
$accept = 'application/json';

$client->createBulkSMS($body, $contentType, $accept);
```

[Back to List of Controllers](#list_of_controllers)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2104d ago

### Community

Maintainers

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

---

Top Contributors

[![ochui](https://avatars.githubusercontent.com/u/21917688?v=4)](https://github.com/ochui "ochui (2 commits)")

---

Tags

apisdkD7SMS

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ochui-d7sms/health.svg)

```
[![Health](https://phpackages.com/badges/ochui-d7sms/health.svg)](https://phpackages.com/packages/ochui-d7sms)
```

###  Alternatives

[bandwidth/sdk

Bandwidth's set of APIs

16948.8k1](/packages/bandwidth-sdk)[messagemedia/messages-sdk

The MessageMedia Messages API provides a number of endpoints for building powerful two-way messaging applications.

13390.6k](/packages/messagemedia-messages-sdk)

PHPackages © 2026

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