0

I created a Autopilot bot in console of Twilio. I need to publish that bot to multiple phone numbers from an nodeJS endpoint. My questions are :

  1. How do i send the actions from an nodeJS app to initiate the conversation ?
  2. Can i send the bot to different numbers from that nodeJS app and get the individual responses as an callback.
Ram
  • 451
  • 10
  • 18

1 Answers1

1

Twilio developer evangelist here.

You can initiate a message with the bot using the Twilio REST API in the programming language of your choosing, like JavaScript, C#, PHP, Ruby, Python, or Java.

curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
--data-urlencode "Body=Hi there!" \
--data-urlencode "From=REPLACE-WITH-YOUR-TWILIO-NUMBER" \
--data-urlencode "To=+NUMBER-TO-TEXT" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

This cURL request initiates an outbound SMS. Then if you configure the Twilio number to an Autopilot bot, when the user responds, they will enter in to the bot dialogue.

You can publish the bot to multiple numbers either in the phone number console for each number and get the responses in the Autopilot request like with Memory.

lizziepika
  • 3,231
  • 1
  • 14
  • 23