Apply a function into all my active numbers

50 Views Asked by At

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

There are 1 best solutions below

3
IObert On

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.