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

ActiveLibrary

anburocky3/msg91-php
====================

Send SMS seamlessly fast with the help of MSG91 Provider in PHP.

v1.0.1(5y ago)012[1 PRs](https://github.com/anburocky3/MSG91-PHP/pulls)MITPHPPHP ^7.4|^8.0

Since May 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/anburocky3/MSG91-PHP)[ Packagist](https://packagist.org/packages/anburocky3/msg91-php)[ Docs](https://github.com/anburocky3/msg91-php)[ RSS](/packages/anburocky3-msg91-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Send SMS Seemlessy with MSG91
=============================

[](#send-sms-seemlessy-with-msg91)

*This library requires a minimum PHP version of 7.4*

[![Latest Version on Packagist](https://camo.githubusercontent.com/327d7d19a701ce3e0850f5d5f5ca7bc8c4ab0f46f3d9bedc90792e49076db051/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e6275726f636b79332f6d736739312d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anburocky3/msg91-php)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4388e2fd918c0d4e534468cca2ca7315317bef02b86bd91361ef7bb2efcd5560/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f616e6275726f636b79332f6d736739312d7068702f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/anburocky3/msg91-php/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/af4ce2eb15ef14bf40020e4397066ec7e89327fca5214279e7be68a4d96fbb14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e6275726f636b79332f6d736739312d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anburocky3/msg91-php)[![Follow Anbuselvan Rocky](https://camo.githubusercontent.com/012c3cec209a9b5a8025aaf4801bf4504b4f2b285457f27167d46cb33db55bc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f616e6275726f636b79333f7374796c653d736f6369616c)](https://github.com/anburocky3)

[![Msg91 API integration](https://camo.githubusercontent.com/490e751470fb164f0bc7d40ea80a629443d5a35fba685929aa1181f6996285c4/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f3736382f312a7133636a73786a6758773871365358333474386a59672e706e67)](https://camo.githubusercontent.com/490e751470fb164f0bc7d40ea80a629443d5a35fba685929aa1181f6996285c4/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f3736382f312a7133636a73786a6758773871365358333474386a59672e706e67)

This is a **PHP Client** for [Msg91 APIs](https://docs.msg91.com/collection/msg91-api-integration/5/pages/139). Before using it, please make sure you have an account on [Msg91](https://msg91.com/) and have an **Authkey** (Msg91 Dashboard &gt; API &gt; Configure).

> **NOTE**: The project is under active development and so, some apis are subjected to change.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Create a Client](#create-a-client)
    - [Configuration](#configuration)
    - [OTP and SMS Services](#otp-and-sms-services)
- [Examples](#examples)
    - [Managing OTPs](#managing-otps)
        - [Send OTP](#send-otp)
        - [Verify OTP](#verify-otp)
        - [Resend OTP](#resend-otp)
    - [Sending SMS](#sending-sms)
        - [Message Variables](#message-variables)
        - [Receiver Key](#receiver-key)
    - [Handling Responses](#handling-responses)
- [Related](#related)
- [Acknowledgements](#acknowledgements)

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

[](#installation)

The packages is available on [Packagist](https://packagist.org/packages/anburocky3/msg91-php) and can be installed via [Composer](https://getcomposer.org/) by executing following command in shell.

```
composer require anburocky3/msg91-php
```

Usage
-----

[](#usage)

If you're using Composer, make sure the autoloader is included in your project's bootstrap file:

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

Now the client can be initialised by passing a [configured](#configuration) object to the constructor.

```
$config = [
  'key' => "123456789012345678901234",
];
$client = new Anburocky3\Msg91\Client($config);
```

The package in distributed under `Anburocky3\Msg91` namespace which can used if your are working in a namespace environment.

```
