Technical Success Manager Cassie Bowles
Why do you need it?
At some point, you may need to release a large amount of numbers in order to purchase new ones. This can be tedious to delete one by one, so this example shows one way that you can release numbers in bulk with ease.
What does it do?
This code snippet will search through all of the numbers on your account and return/release those with a specific keyword in their name.
What variables change
ProjectID - Your project ID is an alphanumeric string that tells the SignalWire SDK where to find your project. You can find this in an easily copyable format by going to yourSignalWire Portal and clicking the API tab on the left hand side.
AuthToken - Your Auth Token is an alphanumeric string that helps to authenticate your HTTP requests to SignalWire. You can create this (if you haven’t already) or copy this in an easily copyable format by going to your SignalWire Portal and clicking the API tab. If you have not created an API token, press the blue new button. If you have, click show and copy the string.
SpaceURL - Your space URL is the domain of your space, i.e. example.signalwire.com. This can also be found in an easily copyable format within the API tab in your SignalWire space.
You will need to change the keyword in this script to whatever keyword you want the script to search your numbers for.
Step by step guide with the code
Here is an example of a Ruby script to be used to delete numbers that contain a specific word (delete all numbers whose names contain the word “DELETE” for example).
Getting Started Guide
If you are looking for more information about using SignalWire, refer to our Getting Started guide.
Please feel free to reach out to us on our Community Slack or create a Support ticket if you need guidance!
Start a free trial
If you would like to test this example out, you can create a SignalWire account and space here.