active-campaign-simple 0.2.0 → 0.2.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/README.md +3 -0
- data/lib/active-campaign-simple/request.rb +5 -4
- data/lib/active-campaign-simple/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e56a728f497b1f0ff61f013d442a5e6439e80fb853f8bdb448526beedbf3a47
|
4
|
+
data.tar.gz: 985056dd5a8e2b0df6a9e6922ca29991c050f20c680a2919909009ba1fd9db15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29658c69085579ee47af003fcf4889b6659de669cbb7164a7ed8e8a50bf451f185174c1a3fcb94584e4ca47e3770f7bf734d48242eaa4a087b3af75af511021b
|
7
|
+
data.tar.gz: dfc2da00c8c554628becd7b2e1c6a7125ccc4546acca8be5942849ca104a5be12274fb120d290af0f0f39f64b3c67134b19da99981b967d0c0e7e4ebc147a52a
|
data/README.md
CHANGED
@@ -60,6 +60,9 @@ ActiveCampaign.put('/contacts/' + id, payload: {
|
|
60
60
|
# Delete a contact
|
61
61
|
ActiveCampaign.delete('/contacts/' + id)
|
62
62
|
|
63
|
+
# Search for a contact
|
64
|
+
ActiveCampaign.get('/contacts', query: { email: 'test@test.com' })
|
65
|
+
|
63
66
|
# Event Tracking
|
64
67
|
# See: https://developers.activecampaign.com/reference#track-event
|
65
68
|
# NOTE - The tracking API is different from all other calls as it changes the arguments a little to simplify.
|
@@ -5,8 +5,8 @@ require 'active-campaign-simple/event'
|
|
5
5
|
module ActiveCampaign
|
6
6
|
module Request
|
7
7
|
# Perform an GET request
|
8
|
-
def get(path)
|
9
|
-
request(:get, path)
|
8
|
+
def get(path, query: {})
|
9
|
+
request(:get, path, {}, query)
|
10
10
|
end
|
11
11
|
|
12
12
|
# Perform an HTTP POST request
|
@@ -37,12 +37,13 @@ module ActiveCampaign
|
|
37
37
|
private
|
38
38
|
|
39
39
|
# Perform request
|
40
|
-
def request(method, path, payload={})
|
40
|
+
def request(method, path, payload={}, query={})
|
41
41
|
path = "/#{path}" unless path.start_with?('/')
|
42
|
+
path += "?#{URI::encode_www_form(query)}" unless query.empty?
|
42
43
|
header = {
|
43
44
|
'Api-Token': api_key,
|
44
45
|
content_type: :json,
|
45
|
-
accept: :json
|
46
|
+
accept: :json
|
46
47
|
}
|
47
48
|
opts = {
|
48
49
|
method: method,
|