Leandro Contigiani
Leandro Contigiani

Reputation: 1

Apply a function into all my active numbers

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 ?

Upvotes: 0

Views: 50

Answers (1)

IObert
IObert

Reputation: 3841

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.

Upvotes: 0

Related Questions