Share via

Send an SMS Message Quickstart

For full instructions on how to build this code sample from scratch, look at Quickstart: Send an SMS Message

Prerequisites

Code Structure

  • ./send-SMS/send-sms.js: Core application code with send SMS implementation.

Before running sample code

  1. Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you'd like to clone the sample to.
  2. git clone https://github.com/Azure-Samples/Communication-Services-javascript-quickstarts.git
  3. With the Connection String procured in pre-requisites, follow instructions to add it to your environment variables.
  4. With the SMS enabled telephone number procured in pre-requisites, add it to the send-SMS/send-sms.js file. Assign your telephone number in line 7: from: "<from-phone-number>",
  5. Add a phone number to send the SMS to in line 8: to: ["<to-phone-number-1>", "<to-phone-number-2>"],

Run Locally

  1. Run the app using node send-sms.js