Module: Ambassador
- Includes:
- HTTParty
- Defined in:
- lib/ambassador.rb,
lib/ambassador/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
-
#addthis(params = {}) ⇒ Object
Retrieves an AddThis snippet for all active campaigns for one of your customers :customerEmail [required] :productName :customerID :sandbox :autoEmailAmbassador.
-
#ambassador(params = {}) ⇒ Object
Retrieve info for a single ambassador.
-
#ambassadors(params = {}) ⇒ Object
Retrieves a list of up to 50 ambassadors, optionally filtered by the parameters below.
-
#deduct_balance(params = {}) ⇒ Object
Deducts from the running commission balance for one of your customers.
- #initialize(username, api_key, response_type) ⇒ Object
-
#record_event(params = {}) ⇒ Object
Records an instance of a campaign event :campaignID [required] :customerEmail [required] :ipAddress [required for referred registrations] :revenue :transactionID :productName :shortCode :customerID :customerFirstName :customerLastName :autoEmailAmbassador.
Instance Method Details
#addthis(params = {}) ⇒ Object
Retrieves an AddThis snippet for all active campaigns for one of your customers :customerEmail [required] :productName :customerID :sandbox :autoEmailAmbassador
59 60 61 |
# File 'lib/ambassador.rb', line 59 def addthis(params = {}) self.class.get('/social/addthis', params) end |
#ambassador(params = {}) ⇒ Object
Retrieve info for a single ambassador. :customerEmail [required] :customerID :sandbox
29 30 31 |
# File 'lib/ambassador.rb', line 29 def ambassador(params = {}) self.class.get('/ambassador/get', params) end |
#ambassadors(params = {}) ⇒ Object
Retrieves a list of up to 50 ambassadors, optionally filtered by the parameters below. :pageNum :minBalanceMoney :minBalancePoints :minReferrals :sandbox
39 40 41 |
# File 'lib/ambassador.rb', line 39 def ambassadors(params = {}) self.class.get('/ambassador/all', params) end |
#deduct_balance(params = {}) ⇒ Object
Deducts from the running commission balance for one of your customers. :customerEmail [required] :balanceType [required, “money” or “points”] :payoutAmt :customerID :sandbox
49 50 51 |
# File 'lib/ambassador.rb', line 49 def deduct_balance(params = {}) self.class.get('/balance/deduct', params) end |
#initialize(username, api_key, response_type) ⇒ Object
4 5 6 7 |
# File 'lib/ambassador.rb', line 4 def initialize(username, api_key, response_type) self.class.default_params :username => username, :api_key => api_key, :response_type => response_type self.class.base_uri "https://getambassador.com/api/v1/#{username}/#{api_key}/#{response_type}" end |
#record_event(params = {}) ⇒ Object
Records an instance of a campaign event :campaignID [required] :customerEmail [required] :ipAddress [required for referred registrations] :revenue :transactionID :productName :shortCode :customerID :customerFirstName :customerLastName :autoEmailAmbassador
21 22 23 |
# File 'lib/ambassador.rb', line 21 def record_event(params = {}) self.class.get('/event/record', params) end |