0

I am using msg91 Node.js API to send SMS. It is working fine if the message's text is in English. Now I want to send SMS in Hindi.

Problem is, if I don't encode the message, it returns Authentication error. Post encoding it says the message is sent, but I don't receive any message on the test target.

Error Message:

{ success: 'false',
  token: 'Authentication failure' }

Sample message is:

मोजो में आपका स्वागत है

npm module used: msg91

npm install --save msg91
DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
  • Now message is received ?????????????????? ???????????? which means that utf-8 encoding error is there while sending and encodeURI thing doesn't work for this. – prashantsudeep Sep 30 '16 at 10:32
  • Do you mean that you received the message after sometime? – Srijan Sep 30 '16 at 11:25
  • @prashantsudeep : which function are you using? – kadamb Sep 30 '16 at 13:15
  • cause for unicode message you are required to use this function : //send to single number msg91.sendOnewithUnicode(authkey,number,message,senderid,route,dialcode,function(response){ //Returns Message ID, If Sent Successfully or the appropriate Error Message console.log(response); }); – kadamb Sep 30 '16 at 13:16

2 Answers2

2

Sending SMS via msg91 is just a simple get call. You don't need to rely on a language specific API.

As long as you send unicode=1 in the get call you can insert hindi text in you messages.

For more information about the same read here - https://control.msg91.com/apidoc/textsms/send-sms.php

abhishek77in
  • 1,848
  • 21
  • 41
1

You can refer NodeJS package https://www.npmjs.com/package/springedge to send sms. You can install as

npm install springedge

Code example of sending sms:

// send sms 

var springedge = require('springedge');

var params = {
  'apikey': '', // API Key 
  'sender': 'SEDEMO', // Sender Name 
  'to': [
    '919019xxxxxxxx'  //Moblie Number 
  ],
  'message': 'test+message'
};

springedge.messages.send(params, 5000, function (err, response) {
  if (err) {
    return console.log(err);
  }
  console.log(response);
});

You will just need api key and trail account to use it. or you can customize it as per your requirement.