CodeDrill Infotech's profile

Twilio Send Notification Messages (Nodejs SDK)

Twilio Send Notification Messages (Nodejs SDK)
1. Login to Twilio Dashboard and Click Messaging -> Get Setup
https://console.twilio.com/us1/develop/sms/services
2. Click Create Messaging Service and add your phone number.

3. Setup a notify service instance. Make note of the SID! You will use this later when you 
start writing code further down.

https://www.twilio.com/console/notify/services
** There isn’t a menu link fo rnotification service in new Twilio panel.

4. Now choose your new Messaging Service for this Notify Service Instance

5. We need three keys to send Notification message in twilio.

- accountSid
- authToken
- Service Instance SID

Account SID and Auth Token:
Go to Dashboard and click on Messaging Overview:
Get Service Instance ID: We have created SID above. You can go to this link and copy your Instance ID.

Note: Service Instance id will start with: ISxxxxxxxxxxxxxx

- Now we have all the details available, lets get into the code. Get the Official Nodejs sdk from twilio resouces.
https://github.com/twilio/twilio-node

- Clone the repo and run:
      npm install

- Create a file send_sms.js which you’ll run though node to trigger sms (this can be modified as per your usecase).
Create import-data.js and add your sms list into that:
- Go to terminal and run:
 node send_sms.js

It will queue all the messages at once and twilio will process the queue.

Twilio Send Notification Messages (Nodejs SDK)
Published:

Twilio Send Notification Messages (Nodejs SDK)

Published: