You can authenticate 2 ways: programatically or manually. To program in authentication into your application/webpage POST to the
/components/[Component Name]/auth or the /services/auth URL. Alternately you can
navigate, with your browser, to any URL and you will be prompted for a User Name and Password/Auth String.
When authenticating programatically you need not login for each request. You can use sessioning to get more timely responses. To
do this you must retain the Auth Tokens returned by the Auth URLS and inclued the following HTTP header when requesting for REST-W:
Authorization: AuthSub appname="YOUR_APPLICATION_NAME" token="AUTH_TOKEN"
All URLs require an Auth Token under the REST-W realm.
All successful POSTs and GETs will return the HTTP status code of 200 followed by the requested data if any. Check the REST-W URL Details
section for more information.
Two types of errors can occur when POSTing or GETing URLs: URL errors and processing errors. URL error return and
HTTP status code of 404 and are returned when a requested URL does not exist. Processing errors return a HTTP status of
400 and are cause either by the user or server. Details about the error are returned in XML with the root element
<error id="RW101">Malformed HTTP header</error>
Error IDs that begin with RW are error that original within REST-W. Error IDs that do not that the RW prefix
are errors returned by the wrapped SOAP function.
REST-W JavaScript Example
A working example of sending an SMS message can be found at the following URL: /example.
Do a "View Page Source" to see the code.
REST-W URL Details
/components
HTTP GET
Description: Returns a list of components the User Name is subscribed to.
Request Data to Send: user_name
Successful Response:
<pre>
<a id="Mobile Engage" href="/components/Mobile_Engage">/components/Mobile_Engage</a>
<a id="Mobile Dialog" href="/components/Mobile_Dialog">/components/Mobile_Dialog</a>
.
.
.
</pre>
/components/[Component Name]
HTTP GET
Description: Returns information/attributes about the component.
Request Data to Send: user_name
Successful Response:
<component>
<is_subscribed>1</is_subscribed>
.
.
.
</component>
/components/[Component Name]/auth
HTTP POST
Description: Authorize a username/auth string pair for that comonent and create a session.
Request Data to Send: user_name, auth_string
Successful Response:
<auth_token>890sgf70sdgu04958KJHk</auth_token>
/components/[Component Name]/connect
HTTP POST
Description: Get REST direct access to use a component.
Request Data to Send: developer_id, auth_string, user_name
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services
HTTP GET
Description: Returns a list of services the authenticated user is subscribed to.
Request Data to Send: n/a
Successful Response:
<pre>
<a id="SMS OR MMS" href="/services/SMS_OR_MMS">/services/SMS_OR_MMS</a>
<a id="Location Query" href="/services/Location_Query">/services/Location_Query</a>
.
.
.
</pre>
/services/account
HTTP GET
Description: Returns a information/attributes about the authenticated user.
Request Data to Send: n/a
Successful Response:
<account>
.
.
.
</account>
/services/auth
HTTP POST
Description: Authorize a username/password pair for all services and create a session.
Request Data to Send: user_name, password
Successful Response:
<auth_token>890sgf70sdgu04958KJHk</auth_token>
/services/[Service Name]
HTTP GET
Description: Returns information/attributes about the service.
Request Data to Send: n/a
Successful Response:
<service>
<callback_url>1</callback_url>
<thruput>1</thruput>
.
.
.
</service>
HTTP POST
Description: Used to control the service interface.
Request Data to Send: xml data (no POST string needed)
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/callback
HTTP POST
Description: Set the callback URl for the service.
Request Data to Send: callback_url
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/location
/services/[Service Name]/location/[Phone#(,...)]
HTTP GET
Description: Return loation information for supplied mobiles.
Request Data to Send: force (0 or 1, optional), phone_list (comma seporated) *** Only supply if NOT part of the URL ***
Successful Response:
<locations>
<location>...</location>
.
.
.
</locations>
HTTP POST
Description: Sets the loation information for a mobile through an LBS Service Point.
Request Data to Send: phone_number, x, y, z, radius
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/mms
HTTP POST
Description: Send a MMS message.
Request Data to Send: phone_list (comma seporated), url, message
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/sms
/services/[Service Name]/sms/[Phone#(,...)]
/services/[Service Name]/sms/[Phone#(,...)]/[Message]
HTTP POST
Description: Send a SMS message.
Request Data to Send: phone_list (comma seporated), message *** Only supply if NOT part of the URL ***
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/wappush
HTTP POST
Description: WAP Push a message.
Request Data to Send: phone_list (comma seporated), url, message
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
/services/[Service Name]/transcode
HTTP POST
Description: Send a Transcode message.
Request Data to Send: name_on_device, sms_service_name, use_push, phone_list (comma seporated), url, message
Successful Response: (return a SOAP QMResult)
<result>
<token>...</token>
<url>...</url>
<status>...</status>
</result>
<EOF />