0

We created a function and now We want to apply this to all our active numbers but I couldn't find a way to change this in mass yet.

Is this posible ?

1 Answers1

0

There are multiple options:

  1. You can create a messaging service, configure the webhook there, and then add all your senders to it.

  2. You could use the API or Twilio CLI to write a script that fetches all active numbers and assigns the Function URL to them.

curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \
    --data-urlencode "VoiceUrl=http://functionURL.com/twilio" \
    --data-urlencode "BundleSid=BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
  1. You can use TwiML Apps for this.
IObert
  • 2,118
  • 1
  • 10
  • 17
  • 1
    thank you so much. I helped me a lot with this. We found another way pasting the function's url to the webhook of the Messaging Services. – Leandro Contigiani Feb 01 '23 at 19:35
  • I'm glad I could help. You're right, messaging services are also a good way for this. I modified the answer above to list it as well. Feel free to mark this answer as correct via the checkmark button to help others coming here. – IObert Feb 02 '23 at 09:08
  • 1
    Hi IObert I tried to mark as resolved but seems like I need at least 15 reputation to cast a vote. – Leandro Contigiani Feb 02 '23 at 15:46