Class: Bloomerang::Campaign

Inherits:
Base
  • Object
show all
Defined in:
lib/bloomerang/campaign.rb

Overview

StartDate string($date) iso8601 format EndDate string($date) iso8601 format Goal number($currency) Name string SortIndex integer($int32) IsActive boolean

Class Method Summary collapse

Methods inherited from Base

delete, get, post, put

Class Method Details

.create(body) ⇒ Object

Create single campaign bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/post_campaign

Params: body JSON object, see API for fields



57
58
59
# File 'lib/bloomerang/campaign.rb', line 57

def self.create(body)
  post("campaign", {}, body)
end

.fetch(params = {}) ⇒ Object

Fetch all campaigns bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/get_campaigns

Params: skip integer, default: 0, simple paging system take integer, default: 50, simple paging system id array, separated by pipes: “one|two|three” IsActive boolean search string, returns matches on any part of name hasGoal boolean, have either non-zero-dollar or zero-dollar goals



29
30
31
# File 'lib/bloomerang/campaign.rb', line 29

def self.fetch(params = {})
  get("campaigns", params)
end

.refresh_summariesObject

Refresh summaries bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/get_campaigns_refreshsummaries Refreshes campaign goals Returns: JSON: The list of campaigns that are active and have a non-zero goal.

Params: none



67
68
69
# File 'lib/bloomerang/campaign.rb', line 67

def self.refresh_summaries
  get("campaigns/refreshsummaries")
end

.show(id) ⇒ Object



38
39
40
# File 'lib/bloomerang/campaign.rb', line 38

def self.show(id)
  get("campaign/#{id}")
end

.update(id, body) ⇒ Object

Update single campaign bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/put_campaign_id

Params: id integer body JSON object, see API for fields



48
49
50
# File 'lib/bloomerang/campaign.rb', line 48

def self.update(id, body)
  put("campaign/#{id}", {}, body)
end