Class: Klaviyo::Campaigns
- Defined in:
- lib/klaviyo/apis/campaigns.rb
Constant Summary collapse
- CANCEL =
'cancel'- CAMPAIGN =
'campaign'- CAMPAIGNS =
'campaigns'- SEND =
'send'
Constants inherited from Client
Klaviyo::Client::ALL, Klaviyo::Client::BASE_API_URL, Klaviyo::Client::CONTENT_JSON, Klaviyo::Client::CONTENT_URL_FORM, Klaviyo::Client::DEFAULT_COUNT, Klaviyo::Client::DEFAULT_PAGE, Klaviyo::Client::DEFAULT_SORT_DESC, Klaviyo::Client::HTTP_DELETE, Klaviyo::Client::HTTP_GET, Klaviyo::Client::HTTP_POST, Klaviyo::Client::HTTP_PUT, Klaviyo::Client::METRIC, Klaviyo::Client::METRICS, Klaviyo::Client::TIMELINE, Klaviyo::Client::V1_API, Klaviyo::Client::V2_API
Class Method Summary collapse
-
.cancel_campaign(campaign_id) ⇒ JSON
Cancels the campaign with specified campaign_id.
-
.get_campaign_details(campaign_id) ⇒ JSON
Retrieves the details of the list.
-
.get_campaigns ⇒ List
Retrieves all the campaigns from Klaviyo account.
-
.send_campaign(campaign_id) ⇒ Object
Sends the campaign immediately.
Class Method Details
.cancel_campaign(campaign_id) ⇒ JSON
Cancels the campaign with specified campaign_id
35 36 37 38 39 |
# File 'lib/klaviyo/apis/campaigns.rb', line 35 def self.cancel_campaign(campaign_id) path = "#{CAMPAIGN}/#{campaign_id}/#{CANCEL}" v1_request(HTTP_POST, path) end |
.get_campaign_details(campaign_id) ⇒ JSON
Retrieves the details of the list
17 18 19 20 21 |
# File 'lib/klaviyo/apis/campaigns.rb', line 17 def self.get_campaign_details(campaign_id) path = "#{CAMPAIGN}/#{campaign_id}" v1_request(HTTP_GET, path) end |
.get_campaigns ⇒ List
Retrieves all the campaigns from Klaviyo account
10 11 12 |
# File 'lib/klaviyo/apis/campaigns.rb', line 10 def self.get_campaigns() v1_request(HTTP_GET, CAMPAIGNS) end |
.send_campaign(campaign_id) ⇒ Object
Sends the campaign immediately
26 27 28 29 30 |
# File 'lib/klaviyo/apis/campaigns.rb', line 26 def self.send_campaign(campaign_id) path = "#{CAMPAIGN}/#{campaign_id}/#{SEND}" v1_request(HTTP_POST, path) end |