eloqua_api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/eloqua_api/rest_client.rb +48 -2
  2. metadata +1 -1
@@ -7,6 +7,8 @@ module Eloqua
7
7
  end
8
8
 
9
9
  # convenience methods
10
+
11
+ # SEGMENTS
10
12
  def create_segment(segment_definition)
11
13
  # debugger
12
14
  post(rest_path("assets/contact/segment"), segment_definition)
@@ -16,14 +18,58 @@ module Eloqua
16
18
  get(rest_path("assets/contact/segment/#{segment_id}"))
17
19
  end
18
20
 
21
+ # LANDING PAGES
22
+ def get_landing_page(landing_page_id)
23
+ get(rest_path("assets/landingPage/#{landing_page_id}"))
24
+ end
25
+
26
+ def get_landing_pages(options={})
27
+ options["count"] ||= 10
28
+ options["depth"] ||= "minimal"
29
+ options["order_by"] ||= "createdAt+DESC"
30
+
31
+ query = "count=#{options["count"]}&depth=#{options["depth"]}&orderBy=#{options["order_by"]}"
32
+
33
+ get(rest_path("assets/landingPages?#{query}"))
34
+ end
35
+
36
+ # EMAILS
37
+ def get_email(email_id)
38
+ get(rest_path("assets/email/#{email_id}"))
39
+ end
40
+
41
+ def get_emails(options={})
42
+ options["count"] ||= 10
43
+ options["depth"] ||= "minimal"
44
+ options["order_by"] ||= "createdAt+DESC"
45
+
46
+ query = "count=#{options["count"]}&depth=#{options["depth"]}&orderBy=#{options["order_by"]}"
47
+
48
+ get(rest_path("assets/emails?#{query}"))
49
+ end
50
+
51
+ # CAMPAIGNS
19
52
  def get_campaign(campaign_id)
20
53
  get(rest_path("assets/campaign/#{campaign_id}"))
21
54
  end
22
55
 
23
- def get_recent_campaigns
24
- get(rest_path("assets/campaigns/recent"))
56
+ def get_recent_campaigns(options={})
57
+ options["count"] ||= 10
58
+ options["depth"] ||= "minimal"
59
+ get(rest_path("assets/campaigns/recent?count=#{options["count"]}&depth=#{options["depth"]}"))
60
+ end
61
+
62
+ def get_campaigns(options={})
63
+ options["count"] ||= 10
64
+ options["depth"] ||= "minimal"
65
+ options["order_by"] ||= "createdAt+DESC"
66
+
67
+ query = "count=#{options["count"]}&depth=#{options["depth"]}&orderBy=#{options["order_by"]}"
68
+
69
+ get(rest_path("assets/campaigns?#{query}"))
25
70
  end
26
71
 
72
+ # CONTACTS
27
73
  def contact_activity(contact_id, options={})
28
74
  options["start_date"] ||= 1.year.ago.to_i
29
75
  options["end_date"] ||= Time.now.to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eloqua_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: