Creating virtual phone numbers through Twilio

Hey :wave:

I was curious to know if anyone’s had experience using a Twilio plugin to create virtual phone numbers.

I’m interested in creating a product that allows users to select a country their country, then generate a unique virtual phone number.

Looking over Twilio’s documentation, it might be possible with the API connector, but would prefer to run this through an existing plugin if possible.

Would appreciate any insights.

Hey @lachlankirkwood1,

I was just actually looking through for some Twilio plugins because I was lazy to add it to my API connector, but only found SMS and Voice calling plugins. I don’t think there are any out there to create virtual phone numbers :frowning:, but I could be wrong.

Appreciate it. I just spent some time exploring the existing plugins and came to the same conclusion.

I think the API connector will be my best bet.

You can do this, use phone number api inside Twilio.
We have this setup fully in our app, if you need help let me know and we can get on a zoom call.

Use a data get call to get the available phone numbers in an area.
https://api.twilio.com/2010-04-01/Accounts/[AccountSID]/AvailablePhoneNumbers/[country]/Local.json?PageSize=100&Voice=[Voice]&SMS=[SMS]&MMS=[MMS]&address_requirements=[address_requirements]&NearNumber=[NearNumber]

After you have a number you want then you need to provision it (add it to the Account)

https://api.twilio.com/2010-04-01/Accounts/[AccountSid]/IncomingPhoneNumbers.json

1 Like

This is great, thanks for sharing!

These screenshots are super helpful. I’ll experiment with these requests and let you know if I run into any troubles.

I do have one last question. Have you had any experience with sending a text received by a virtual number into Bubble?

I’m under the impression this event will be triggered on Twillio’s end, as I’d need to constantly make requests every minute if I was sending the request through Bubble.

Would appreciate if you have any insights on this!

You will setup a receive text endpoint in your backend workflows that catch twilio webhooks, I’ll screenshots shortly. Also you’ll need additional webhooks for things like “number is contacted” so you can forward from virtual number to real number when it’s called.

No need to do recurring calls, webhooks handle it.

1 Like

Perfect, thanks again. It’d be great to check out a screenshot when you get the chance.

Genuinely appreciate your input on this one.

You’ll set up a ReceiveText endpoint in your backend workflows that captures sms-man.com
webhooks. Also you will need additional webhooks for things like “number has been contacted”.

Hey Chris,
I am trying to alow users to purchase a Twilio number and I am lost.
can you post the guide?