API/Rewards commands

From DreamHost
Jump to: navigation, search

Rewards API commands

The rewards API module contains commands for managing promo codes and tracking referrals.

Commands

rewards-add_promo_code

Creates a promo code. The promo code must provide some sort of bonus, but this bonus is subtracted from the $97 referral reward.

Values:

code : the desired promo code. must be 3-16 characters long, only letters or numbers, and not be numbers only
description : a text description of the code.  max 32 characters
bonus_domregs : the number of free domregs the code will provide (costs $15 per bonus domreg)
bonus_ips : the number of free ips the code will provide (costs $30 per bonus ip)
discount_month : the discount off the monthly plan (note: this is no longer available for new plans)
discount_1year : the discount off 1-year hosting
discount_2year : the discount off 2-year hosting

Result:

success

Possible Errors:

no_code
no_description
no_bonus_domregs
no_bonus_ips
no_discount_month
no_discount_1year
no_discount_2year
invalid_code
code_taken
description_too_long
invalid_bonus_domregs
invalid_bonus_ips
bonus_too_big
negative_discount

rewards-remove_promo_code

Removes a promo code (only allowed if the code was never used).

Values:

code

Result:

success

Possible Errors:

invalid_code
code_used

rewards-enable_promo_code

Enables a promo code so it can be used again (must have been disabled).

Values:

code

Result:

success

Possible Errors:

invalid_code

rewards-disable_promo_code

Disables a promo code so it can no longer be used (must be enabled).

Values:

code

Result:

success

Possible Errors:

invalid_code

rewards-list_promo_codes

Lists all the promo codes you have created.

Values:

(none)

Result:

success
code	description	created	status	used
TESTCODE	my promo code	2010-11-16 17:37:05	active	0

Possible Errors:

(none)

rewards-promo_details

Gets the detailed information for a promo code (you must have created the code).

Values:

code

Result:

success
code	description	status	discount_month	discount_1year	discount_2year	bonus_domregs	bonus_ips
TESTCODE	my promo code	active	$0.00	$0.00	$0.00	2	1

Possible Errors:

no_code
invalid_code

rewards-referral_summary

Gives a summary of all referrals for the given time period.

Values:

period : a period of time such as "1 day" or "3 months"

Result:

success
code	signups	raw_clicks	unique_clicks	conversion 
none	0	8	8	0.00%	
TESTCODE	213	5515	5235	4.07%	
Total	213	5523	5243	4.06%

Possible Errors:

no_period
invalid_period

rewards-referral_log

Returns a raw log of of referrals for the given time period. If the person signed up, then it will also show their webid and signup time.

Values:

period : a period of time such as "1 day" or "3 months"

Results:

success
click_time	ip	code	signup_time	ref_url	webid	status
2010-11-16 17:40:34	1.2.3.4	TEST	N/A		N/A	no signup	
2010-11-16 17:40:12	5.6.7.8	TEST	N/A	http://www.mywebsite.com	N/A	no signup	
2010-11-16 17:32:27	9.10.11.12	TEST	N/A	http://www.mywebsite.com	N/A	no signup

Possible Errors:

no_period
invalid_period