For a full integration of our service, you must be able to send us your SMS requests, but also to receive the information related to your sendings. We have 3 types of information to send you:
- Acknowledgements of Receipt (if you use SMS Premium)
- Replies or Incoming SMS to your SMS (if you have activated and requested the option)
- Some Opt-out (requests to unsubscribe)
- To do so, you will have to provide the same or different URLs that will be called by our servers to transmit this information to you.
To do so, you will have to provide the same or different URLs that will be called by our servers to transmit this information to you.
Where to set up those URLs ?
In your interface, on the left-hand side of your menu, you will have a “Callbacks” link.
For each type of callback, you can then define the URL to which they will be sent. This URL should respond in about 1 second, and should not give any return. In order not to waste resources, your script should only record the data. You will then need to provide another process to process the data, asynchronously.
Those callbacks are made by HTTP POST request.
They can be three different URLs, or a single URL, in which you will differentiate the treatments according to the received fields.
Example : You can easily identify the type of callback according to whether you receive answer_date, DELIVERY_DATE or stop_date.
The page targeted by the URL you provide must not display anything, not even a blank HTML body.
It must also respond in less than 1 second. The data received must be processed asynchronously.
- Save the received data in the database.
- Activate a script/services/cron that will process this data.
This allows us to access the exchanges between our servers and your server(s) without unnecessarily overloading the connections.
- Test your page before sending it to us, by calling it with a CURL command for example.
- Disable the display of errors (to avoid errors such as warning, notice, fatal, etc.).
- Do not display any messages, but redirect them to a log file.
- Finally, for better performance, process the received data asynchronously: simply save the data somewhere (file or db-table) and delegate the processing to another script (cron or trigger).