PRO API

This service is designed for professional marketers or agencies who want to develop mobile campaigns and use the TMS shortcodes and widgets to promote the offer and provide a 1 click access to their consumers from targeted media. The API library will allow the use of some of the following TMS services:
 * Create and manage mobile coupon campaigns
 * Create TMS shortcodes
 * Create TMS tiny URL widgets
 * Create and manage SMS txt campaigns (coming soon)

Methods
The PRO API library consists of several methods that coincide with the steps for creating a campaign in TMS Factory. Method /auth is always the first step and the sesssion key obtained will be used by the other methods in the library. It is important to note that the actual creation of a campaign only happens after method /finalize is called. All the data and images passed in the other methods are only temporary and are saved in a session. Methods may be called more than once but is discouraged (data is overridden but some bugs have been noted). Here is a list of the methods in the recommended order they are called:


 * /auth
 * /register_campaign
 * Mobile Site
 * /organize_site
 * /site_design
 * /site_mainpage
 * /user_data
 * Templates
 * /discount_coupon
 * /classic_coupon
 * /my_own_coupon
 * /terms_and_condition
 * /feedback
 * Widgets
 * /barcodes
 * /tiny_url_widget
 * /localization
 * /financing
 * /finalize

There are also APIs that return data:


 * /user


 * /values


 * /campaign

Sessions
API sessions keep track of the data passed through the methods until it expires or until the campaign has been successfully created. Sessions expire 4 hours from when the session key was obtained from /auth.

Flow
A normal creation of a campaign always start with /auth and ends with /finalize. The methods that can or must be invoked between them depends on the campaign type (which is specified in method /register_campaign). Some methods also require other methods to be called before them. e.g. /discount_coupon requires /register_campaign to be called first.
 * Campaign with an existing mobile site:
 * /auth
 * /register_campaign
 * widgets (optional): /barcodes or /tiny_url_widget
 * /localization
 * /financing (optional)
 * /finalize
 * Campaign with TMS Factory landing site:
 * /auth
 * /register_campaign
 * /organize_site
 * /site_design (optional)
 * /site_mainpage (optional)
 * /user_data (optional)
 * templates (optional): /discount_coupon, /classic_coupon, /my_own_coupon, /terms_and_condition... etc.
 * widgets (optional): /barcodes or /tiny_url_widget
 * /localization
 * /financing (optional)
 * /finalize

Note that /register_campaign and /localization is required for both cases and determining if the campaign is for an existing site or a TMS Factory landing site is also dependent on /register_campaign.



Campaign Types
Some features are unavailable in some campaign types and are available in others. The API allows only mobile coupon and sms type of campaigns although currently creating sms campaigns is under development. Here are some key differences between the two campaign types:
 * 1) Mobile Coupons - ...allows you to create a mobile coupon (Discount or Gift amount) and to customize the TMS Cross media widgets to offer a direct access to your mobile offer on media targeted (print, outdoor, web, social).
 * 2) * access to widgets.
 * 3) * can choose only one of either template:
 * 4) ** /discount_coupon
 * 5) ** /classic_coupon
 * 6) ** /my_own_coupon
 * 7) * ... and two optional templates:
 * 8) ** /terms_and_condition
 * 9) ** /feedback
 * 10) SMS Text Promo - Use the TMS platform to offer consumers to receive a free SMS offering a discount coupon via a "pull service"(no SPAM).You will pay only the clicks (SMS) and you will have access the campaign data.
 * 11) * requires a /distribution step (not yet implemented in API).
 * 12) * for widgets, only /tiny_url_widget is allowed.

Common parameters
There are two parameters shared by all methods. They are not required and will assume the default value when not specified in an API call.


 * result_format ("default", "json","xml") specifies which format the API response should be. Defaults to "default".


 * debug ("0","1") flags whether the API call is for testing only. When set to "1" the API returns the parameter data that was sent, and the normal response (but no transaction or data is actually saved).

Uploading Images
When uploading images the parameter expects a valid url to the image. Currently only jpeg formats are accepted.

Colors
Color values should be in a 6 character hexadecimal format (RGB) e.g. FFFFFF for white and 000000 for black.

Dates
The format for dates should be the day, month (not numeric), year e.g. "20 december 2010" or "20 dec 2010".