call_action 2.2 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/call_action/api.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 947634ec7f7613e0502a0c63dd6c1abbe1be8867
|
4
|
+
data.tar.gz: d4540c82dca0179e77f0e53e5a384440779b50b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e51574217cd4b2c2b265818b8b796af9754c7a9f085e87ba6cb60eb11ae7125626f7d44f40a99cae8608778bd7688dd85dc899e564c48e281a9ac0412b0a0b2
|
7
|
+
data.tar.gz: 707ad7449445e55bb8f32fbf77433284338e488f6f77e9be3e337b1675081541b2874033b24de12f74ad13091d274301ec47cae36cfaf655c7f1ace582f7751f
|
data/lib/call_action/api.rb
CHANGED
@@ -22,11 +22,18 @@ module CallAction
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# To get list of all contacts
|
25
|
-
def contacts
|
25
|
+
def contacts start_date=nil, end_date=nil
|
26
26
|
url = URI.parse("#{@base_url}#{@api_version}/contacts")
|
27
|
-
request = Net::HTTP::Get.new(url.request_uri)
|
28
27
|
|
29
|
-
|
28
|
+
params = {}
|
29
|
+
params[:start] = start_date if start_date.present?
|
30
|
+
params[:end] = end_date if end_date.present?
|
31
|
+
|
32
|
+
path = params.present? ? "#{url.request_uri}?".concat(params.collect { |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join('&')) : url.request_uri
|
33
|
+
|
34
|
+
request = Net::HTTP::Get.new(path)
|
35
|
+
|
36
|
+
@headers.each {|k, v| request[k] = v }
|
30
37
|
|
31
38
|
response = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|
|
32
39
|
http.request(request)
|