Discussions

Ask a Question
Back to All

SMS API RETURNS "undefined"

const request = require('request');  
const options = {  
  method: 'POST',  
  url: 'https://link.kiban.cloud/api/v2/twilio/sms',  
  headers: {  
    accept: 'application/json',  
    'content-type': 'application/json',  
    'x-api-key': 'production-api-key'  
  },  
  body: {  
    countryCode: '+52',  
    to: '55********',  
    message: 'Your verification code is the next: 1234'  
  },  
  json: true  
};

request(options, function (error, response, body) {  
  if (error) throw new Error(error);

  console.log(body);  
});

When I try to use the sms api, it returns "undefined".

All other APIs work, except sms api