Contribution of MSG91 towards MyShikshak

MyShikshak is a platform that works towards the advancement of our educational sector through (technologies, AI, ML, etc). All it needs is a quick two-step registration and the user is good to go. A user’s profile is created through which they can post or respond to a query, depending on whether they are a learner or a tutor. The registration process requires verification of the user’s contact number, and thanks to MSG91, the OTP is sent to user within a fraction of seconds.

We have been using MSG91’s OTP service to deliver our users the best experience.

We have set up the OTP service as described below, which is swift and easy.

The process has been described by our developer Kunal Yadav

We created a function that is solely responsible for sending OTPs. Since we are using Nodejs for the back-end I will demonstrate the Java-script code.

How it works

To send an OTP to a mobile you have to send a POST request to MSG91’s send OTP endpoint.

const http = require('http');

function sendOTP (phone, callback) => {
  let path = '/api/sendotp.php?otp_length=6&authkey=' + OTP_AUTH_KEY +
    '&message=&sender=MySHIK&mobile=+91'+ phone +'&otp_expiry=5';

  path = encodeURI(path);
  let options = {
    'method': 'POST',
    'hostname': '',
    'port': null,
    'path': path,
    'headers': {},

  let req = http.request(options, function(res) {
    let chunks = [];

    res.on('data', function(chunk) {

    res.on('end', function() {
      let body = Buffer.concat(chunks);
      try {
        callback(null, JSON.parse(body.toString()));
      } catch (err) {
        callback('Some error occurred');

Here I am using the http module to send a POST request. It’s a POST request but send the message details like the URL query string.

We can customize our OTP by the length, message, sender name, OTP expiration time.

That is what I am storing in the path variable. After storing, we also have to encode our URL.

Then we can send the request and handle the response via a callback.”

With the implementation of MSG91 for sending OTP, the registration process has become prompt as the user’s contact is instantly verified which is then used for logging in their account. We also use MSG91’s service to send text messages and updates regarding their query status, query response, profile updation and discounts to the user’s phone number.  MyShikshak is grateful to be sponsored by MSG91 and for using their text messaging service. We are proud to be among the list of prestigious companies that uses their service and their website can accessed here:

Leave a Reply

Your email address will not be published. Required fields are marked *