mData lets you create dynamic, data-driven applications on our platform. Either upload your database as a CSV or to make rich applications using SMS, just point us to your web service and we’ll handle all the messaging for you.
Using a Web Service
Request Parameters
Sample PHP Code
The easiest way to create them is to upload a CSV with all your information, but for those of you who want something a little more complex, you can specify the URL of a web service.
Using a Web Service
When you setup your mData, specify a URL instead of “Upload CSV”. We will ping that URL whenever we get a message and append ?args= to the end of the request. You can then parse the args parameter, generate a dynamic response, and return us XML as follows:
We will parse your XML and send the dynamic message back to the user.
Request Parameters
We will pass the following url parameters to your web service
| Request Parameters | |
|---|---|
| args | The args parameter will contain the body of the message sent by the user, with the keywords removed.For example, with a mData campaign that has a keyword CELSIUS,if a user sends CELSIUS 100, we’ll pass args=100 to your web service |
| phone | The phone parameter will contain the phone number of the user who sent the message. For example, we’ll pass phone=2125551234 to your webservice. |
| keyword | The keyword parameter will contain the keyword that the user actually texted to query your service. You can setup multiple keywords for a single mData program and customize your service to behave differently for each. Using the example above, we would send keyword=celcius to your web service. |
| profile_first_name | The first name of the user who texted in, if it’s in their Mobile Commons profile |
| profile_last_name | The last name of the user who texted in, if it’s in their Mobile Commons profile |
| profile_email | The email of the user who texted in, if it’s in their Mobile Commons profile |
| profile_street1 | The first line of the address of the user who texted in, if it’s in their Mobile Commons profile |
| profile_street2 | The second line of the address of the user who texted in, if it’s in their Mobile Commons profile |
| profile_city | The city of the user who texted in, if it’s in their Mobile Commons profile |
| profile_state | The state of the user who texted in, if it’s in their Mobile Commons profile |
| profile_postal_code | The 5 or 9 digit postal code of the user who texted in, if it’s in their Mobile Commons profile |
| profile_CUSTOM_FIELD | If you have custom fields setup for your profiles, they will be prefixed with profile_, such as profile_favorite_color=red |
| longitude | If your mData uses location-based queries, we will geocode the user’s query and send you the longitude/latitude, if available |
| latitute | If your mData uses location-based queries, we will geocode the user’s query and send you the longitude/latitude, if available |
Sample PHP Code
The following PHP code sample will take a value in Fahrenheit and convert it to Celsius.

