How to Migrate from Twilio to MSG91?

Migrate from Twilio to MSG91

Welcome to MSG91! As you are looking for migration from your existing communication platform, we would like to bring you onboard with MSG91. We are glad to see you here and we appreciate your business.

MSG91s cloud communication platform offers powerful messaging solutions to empower business communications. 

MSG91 APIs are developer-friendly, globally scalable and super secured. We provide in-depth insights into the delivered messages. In addition, you can integrate contacts and use various pre-built plugins for complete customization and single-click integration with several SaaS platforms.

This reference guide is designed to integrate our REST APIs within minutes. We have included some sample codes to help you with the most common steps needed to integrate MSG91.

You can mail us at support@msg91.com or call 1800-121-2911 for queries or to speak to one of our API experts.

Lets Begin:

Step 1

Signup to MSG91 by clicking here, once logged in you can start building your applications on top of our API, to send actual messages your Demo account needs to be upgraded to a User account and will be done automatically once we complete our KYC process.

Step 2

Now that your account is active and ready, We recommend you to explore your dashboard. It's self intuitive, in case of any questions please reach out to us. We are there for you 18X7! Our bot is available 24*7.

Here is an example of the Twilio Send SMS code in PHP.

Base URL of Twilio API is :

For sending SMS - https://api.twilio.com/2010-04-01

Base URL of MSG91 is:

For sending single messages - https://api.msg91.com/api/sendhttp.php

For sending bulk messages - https://api.msg91.com/api/v2/sendsms

Below is a sample PHP code of Twilio,  which requires Account SID, Auth token, Twilio number, Client and Body

Below is a PHP sample code of MSG91. Parameters required here are Auth key, Mobiles, Country, Message, Sender and Route.

Few key things to remember - 

  • Authkey - Located on the Dashboard or Click on API located on the left side of the screen to get/generate your Authkey 
  • Country - Enter 91 for sending SMS in India, 1 for USA and 0 for international messages etc. (Depending on the country to which you wish to send SMS)
  • Mobile - Enter the mobile numbers here. We recommend you to use International format for sending SMS to mobile number i.e. Number with country code 91XXXXXXXX for India, 971XXXXXXX for UAE etc.. Do not add “0” or “+” along with the mobile numbers.
  • Message - Actual SMS content you want to send
  • Sender ID - This is your Sender ID which users will receive. Please click here to know regulations of specific countries on using Sender ID
  • Route - For sending promotional SMS enter the route value as “1” and for transactional SMS enter the route value as “4”.
  • Unicode - For messages other than English pass 1 else this will be 0. Also, it is recommended to encode the message content when sending unicode messages
  • Flash - For sending flash SMS enter the value as “1” else enter “0”
  • Schedule SMS - To schedule your SMS. You can choose your own time format. Examples of recommended time formats Y-m-d h:i:s (2020-01-01 10:10:00) Or Y/m/d h:i:s (2020/01/01 10:10:00) Or you can use unix timestamp (1577873400)
  • After minutes - You can use this if you want to send an SMS after a few minutes
  • Response - By default you will get response in string format but you want to receive in other formats (json,xml) then set this parameter, for example: &response=json or &response=xml.
  • Campaign - A campaign name is a Tag given to the messages you sent, for easy management of the reports. You can create a campaign name as per your choice. 

Advantage of using MSG91 over Twilio is that our codes do not require any prerequisites. There is no package installation required, without installation you can begin sending SMS. Twilio generates a response with all the details of which user has prior knowledge. MSG91 generates a Request ID which marks the successful hit of the message. All other details can be fetched anytime under the delivery report section. 

Still need help? Contact Us Contact Us