Here is a brief explanation of the demos in this repo and what you need to do to get started 🎉
Get your account information and process the balance information. If you balance is below a certain amount send an email yourself. You could set a cron job on this script to check your balance as frequently as you need.
- Change
$username
and$password
to your own credentials. - Add your email adress.
Make a phone call to a number. If connected, attempt to connect to another number.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Change
$username
and$password
to your own credentials. - Assign
from
to your allocated number. Assignto
to your regular phone number. Assignconnect
to the number of the person you want to call. - Run the script and your phone will start ringing.
- Answer the call.
- When answered, the call will connect to the person you want to call.
Make a phone call to a number. If connected, play a sound file from a URL.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Change
$username
and$password
to your own credentials. - Assign
from
to your allocated number. Assignto
to your regular phone number. Assignplay
to the URL of the sound file. - Run the script and your phone will start ringing.
- Answer the call and you will hear the sound play.
Same as call-and-connect. In this demo the code is added to a website that allows you to enter your phone number in a field to receive a call and connect it.
Set up a group messaging function. Within the same script you can create multiple SMS groups and send dynamic messages to each member within the group.
- Allocate one or more numbers using the /Numbers REST resource or via the dashboard.
- Assign a group for each allocated number. (see example in the PHP-file).
- Assign each group a list of members by adding name and number. Be sure to add own name and number if you want to be a part of the group conversation. (see example in the PHP-file).
- Change
$username
and$password
to your own credentials. - Configure
sms_url
on the number you allocated previously, with your script URL. - Send a text from your phone to one of your allocated number, e.g
+46761070124
and every member within that group will receive your text.
Let your server receive incoming SMS from your customers and respond with opening hours for your business/service etc.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Configure
sms_url
on the number you just allocated, with your script URL. - Send a text to your allocated number and you will get a text back with the opening hours.
You can write anything in your text. For instance; ”When are you open?”, ”Hello”, ”Open” etc. You could also configure the script to send different responses based on the content within the text. For instance ”today” could send todays opening hours, ”tomorrow” could send tomorrows opening hours and ”Sunday” could send the Sundays opening hours.
A basic example of an outgoing phone call with PHP where the post request is using cURL.
A basic example of sending SMS with PHP where the post request is using cURL.
Receive incoming phone calls on your server. If the call is received between opening hours, transfer the call to the business owner. If not, play an audio file informing the caller you are closed. Also send an SMS to inform the business owner of the missed call.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Configure
voice_start
on the number you just allocated, with your script URL. - Add the URL of your audio file in the script.
- Add the number of the business owner in the script.
- Test the solution by calling your allocated number from your regular phone.
Be notified by email when someone tried to call you.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Add your email in the script.
- Configure
voice_start
on the number you allocated, with your script URL. - Make a call from your regular phone to your allocated number and you will get an email.
Receive an incoming SMS on your sever and send an email to yourself with contents of the message.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Add your email in the script.
- Configure
sms_url
on the number you allocated, with your script URL. - Send a text to your allocated number and you will get an email with the SMS contents.
This script will get a list of phone numbers from a Notion database and send an SMS to each number.
For more info, please see our tutorial Send SMS from Notion.
A basic example of sending SMS.
- Change
$username
and$password
to your own credentials. - Add the number you want to send the SMS to and include a message.
- Run your script.
A script that parses your accounts information to print out the cost of your virtual phone numbers.
- Change
$username
and$password
to your own credentials.
Fetch and print your entire SMS history or fetch SMS from specific dates with the parameters start
and end
.
- Change
$username
and$password
to your own credentials. - Define
start
andend
if needed.
Save incoming SMS to a textfil and display the message content along with the sender on a webpage.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Configure
sms_url
on the number you just allocated, with your script URL. - Be sure your web server has write access to the directory in which you want to save the text file.
- Open up your script in a browser and send an SMS to your allocated number. You will see the SMS appear on the screen.
Create a custom voicemail.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Add the URL of your voicemail audio file in the script.
- Configure
voice_start
on the number you allocated, with your script URL. - Call your allocated number.
Send a reoccurring SMS every week (or every day, every third day, every month. Whatever suits you the best 😊).
- Change
$username
and$password
to your own credentials. - Add recipients to receive the SMS.
- Add a cron job on your server to call this script as frequently as you wish.
A simple example on what to do when the call is hung up.
- Change
$username
and$password
to your own credentials. - Add your own instructions on what to do when the call is hung up.
Whisper is the common term for playing a message before transferring a call to the actual destination.
- Allocate a number using the /Numbers REST resource or via the dashboard.
- Configure
voice_start
on the number you allocated, with your script URL. - Add the URL of your audio file in the script.
- Call your allocated number.