PHPackages                             ditsly/dits-sms-api - 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. ditsly/dits-sms-api

ActiveLibrary[API Development](/categories/api)

ditsly/dits-sms-api
===================

DITS SMS API is build for DITS SMS - Bulk SMS Application For Marketing

2.7.0(5y ago)011MITPHPPHP &gt;=5.3.0

Since Mar 4Pushed 5y agoCompare

[ Source](https://github.com/ditsly/dits-sms-api)[ Packagist](https://packagist.org/packages/ditsly/dits-sms-api)[ RSS](/packages/ditsly-dits-sms-api/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

DITS SMS API
============

[](#dits-sms-api)

DITS SMS API is build for DITS SMS - Bulk SMS Application For Marketing

### Prerequisites

[](#prerequisites)

To run DITS SMS API you have to install DITS SMS Application on your server.

```
php >=5.6
DITS SMS - Bulk SMS Application For Markting

```

### Installing

[](#installing)

Via Composer

```
composer require ditsly/dits-sms-api

```

And Via Bash

```
git clone https://github.com/dits/dits-sms-api.git

```

Usage
-----

[](#usage)

### Step 1:

[](#step-1)

If install DITS SMS API using Git Clone then load your DITS SMS API Class file and Use namespace.

```
require_once 'src/Class_DITS_SMS_API.php';
use DitsSMS\DitsSMSAPI;
```

If install DITS SMS API using Composer then Require/Include autoload.php file in the index.php of your project or whatever file you need to use **DITS SMS API** classes:.

```
require 'vendor/autoload.php';
use DitsSMS\DitsSMSAPI;
```

### Step 2:

[](#step-2)

set your API\_KEY from `https://sms.dits.ly/sms-api/info`

```
$api_key = 'YWRtaW46YWRtaW4ucGFzc3dvcmQ=';
```

### Step 3:

[](#step-3)

Change the from Sender ID below. It can be your valid Sender ID

```
$from = 'DITS';
```

### Step 4:

[](#step-4)

the number we are sending to - Any phone number

```
$destination = '21892XXXXXXX';
```

For multiple number please use Comma (,) after every single number.

```
$destination = '21892XXXXXXX,21891XXXXXXX,21892XXXXXXX,21892XXXXXXX';
```

You can insert maximum 100 numbers using comma in single api request.

You have to must include Country code at beginning of the phone number.

### Step 5:

[](#step-5)

```
$url = 'https://sms.dits.ly/sms/api';
```

// SMS Body

```
$sms = 'Test Message From DITS SMS';
```

// Unicode SMS

```
$unicode = '1'; //For Unicode message
```

// Voice SMS

```
$voice = '1'; //For voice message
```

// Schedule SMS

```
$schedule_date = '02/17/2021 10:20 AM'; //Date like this format: m/d/Y h:i A
```

// Create Plain/text SMS Body for request

```
$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms
);
```

// Create Unicode SMS Body for request

```
$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms,
    'unicode' => $unicode,
);
```

// Create Voice SMS Body for request

```
$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms,
    'voice' => $voice,
);
```

// Create MMS SMS Body for request

```
$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms, //optional
    'mms' => $mms,
    'media_url' => $media_url,
);
```

// Create Schedule SMS Body for request

```
$sms_body = array(
    'api_key' => $api_key,
    'to' => $destination,
    'from' => $from,
    'sms' => $sms,
    'schedule' => $schedule_date,
);
```

### Step 6:

[](#step-6)

Instantiate a new DITS SMS API request

```
$client = new DitsSMSAPI();
```

Send SMS
--------

[](#send-sms)

Finally send your sms through DITS SMS API

```
$response = $client->send_sms($sms_body, $url);
```

Get Inbox
---------

[](#get-inbox)

Get your all message

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

Get Balance
-----------

[](#get-balance)

Get your account balance

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

Response
--------

[](#response)

DITS SMS API return response with `json` format, like:

```
{"code":"ok","message":"Successfully Send"}
```

Status Code
-----------

[](#status-code)

StatusMessage`ok`Successfully Send`100`Bad gateway requested`101`Wrong action`102`Authentication failed`103`Invalid phone number`104`Phone coverage not active`105`Insufficient balance`106`Invalid Sender ID`107`Invalid SMS Type`108`SMS Gateway not active`109`Invalid Schedule Time`110`Media url required`111`SMS contain spam word. Wait for approvalAuthors
-------

[](#authors)

- **Dimensions Technology** - *Initial work* - [ditsly](https://github.com/ditsly)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

1899d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a129b98d9d423fb8ade28dc02e559c7407e38ab6f8f12b5a1cf014bdad1462c?d=identicon)[ditsly](/maintainers/ditsly)

### Embed Badge

![Health badge](/badges/ditsly-dits-sms-api/health.svg)

```
[![Health](https://phpackages.com/badges/ditsly-dits-sms-api/health.svg)](https://phpackages.com/packages/ditsly-dits-sms-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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