JavaScript

Send SMS using Javascript

  1. Using fetch API
firesms.js
async function sendSms() {
  const apiKey = "YOUR_API_KEY_HERE"
  const message = "Hello world"
  const phone = "26650112211"
 
  const HOST = "http://firesms.co"
  const apiResponse = await fetch(`${HOST}/api/v1/send/sms?apiKey=${apiKey}`);
  const responseData = await apiResponse.json();
  console.log({responseData})
}
sendSms();