I am trying to send message through twiliousing
const accountSid = process.env.accountSid;
const authToken = process.env.authToken;
const client = require('twilio')(accountSid, authToken);
client.messages.create({
to:'+61XXXXXXXXX',
from:'+1XXXXXXXXX',
body:'ahoy hoy! Testing Twilio and node.js'
}, function(error, message) {
if (!error) {
console.log('Success! The SID for this SMS message is:');
console.log(message.sid);
console.log('Message sent on:');
console.log(message.dateCreated);
} else {
console.log(error, 'Oops! There was an error.');
}
}
Console returning
Success! The SID for this SMS message is:
XXXXXXXXXXXXXXXXX
Message sent on:
2022-02-24T05:29:25.000Z
But postman giving 500 status and giving following error
Converting circular structure to JSON
--> starting at object with constructor 'Twilio'
| property '_accounts' -> object with constructor 'Accounts'
--- property 'twilio' closes the circle
And not receiving msg on the specified number.