Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Make a Read Request to an External API

// Description
// Make a read request to an external API

// Add axios 0.20.0 as a dependency under Functions Settings, Dependencies
const axios = require('axios');

exports.handler = function (context, event, callback) {
  let twiml = new Twilio.twiml.VoiceResponse();

  // Open APIs From Space:
  // Number of People in Space
    .then((response) => {
      let { number, people } =;

      let names = =>;

      twiml.say(`There are ${number} people in space.`);
      twiml.say(`They are ${names.join()}`);
      return callback(null, twiml);
    .catch((error) => {
      return callback(error);
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.