API Docs Subscription API

Using the Subscription API Call

Call URL: http://app.nz.textahq.com/api/subscription.php

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 Function param_value
api_key * Alphanumeric Key required to make a call  axhh3233289ydsjkbd987
sms_list * Integer List ID  23
fname Alphanumeric Use to pass first name values for subscribers  John
lname Alphanumeric To capture the last name of a subscriber  Smith
comp Alphanumeric Used to capture the company name for a subscriber record  Test Company
email Alphanumeric This is the email address of the subscriber  john@smith-and-smith.com
mob * Alphanumeric Used to capture the mobile number. Accepts 64 or New Zealand mobile number  6421123456 or 021123456
city Alphanumeric Used to capture the city field  Auckland
ctry Alphanumeric Used for capturing country field  New Zealand
gender Alphanumeric Used to capture gender field Female
age Alphanumeric Used to capture age or age group field 30 or 25-35
urlredirect Alphanumeric Used to decide whether or not you want to redirect the user after the API is executed successfully  y or n
success_url Alphanumeric Defines the redirection URL on success  http://www.mydomain.com/success.html
fail_url  Alphanumeric  Used for redirection on fail  http://www.mydomain.com/failed.html
trigger_responders Alphanumeric  Tells Texta to trigger autoresponders if applicable  y or n
format Alphanumeric  define the return type of api call, default is xml  xml or json
source  Alphanumeric  Used to capture the source of subscriber  website
* = required parameter

Response Generated:

XML

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