Using the Subscription API Call

Call URL: http://app2.textahq.com/gateway/api/subscription.php

This script can operate in 2 main modes:

URL Redirect mode: In this mode the script will execute and then redirect the browser back to a specified URL, you can specify a URL for successful subscriptions and a URL for failed subscriptions. This mode is best for websites that will use either a server-side redirect or a javascript redirect.

Non URL Redirect mode:In this mode the script will simply execute and return either “ok” or “failed” in either xml or json format. This mode is best for websites which need a complete server-side solution and do not wish to redirect the users browser. e.g using the PHP http_request object or the .NET HttpWebRequest object.

Parameters for this call:

Each API call requires you to pass certain parameters in order for Maxmail to return correct responses. Here’s a list of those parameters relevant to the subscription API call.

Parameter Type param_value
api_key * Alphanumeric axhh3233289ydsjkbd987
sms_list * Integer 23
fname Alphanumeric John
lname Alphanumeric Smith
comp Alphanumeric Test Company
email Alphanumeric john@smith-and-smith.com
mob * Alphanumeric 6421123456 or 021123456
city Alphanumeric Auckland
ctry Alphanumeric New Zealand
gender Alphanumeric Female
age Alphanumeric 30 or 25-35
urlredirect Alphanumeric y or n
success_url Alphanumeric http://www.mydomain.com/success.html
fail_url Alphanumeric http://www.mydomain.com/failed.html
trigger_responders Alphanumeric y or n
format Alphanumeric xml or json
source Alphanumeric website

* = required parameter

Response Generated:

XML

<?xml version"1.0"?>
<ApiResponse>
 	<success>true<success>
 	<error code="200">OK</error>
</ApiResponse>