Rewards API commands

The following documentation is officially supported by DreamHost. However, if you find any instructions in this article do not function as intended, it's possible it may be out of date. When in doubt, please contact support for further assistance.

It's no longer possible to add promo codes as an affiliate. View the Rewards article for further details.

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.

Command rewards-add_promo_code
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 provides (costs $15 per bonus domreg)
bonus_ips : the number of free ips the code provides (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).

Command rewards-remove_promo_code
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).

Command rewards-enable_promo_code
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).

Command rewards-disable_promo_code
Values

code

Result

success

Possible errors

invalid_code

rewards-list_promo_codes

Lists all the promo codes you have created.

Command rewards-list_promo_codes
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).

Command rewards-promo_details
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.

Command rewards-referral_summary
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 also shows their webid and signup time.

Command rewards-referral_log
Values

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

Result

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.example.com N/A no signup
2010-11-16 17:32:27 9.10.11.12 TEST N/A http://www.example.com N/A no signup

Possible errors

no_period
invalid_period

See also