Closed diegoaguilar closed 8 years ago
What "FROM" number are you using to send this message?
Some of the constraints to be aware of :
New accounts can only send to numbers that have been verified in the dashboard, and 'Nexmo Demo' will be added to all messages. Once you've added funds to your account, those restrictions will be removed.
Well I'm using a placeholder text as the "FROM" number, and eventhough I've not purchased any numbers, I've already bought credits.
I achieved sending SMS with this code:
function requestSMS(key, secret, text, from, to, options) {
options = options || {};
var post = {
api_key: key,
api_secret: secret,
from: from,
to: to,
text: text.toString(),
};
if (options.debug) {
winston.debug('About to send SMS from % to %', from, to);
winston.debug(post);
}
request.post(
'https://rest.nexmo.com/sms/json',
{ form: post },
(err, httpResponse, body) => {
if (err && options.debug) {
winston.debug('Request to send SMS failed');
winston.debug(err);
} else if (options.debug) {
winston.debug(body);
}
});
}
Are you saying that you were able to send a message using the direct API call and its not working with the NPM package easynexmo with the same set of parameters (key, secret, from and to)?
Yep, exactly that :( On Mar 2, 2016 12:29 AM, "prabhu" notifications@github.com wrote:
Are you saying that you were able to send a message using the direct API call and its not working with the NPM package easynexmo with the same set of parameters (key, secret, from and to)?
— Reply to this email directly or view it on GitHub https://github.com/pvela/nexmo/issues/32#issuecomment-191087950.
@pvela any opinions or suggestions?
@diegoaguilar Tried many times but couldn't replicate the problem. After taking a closer look at your output from the initial paste it looks like you are connecting to port 80, which is not the correct port to connect to. Can you verify if you are using the latest version of the library and check if you have overwritten the port from 443 to 80.
So, I have credits in my nexmo account, I'm trying to send an SMS and with
debug
mode on, I can see:I've confirmed the api key and the api secret, but any SMS is being sent. Suggestions?