getCardTemplate

Synopsis:

This API function returns the card template information when given the ct-id.

Request: JSON

{
	"action" : "getcardtemplate",
	"api-key" : "API KEY",
	"ct-id" : "CARD TEMPLATE ID"			
}

Request Parameters:

Mandatory: 
action - The API Action, 
api-key - The API Key assigned to your account. It's case sensitive, 
ct-id - The card template Id. Case-Sensitive

Optional: N/A

Response Parameters:

status, ct-id, card-template, error-code, error-message

Request Example: JSON

{
	"action" : "getcardtemplate",
	"api-key" : "qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ",
	"ct-id" : "4e292d3765cf46c8a6c8f59e17fcb7715152325a"			
}

Response Example: Success

{
	"status" : "Success",
	"ct-id" : "4e292d3765cf46c8a6c8f59e17fcb7715152325a",
	"card-template" : {
		"card-name" : "PIZZACOUPON-X12",
		"card-type" : "COUPON",
		"organization" : "PIZZA DEN",
		"description" : "$10 OFF $35 PURCHASE",	
		"thumb-url" : "http://andreas.com/pixs/steve-jobs.png",	
		"barcode-value" : "3434578961A",
		"barcode-text" : "COUPON-343-457",
		"primary-fields" : [
			{
				"key" : "primary-1",
				"label" : "$10 off $35",
				"value" : "(Conditions apply.)"
			}
		],
		"secondary-fields" : [
			{
				"key" : "secondary-1",
				"label" : "Expires",
				"value" : "July 31, 2013"
			}
		],
		"auxiliary-fields" : [
			{
				"key" : "auxiliary-1",
				"label" : "Terms,
				"value" : "Excludes TX,FL,RI,VT,UT,WA,WI"
			}
		],	
		"back-fields" : [
			{
				"key" : "back-1",
				"label" : "Terms and Conditions",
				"value" : "1 coupon valid for one family."
			}
		]
	}
}

Response Example: Failure

{
	"status" : "FAILURE",
	"error-code" : "E802",
	"error-message" : "The ct-id value is invalid."
}

General Error Codes:

Code Description
E100 Invalid request. Make a valid request via JSON POST with all the required variables.
E104 Account Authentication Failed.
E105 This account does not have API access.
E107 This account is not allowed to use this action.
E108 Corrupt JSON in the request. $error.
E109 This account does not have API activated.
E112 API call rejected. IP is not white-listed.
E113 API call rejected. Set throughput exceeded for this API action.
E114 API call rejected. Phone number is blacklisted.
E120 This account has reached the API request limit.
E503 Internal error.


Code Description
E801 The ct-id value is required.
E802 The ct-id value is invalid.


Key Term Definitions:

Term Description
action This is the name of the function you want to execute with the API.
api-key Random key that is assigned to an account that can be used for authorization instead of USER/CARD. You can find and regenerate this key on the ‘API Settings’ page.
ct-id The unique card template ID used to reference a particular card template.