PHPackages                             lucky/msg91 - 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. lucky/msg91

ActiveLibrary[API Development](/categories/api)

lucky/msg91
===========

Msg91 PHP api library.

0491PHP

Since Sep 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lucky541/Msg91)[ Packagist](https://packagist.org/packages/lucky/msg91)[ RSS](/packages/lucky-msg91/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[Msg91 PHP API Library](http://www.msg91.com)
=============================================

[](#msg91-php-api-library)

Msg91 PHP API Doc.

- Text SMS
- Send OTP
- Reseller
- Phonebook
- Virtual Number

### Install via composer

[](#install-via-composer)

- Step1: Add this dependency in the required section of the composer.json

```
 "lucky/msg91":"dev-master"

```

- Step1: After this run

```
compoer update

```

- Step3: After this is done you need to import the `vendor/autoload.php`.

> Note : Step3 is required only if the autoload file is not imported before.

### How to use

[](#how-to-use)

- Now you need to create an Object of Msg91's

> For creating an object of Msg91 you need to pass your Msg91's AuthKey. Thats all you are ready to explore all the functionalities that Msg91 offers.

```
 // create an object of msg91
 $msg91 = new \lucky\Msg91\Msg91('Msg91-User-Authkey');

```

> Note: Only few basic operations are only shown

#### Send Text SMS

[](#send-text-sms)

- An example to send text sms using Msg91's Object.

```
    $mobiles = "919999999999"; // mobile no. to whom you want to send sms. Including country code.
    $message = " your text sms will come up here"; // Message content to send
    $sender = "MSGIND"; // Receiver will see this as sender's ID.
    $route = "1"; // Route you want to use. 1 for promotional route and 4 for transactional route
    $country = "Country_code"; //numeric	0 for international,1 for USA, 91 for India.

    $data = array( "authkey" => AUTH_KEY,
                    "mobiles" => $mobiles,
                    "message" => $message,
                    "sender" => $sender,
                    "route" => $route,
                    "country" => $country,
                 );

    $output = $msg91->sendSMS($data);
```

#### Send OTP

[](#send--otp)

- An example to send Otp Message

```
    $mobile = "919999999999"; // Keep number in international format (with country code)
    $sender = "OTPSMS";   // Receiver will see this as sender's ID. (default : OTPSMS)

    // Message content to send. (default : Your verification code is ##OTP##.)
    $message = "Your verification code is ##OTP##.";

    $data = array( "authkey" => AUTH_KEY,
		   "mobile" => $mobile,
		   "message" => $message,
		   "sender" => $sender,
	         );

    $output = $msg91->otp->sendOTP($data);
```

### Reseller's Operations

[](#resellers-operations)

- #### Add Client

    [](#add-client)

```
    	$user_full_name     =   "fname lname";     //(varchar)	Full name of user
	$user_name          =   "user_name";   //(varchar) User's name
	$user_mobile_number =   "user_mobile_number";        //(int) User's mobile
	$user_email         =   "user_email";   //(varchar) User's email
	$user_company_name  =   "user_company_name";         //(varchar) User's company name
	$user_industry      =   "user_industry";         //(varchar) User's industry
	$user_expiry        =    "user_expiry";         //(int) Expiry date of user's account
	$user_country_code  =    "user_country_code";               //(int) User country code

	$data = array( "authkey" => AUTH_KEY,
	               "user_full_name" => $user_company_name,
	               "user_name"=> $user_name,
	               "user_mobile_number" =>$user_mobile_number,
	               "user_email" => $user_email,
	               "user_company_name"=>$user_company_name,
	               "user_industry"=> $user_industry,
	               "user_expiry" => $user_expiry,
	               "user_country_code" => $user_country_code,
	             );

	$output = $msg91->sendOTP($data);
```

- #### TO List Client

    [](#to-list-client)

```
    $data = array( "authkey" => AUTH_KEY  );

	$output = $msg91->listClient($data);
```

### Phonebook's Operations

[](#phonebooks-operations)

- #### Add Contact

    [](#add-contact)

```
    $name = "contact name";  //contact name
    $mob_no = "mobile no"; //mobile no.
    $group = "group ID"; // group ID

     $data = array( "authkey" => AUTH_KEY,
	            "name" => $name,
	            "mob_no" => $mob_no,
	            "group" => $group,
                  );

    $output = $msg91->addClient($data);
```

- #### Delete Client

    [](#delete-client)

```
    $contact_id="contact id";  //contact id
    $data = array( "authkey" => AUTH_KEY,
		   "contact_id" => $contact_id,
		 );

	$output = $msg91->deleteContact($data);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

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://avatars.githubusercontent.com/u/169755605?v=4)[luckybarkane](/maintainers/luckybarkane)[@luckybarkane](https://github.com/luckybarkane)

---

Top Contributors

[![lucky541](https://avatars.githubusercontent.com/u/19852724?v=4)](https://github.com/lucky541 "lucky541 (12 commits)")

### Embed Badge

![Health badge](/badges/lucky-msg91/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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