Difference between revisions of "Examples And Concepts"
Old-user20 (Talk | contribs) (→Receiving SMS) |
|||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=== SOAP API Usage === | === SOAP API Usage === | ||
Every function of the SOAP API that requires authentication must pass in Authentication Parameters, to acquire a set of Authentication Parameters, please use the API found at: http://api.upsidewireless.com/soap/Authentication.asmx | Every function of the SOAP API that requires authentication must pass in Authentication Parameters, to acquire a set of Authentication Parameters, please use the API found at: http://api.upsidewireless.com/soap/Authentication.asmx | ||
+ | |||
+ | The two values that are returned from the function are then used for every subsequent calls to the API. The Token parameter will never change for the life of the account whereas the Signature will change if your password changes. In most applications, you will store these variables in a constant or configuration store. | ||
=== Sending SMS === | === Sending SMS === | ||
+ | |||
+ | Sending an SMS can be handled by way of sending us an [[MT_SMTP_Auth| SMTP message]] or via [[MT HTTP | HTTP/SOAP Interface]]. | ||
=== Receiving SMS === | === Receiving SMS === | ||
The method of receiving Inbound SMS messages is by way of HTTP POST. A few variables are passed in the body of the POST. | The method of receiving Inbound SMS messages is by way of HTTP POST. A few variables are passed in the body of the POST. | ||
− | * name | + | * name - Username to which SMS came (useful if you have multiple accounts with our service) |
− | * sender | + | * sender - Mobile phone number of the sender. The number is international format (US and Canada this means 11-digit number starting with "1") |
− | * data | + | * data - Text of incoming SMS |
− | * carriercode | + | * [[Carrier_codes | carriercode]] - (shortcode accounts only) MCC/MNC identifying the sender's mobile network. You must store this with the number and pass it back when sending messages |
− | * inboundnumber | + | * inboundnumber - (for short/long code accounts only) Gateway number that received the message. This is useful if you have multiple dedicated numbers associated with your account |
− | + | ||
− | + | ||
+ | === Examples === | ||
+ | ==== Example 1 - No short code ==== | ||
You can use the following HTML to emulate what our server will send your service. | You can use the following HTML to emulate what our server will send your service. | ||
− | < | + | '''http://myurl.com/myaction?sender=17789999999&data=hello&name=username''' |
+ | |||
+ | <source lang="html4strict"> | ||
+ | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> | ||
+ | <html> | ||
+ | <head> | ||
+ | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
+ | <title>Received SMS Emulator (Via HTTP POST)</title> | ||
+ | </head> | ||
+ | <body> | ||
+ | <form id="emulator" name="emulator" method="post" action="http://sms.yourdomain.com/incoming.php"> | ||
+ | <table> | ||
+ | <tr> | ||
+ | <td>Sender:</td> | ||
+ | <td> | ||
+ | <input name="sender" type="text" id="sender" value="17789999999"/> | ||
+ | </td> | ||
+ | <td>sender</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Message:</td> | ||
+ | <td> | ||
+ | <input name="data" type="text" id="data" value="Hello"/> | ||
+ | </td> | ||
+ | <td>data</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>User Name:</td> | ||
+ | <td> | ||
+ | <input name="name" type="text" id="name" value="Account_Name"/> | ||
+ | </td> | ||
+ | <td>name</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td colspan="2" align="right"> | ||
+ | <input type="submit" name="Submit" value="Submit"/> | ||
+ | </td> | ||
+ | <td> </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | </form> | ||
+ | </body> | ||
+ | </html> | ||
+ | |||
+ | </source> | ||
+ | |||
+ | |||
+ | ==== Example 2 - Short code ==== | ||
+ | |||
+ | You can use the following HTML to emulate what our server will send your service. You will notice that in addition to the three standard variables, in this case carrier code as well as incoming gateway number are passed as parameters. | ||
+ | |||
+ | '''http://myurl.com/myaction?sender=17789999999&data=hello&name=username&inboundnumber=987333&carriercode=302370''' | ||
+ | |||
+ | <source lang="html4strict"> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> | ||
<html> | <html> | ||
Line 29: | Line 86: | ||
<td>Sender:</td> | <td>Sender:</td> | ||
<td> | <td> | ||
− | <input name="sender" type="text" id="sender" value=" | + | <input name="sender" type="text" id="sender" value="17789999999"/> |
</td> | </td> | ||
<td>sender</td> | <td>sender</td> | ||
Line 43: | Line 100: | ||
<td>User Name:</td> | <td>User Name:</td> | ||
<td> | <td> | ||
− | <input name="name" type="text" id="name" value=" | + | <input name="name" type="text" id="name" value="Account_Name"/> |
</td> | </td> | ||
<td>name</td> | <td>name</td> | ||
Line 50: | Line 107: | ||
<td>Inbound Number:</td> | <td>Inbound Number:</td> | ||
<td> | <td> | ||
− | <input name="inboundnumber" type="text" id="inboundnumber" value=" | + | <input name="inboundnumber" type="text" id="inboundnumber" value="987333"/> |
</td> | </td> | ||
<td>inboundnumber</td> | <td>inboundnumber</td> | ||
Line 57: | Line 114: | ||
<td>Carrier Code:</td> | <td>Carrier Code:</td> | ||
<td> | <td> | ||
− | <input name="carriercode" type="text" id=" | + | <input name="carriercode" type="text" id="302370"/> |
</td> | </td> | ||
<td>carriercode</td> | <td>carriercode</td> | ||
Line 72: | Line 129: | ||
</html> | </html> | ||
− | </ | + | </source> |
Latest revision as of 10:05, 15 August 2007
Contents
SOAP API Usage
Every function of the SOAP API that requires authentication must pass in Authentication Parameters, to acquire a set of Authentication Parameters, please use the API found at: http://api.upsidewireless.com/soap/Authentication.asmx
The two values that are returned from the function are then used for every subsequent calls to the API. The Token parameter will never change for the life of the account whereas the Signature will change if your password changes. In most applications, you will store these variables in a constant or configuration store.
Sending SMS
Sending an SMS can be handled by way of sending us an SMTP message or via HTTP/SOAP Interface.
Receiving SMS
The method of receiving Inbound SMS messages is by way of HTTP POST. A few variables are passed in the body of the POST.
- name - Username to which SMS came (useful if you have multiple accounts with our service)
- sender - Mobile phone number of the sender. The number is international format (US and Canada this means 11-digit number starting with "1")
- data - Text of incoming SMS
- carriercode - (shortcode accounts only) MCC/MNC identifying the sender's mobile network. You must store this with the number and pass it back when sending messages
- inboundnumber - (for short/long code accounts only) Gateway number that received the message. This is useful if you have multiple dedicated numbers associated with your account
Examples
Example 1 - No short code
You can use the following HTML to emulate what our server will send your service.
http://myurl.com/myaction?sender=17789999999&data=hello&name=username
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Received SMS Emulator (Via HTTP POST)</title> </head> <body> <form id="emulator" name="emulator" method="post" action="http://sms.yourdomain.com/incoming.php"> <table> <tr> <td>Sender:</td> <td> <input name="sender" type="text" id="sender" value="17789999999"/> </td> <td>sender</td> </tr> <tr> <td>Message:</td> <td> <input name="data" type="text" id="data" value="Hello"/> </td> <td>data</td> </tr> <tr> <td>User Name:</td> <td> <input name="name" type="text" id="name" value="Account_Name"/> </td> <td>name</td> </tr> <tr> <td colspan="2" align="right"> <input type="submit" name="Submit" value="Submit"/> </td> <td> </td> </tr> </table> </form> </body> </html>
Example 2 - Short code
You can use the following HTML to emulate what our server will send your service. You will notice that in addition to the three standard variables, in this case carrier code as well as incoming gateway number are passed as parameters.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Received SMS Emulator (Via HTTP POST)</title> </head> <body> <form id="emulator" name="emulator" method="post" action="http://sms.yourdomain.com/incoming.php"> <table> <tr> <td>Sender:</td> <td> <input name="sender" type="text" id="sender" value="17789999999"/> </td> <td>sender</td> </tr> <tr> <td>Message:</td> <td> <input name="data" type="text" id="data" value="Hello"/> </td> <td>data</td> </tr> <tr> <td>User Name:</td> <td> <input name="name" type="text" id="name" value="Account_Name"/> </td> <td>name</td> </tr> <tr> <td>Inbound Number:</td> <td> <input name="inboundnumber" type="text" id="inboundnumber" value="987333"/> </td> <td>inboundnumber</td> </tr> <tr> <td>Carrier Code:</td> <td> <input name="carriercode" type="text" id="302370"/> </td> <td>carriercode</td> </tr> <tr> <td colspan="2" align="right"> <input type="submit" name="Submit" value="Submit"/> </td> <td> </td> </tr> </table> </form> </body> </html>