This step-by-step guide is an upgraded version of our previous sms php api tutorial, written to make the implementation of SMS capabilities to your web app even quicker. You’ll go over three essential steps, each described in a separate section. Firstly, we’ll go over sending SMS messages, followed with retrieving of message logs and finally receiving the delivery reports.
The index page links to those three feature pages so you can easily navigate.
For your SMS web app to work properly you need to configure cash app database the PHP server. Since client library makes HTTP requests to Infobip API you will need to enable cURL PHP extension on your web server.
In order to run the application you can use some solution from AMP solution stack (wamp, xampp, …). Those are software stacks for various OSes consisting of Apache web server, MySQL database and PHP programming language support. You should enable phpcurl extension for the one you choose.

We advise you to install the composer – a simple tool that’ll help you to resolve PHP projects dependencies and simplify the process of downloading and usage of Infobip API client used in this project. Detailed instructions on how to install the composer can be found on their website and in this blog, we’ll cover the practical part.
Note: To ensure secure sending of SMS messages, these examples should be hosted on HTTPS (using TLS) when going live. Just for sake of simplicity, in this tutorial we used plain HTTP.
Infobip API client
In order to use Infobip API client library you need to download it into your project. To ease this process, we recommend you use the composer. With it, all you have to do is to define a version of the client you wish to use. You do that in a special file named composer.json:
With the composer.json file in place you can instruct composer to fetch listed dependencies by running the following command from the terminal:
Now, there should be a directory named vendor next to the composer.json file. If you look inside it there is a file named autoload.php that will come in handy later. Additionally, vendor directory has separate subdirectories for Infobip API client library code and it’s dependencies.
Send SMS message
The fully featured textual message page ( advancedSms.php ) contains the input form for sending an SMS message. Required fields are username, password and destination phone number, all other values are optional. For additional explanation of notify URL content type and callback data see the Receive delivery report chapter. Submit button will send the request to a page specified in action attribute of the form. In this example it will post it to itself.
Before you make an API call, you should check if the user sent all the fields that we need. In this example we have only checked toInput field. You don’t have to check them all because not all of the properties are required by the API and any missing properties will simply be ignored by the client. If you’re loading the page for the first time keep in mind that these fields won’t be present.