Enable your site administrator to launch an SMS marketing campaign using the mobile numbers of your customers who opt-in to receive such information.
Learn how to send the same text message to a list of your customers (for example, marketing or event notification) right from your web site.
This PHP sample application demonstrates how to create a web form that sends bulk SMS to the specified mobile phone numbers. In this tutorial, we will show you the HTML form that accepts a message and a list of recipient numbers, and the code that sends the message via SMS to these mobile numbers at one click and checks message delivery statuses by using Apifonica API.
Click here to download the source (case02.php), which includes everything you need for this tutorial.
The file contains an HTTP form to be displayed to the site administrator who will run the SMS campaign. It also has the functions that send your marketing content via SMS messages to all mobile numbers specified by the administrator, and check SMS delivery statuses.
The following diagram demonstrates how the sample works.
In the downloaded case02.php file, specify the default parameter values:
It is recommended that you use an alpha name as the sender’s number. You can register an alpha name in the the personal account.
// Specify Apifonica API URL
$api_url = 'https://api.apifonica.com';
// Specify your Apifonica account SID
$accountSID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
// Specify your Apifonica account password
$password = 'XXXXXXXXXXXX';
// Specify the message sender's number or alpha-name (this number must belong to the Apifonica account you have specified)
$from = '883XXXXXXXXXXXX';The data you have specified will now be used for sending SMS messages: your Apifonica account will be charged for outgoing SMS messages sent from the web to those mobile numbers you specify in the web form.
Fill in the fields in the web form and click Send Your Message to send a message notification to multiple recipients via SMS from the browser.
Click the Update Delivery Status button to see that your message is sent and then delivered to your customers’ mobiles.
Enable your site visitors to call mobile numbers while they are on the site.
The following guide explains how to create a web form that enables users to make calls to a specified number via a REST API request.
Download sourceThis PHP sample application demonstrates the creation of a web contact form that calls a specified mobile number from your Apifonica account. The call is made using the data the user specifies in the form. Call status is then checked using Apifonica API.
Click here to download the source (call.php), which includes everything you need in this example.
The file contains an HTTP form to be displayed to site visitors, as well as the backend function to make the call to the predefined mobile number and check its status.
The following diagram demonstrates how the sample works.
Copy the source code file you have downloaded to a directory on your web server capable of serving PHP code
Fill in the fields in the web form. You will need to fill out the following fields:
Click the Make Your Call button to execute the call from your browser. The mobile phone you have specified in the input form should receive the call shortly.
The Apifonica account with the credentials you have provided will be charged for the outgoing calls from your web server to the mobile number(s) you have specified.
Click the Check Your Call Status button to verify that your call has been successfully created.
This article describes how you can use APIFONICA API to obtain a phone number and initiate a voice call by the example of ZoiPer — a free VoIP SIP softphone dialer.
Rent an Apifonica Głos phone number to be used for calling:
Change the default mode and the default password of the rented number (password for outbound and inbound calls has to be the same, you will need this password during account creation in ZoiPer):
Use the server, login and password details from the “Settings”, “SIP Connection” section of your personal profile.
Username: [email protected] – where 1423 is the SIP number from your personal profile
Password: your SIP number password, from the “SIP Connection” section of your personal profile
After entering the details click “Login”.
Enter the sip-eu.apifonica.com server address on the next page and click “Next”.
There is no need to enter the settings on this page, click “Skip”.
On the next page, Zoiper will attempt to find the priority transport for your network. Select SIP UDP or SIP TLS and click “Next”.
You can test the audio devices on the next page. The setup is now complete.
*Important! You will be charged for the calls in accordance with the tariffs.
Note You can also use any softphone application of your choice.
Enable your site visitors to contact you by sending SMS messages.
Learn how to build a contact form on a website that will send user requests via SMS to a predefined phone number belonging, for example, to the sales or support team.
Download sourceThis PHP sample application demonstrates how to create a web contact form that sends SMS to the specified mobile phone number. In this tutorial, we will show you the HTML form that accepts user messages and the code that sends these messages via SMS and checks message delivery statuses by using Apifonica API.
Click here to download the source (case.php) which includes everything you need for this tutorial.
The file contains an HTTP form to be displayed to site visitors, and also the functions to send user input via SMS messages to the predefined mobile number and check SMS delivery statuses.
The following diagram demonstrates how the sample works.
In the downloaded case file, specify the default parameter values:
// Specify Apifonica API URL
$api_url = 'https://api.apifonica.com';
// Specify your Apifonica account SID
$accountSID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
// Specify your Apifonica account password
$password = 'XXXXXXXXXXXX';
// Specify the message sender's number (this number must belong to the Apifonica account you have specified)
$from = '883XXXXXXXXXXXX';
// Specify the mobile number to receive SMS messages sent from the web form
$to = 'XXXXXXXXXX';The data you have specified will now be used for sending SMS messages: your Apifonica account will be charged for outgoing SMS messages sent from the web to the predefined mobile number.
Fill in the fields in the web form and click the Send Your Message button to send the SMS message from the browser.
Click the Update Delivery Status button to see that your message is sent and then delivered to your mobile.
Rent an Apifonica Głos phone number to link it with soft/hard phones:
Change the default mode and the default password of the rented number:
Using Console: make the PUT request to /accounts/{accountSID}/numbers/{numberSID} (Change number properties)
curl –X PUT ‘https://api.apifonica.com/v2/accounts/{accountSID}/numbers/{numberSID}’
-H ‘Content-Type: application/json’
-d ‘{
"sip_password":"qwerty12345",
"mode":"sip_phone"
}’
-u {accountSID}:{authToken}{
"status_code": 200,
"status_message": "OK",
"uri": "/accounts/{accountSID}/numbers/{numberSID}"
}To register a sip soft/hard phone in the Apifonica platform you need to specify:
For more details please refer to Configuring Zoiper to make a SIP call using Apifonica How-To.
Now your soft/hard phone is ready to make and receive the calls via Apifonica platform.
Create a simple XML file with a number you want to call. Example:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<makeCall>
<number>35315313424</number>
</makeCall>
</response>Full Apifonica XML format can be found here. Upload ready XML to your server
Create an application:
Associate your XML with the created Application:
Making the calls using Console (Make voice call):
Making the callback using personal account:
After that the call is connected between the soft/hard phone and the other local or mobile number.
Detailed instructions on creating XML files and applications can be found here.
Making the callback using Console (Make voice call):
Making the parallel call using personal account:
You can implement this functionality into virtually everything that supports html. For example, setting up a simple website allows you to have plain text link to it directly in your company’s e-mails.
Create a simple XML file and upload the created XML to your server.
The XML file to be used for parallel calls should look as follows:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<makeCall>
<number>883xxxxxxxxxxx1</number>
<number>883xxxxxxxxxxx2</number>
</makeCall>
</response>where 883xxxxxxxxxxx1 and 883xxxxxxxxxxx2 are numbers you are calling in parallel.
Create an application and associate the XML file you have created with it.
Detailed instructions on creating XML files and applications can be found here.
Making the parallel call using console (Make voice call):
Making the parallel call using personal account:
You can embed this functionality into virtually anything that supports HTML.
Add one more layer of security to your web site with the account verification feature, and also keep your customer personal phone number up to date.
Learn how to implement phone number verification functionality on your web site by using Apifonica API.
Download sourceThis PHP sample application demonstrates how to create a web site signup form that verifies user mobile number.
The user registration process will be the following:
In this tutorial, we will show you the HTML form that accepts user data and verification code, and the functions that send this code via SMS to the user’s mobile number and check the code validity.
Click here to download the source (case03.php), which includes everything you need for this tutorial.
The file contains an HTTP signup form to be displayed to the users desiring to register at your web site. The file also has the functions that generate five digit verification code, send it as an SMS message to the mobile number specified by the user, and check if the entered verification code is valid.
The following diagram demonstrates how the sample works.
In the downloaded case03.php file, specify the default parameter values:
It is necessary that you use a mobile number as the sender’s number. Enter it with the area code, but without a plus sign in the beginning.
// Specify Apifonica API URL
$api_url = 'https://api.apifonica.com';
// Specify your Apifonica account SID
$accountSID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
// Specify your Apifonica account password
$password = 'XXXXXXXXXXXX';
// Specify the message sender's number (this number must belong to the Apifonica account you have specified)
$from = '883XXXXXXXXXXXX';
// Specify the mobile number to receive SMS messages sent from the web form
$to = 'XXXXXXXXXX';The data you have specified will now be used for sending SMS messages with verification codes: your Apifonica account will be charged for outgoing SMS messages sent from the cloud to the mobile numbers your users specify in the web form.
Fill in the fields in the web form and click Send Verification Code in order to generate a one-time verification code and send it to the mobile number you have specified. Include the area code, but omit the plus sign.
After you receive an SMS with the code, enter it and click the Proceed button to complete the registration.
In case you enter the valid code, the registration process is successfully completed.
Zobacz, jak Apifonica może pomóc zautomatyzować komunikację z klientem i skalować się z pewnością.