active_campaign 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -3
- data/.travis.yml +15 -7
- data/Gemfile +3 -2
- data/README.md +1 -1
- data/active_campaign.gemspec +0 -2
- data/lib/active_campaign.rb +16 -8
- data/lib/active_campaign/client.rb +11 -15
- data/lib/active_campaign/client/campaigns.rb +7 -7
- data/lib/active_campaign/client/contacts.rb +9 -11
- data/lib/active_campaign/client/deals.rb +7 -7
- data/lib/active_campaign/client/forms.rb +5 -5
- data/lib/active_campaign/client/groups.rb +7 -7
- data/lib/active_campaign/client/lists.rb +12 -10
- data/lib/active_campaign/client/messages.rb +7 -7
- data/lib/active_campaign/client/tracks.rb +8 -12
- data/lib/active_campaign/client/users.rb +6 -11
- data/lib/active_campaign/configuration.rb +44 -24
- data/lib/active_campaign/core_ext.rb +53 -0
- data/lib/active_campaign/version.rb +1 -1
- data/spec/cassettes/ActiveCampaign_Client_Contacts/_contact_add/when_successful/returns_1_for_result_code.yml +96 -0
- data/spec/cassettes/ActiveCampaign_Client_Contacts/_contact_sync/when_successful/returns_1_for_result_code.yml +96 -0
- data/spec/cassettes/ActiveCampaign_Client_Contacts/_contact_view/can_find_contact_by_id.yml +150 -0
- data/spec/cassettes/ActiveCampaign_Client_Lists/_list_add/add_a_list.yml +48 -0
- data/spec/cassettes/ActiveCampaign_Client_Lists/_list_list/can_find_a_list_of_lists.yml +106 -0
- data/spec/cassettes/ActiveCampaign_Client_Lists/_list_view/can_find_lists_by_id.yml +102 -0
- data/spec/lib/active_campaign/client/contacts_spec.rb +15 -5
- data/spec/lib/active_campaign/client/lists_spec.rb +26 -18
- data/spec/lib/active_campaign/client_spec.rb +0 -1
- data/spec/lib/active_campaign_spec.rb +2 -2
- data/spec/spec_helper.rb +12 -14
- data/spec/support/coverage.rb +6 -2
- data/spec/support/vcr.rb +7 -5
- metadata +15 -40
- data/circle.yml +0 -15
- data/spec/cassettes/ActiveCampaign_Client_Contacts/_contact_sync/when_successful/returns_1_for_result_code.json +0 -1
- data/spec/cassettes/ActiveCampaign_Client_Contacts/_contact_view/can_find_contact_by_id.json +0 -1
- data/spec/cassettes/ActiveCampaign_Client_Lists/_list_list/can_find_a_list_of_lists.json +0 -1
- data/spec/cassettes/ActiveCampaign_Client_Lists/_list_view/can_find_lists_by_id.json +0 -1
@@ -1,20 +1,15 @@
|
|
1
|
-
require 'active_support'
|
2
|
-
|
3
1
|
module ActiveCampaign
|
4
2
|
class Client
|
5
3
|
module Users
|
6
|
-
GET_METHODS
|
7
|
-
|
8
|
-
).freeze unless defined?(GET_METHODS)
|
9
|
-
|
10
|
-
POST_METHODS = %w(add edit).freeze unless defined?(POST_METHODS)
|
11
|
-
|
12
|
-
extend ActiveSupport::Concern
|
4
|
+
GET_METHODS ||= %w(delete delete_list list me view view_email view_username).freeze
|
5
|
+
POST_METHODS ||= %w(add edit).freeze
|
13
6
|
|
14
7
|
# TODO: Create proper methods with parameter validation and possible naming
|
15
8
|
# fixes since this is one the worst APIs I have ever worked with.
|
16
|
-
included
|
17
|
-
|
9
|
+
def self.included(base)
|
10
|
+
base.class_exec do
|
11
|
+
define_api_calls(:user, GET_METHODS, POST_METHODS)
|
12
|
+
end
|
18
13
|
end
|
19
14
|
end
|
20
15
|
end
|
@@ -1,35 +1,55 @@
|
|
1
|
-
require 'active_support/core_ext/module/delegation'
|
2
|
-
|
3
1
|
module ActiveCampaign
|
4
|
-
|
5
|
-
API_ENDPOINT
|
6
|
-
USER_AGENT
|
7
|
-
API_OUTPUT
|
2
|
+
class Configuration
|
3
|
+
API_ENDPOINT ||= 'https://subdomain.activehosted.com/admin/api.php'.freeze
|
4
|
+
USER_AGENT ||= "ActiveCampaign Ruby Gem #{ActiveCampaign::VERSION}".freeze
|
5
|
+
API_OUTPUT ||= 'json'.freeze
|
6
|
+
|
7
|
+
attr_accessor :api_key, :api_endpoint, :api_output, :user_agent,
|
8
|
+
:log, :logger, :log_level, :mash, :debug
|
8
9
|
|
9
|
-
def
|
10
|
-
@
|
10
|
+
def initialize
|
11
|
+
@api_key = nil
|
12
|
+
@api_endpoint = API_ENDPOINT
|
13
|
+
@api_output = API_OUTPUT
|
14
|
+
@user_agent = USER_AGENT
|
15
|
+
@log = false
|
16
|
+
@logger = nil
|
17
|
+
@log_level = :info
|
18
|
+
@mash = false
|
19
|
+
@debug = false
|
11
20
|
end
|
12
|
-
alias_method :config, :configuration
|
13
21
|
|
14
|
-
def
|
15
|
-
|
22
|
+
def to_h # rubocop:disable MethodLength
|
23
|
+
{
|
24
|
+
api_key: api_key,
|
25
|
+
api_endpoint: api_endpoint,
|
26
|
+
api_output: api_output,
|
27
|
+
user_agent: user_agent,
|
28
|
+
log: log,
|
29
|
+
logger: logger,
|
30
|
+
log_level: log_level,
|
31
|
+
mash: mash,
|
32
|
+
debug: debug
|
33
|
+
}
|
16
34
|
end
|
17
35
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
user_agent: USER_AGENT,
|
24
|
-
log: false,
|
25
|
-
logger: nil,
|
26
|
-
log_level: :info,
|
27
|
-
mash: false,
|
28
|
-
debug: false)
|
36
|
+
def merge(other_config = {})
|
37
|
+
other_config.to_h.each do |k, v|
|
38
|
+
send("#{k}=", v) if respond_to?(k)
|
39
|
+
end
|
40
|
+
self
|
29
41
|
end
|
30
42
|
|
31
|
-
def
|
32
|
-
|
43
|
+
def <=>(other) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity
|
44
|
+
api_key == other.api_key &&
|
45
|
+
api_endpoint == other.api_endpoint &&
|
46
|
+
api_output == other.api_output &&
|
47
|
+
user_agent == other.user_agent &&
|
48
|
+
log == other.log &&
|
49
|
+
logger == other.logger &&
|
50
|
+
log_level == other.log_level &&
|
51
|
+
mash == other.mash &&
|
52
|
+
debug == other.debug
|
33
53
|
end
|
34
54
|
end
|
35
55
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
class Hash
|
2
|
+
def to_query(namespace = nil)
|
3
|
+
collect do |key, value|
|
4
|
+
unless (value.is_a?(Hash) || value.is_a?(Array)) && value.empty?
|
5
|
+
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
6
|
+
end
|
7
|
+
end.compact.sort! * '&'
|
8
|
+
end # unless respo?(:to_query)
|
9
|
+
end
|
10
|
+
|
11
|
+
class Array
|
12
|
+
def to_param
|
13
|
+
collect(&:to_param).join '/'
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_query(key)
|
17
|
+
prefix = "#{key}[]"
|
18
|
+
|
19
|
+
if empty?
|
20
|
+
nil.to_query(prefix)
|
21
|
+
else
|
22
|
+
collect { |value| value.to_query(prefix) }.join '&'
|
23
|
+
end
|
24
|
+
end # unless defined?(:to_query)
|
25
|
+
end
|
26
|
+
|
27
|
+
class Object
|
28
|
+
def to_query(key)
|
29
|
+
"#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}"
|
30
|
+
end # unless defined?(:to_query)
|
31
|
+
|
32
|
+
def to_param
|
33
|
+
to_s
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class TrueClass
|
38
|
+
def to_param
|
39
|
+
self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class FalseClass
|
44
|
+
def to_param
|
45
|
+
self
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class NilClass
|
50
|
+
def to_param
|
51
|
+
self
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: "<API_ENDPOINT>/?api_action=contact_add&api_key=<API_KEY>&api_output=json"
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=1&query%5Blistid%5D=1&status%5B1%5D=1
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 302
|
19
|
+
message: Found
|
20
|
+
headers:
|
21
|
+
X-Powered-By:
|
22
|
+
- PHP/5.3.3
|
23
|
+
Set-Cookie:
|
24
|
+
- PHPSESSID=o0mni3cgomroc66mirb5ummah3; path=/
|
25
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 07:54:03 GMT; path=/;
|
26
|
+
domain=zoolutions.api-us1.com
|
27
|
+
Expires:
|
28
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
29
|
+
Cache-Control:
|
30
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
Location:
|
34
|
+
- http://zoolutions.activehosted.com
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Content-Type:
|
38
|
+
- text/html
|
39
|
+
Transfer-Encoding:
|
40
|
+
- chunked
|
41
|
+
Date:
|
42
|
+
- Thu, 11 Aug 2016 07:54:04 GMT
|
43
|
+
Server:
|
44
|
+
- lighttpd/1.4.37
|
45
|
+
body:
|
46
|
+
encoding: ASCII-8BIT
|
47
|
+
string: ''
|
48
|
+
http_version:
|
49
|
+
recorded_at: Thu, 11 Aug 2016 07:54:04 GMT
|
50
|
+
- request:
|
51
|
+
method: post
|
52
|
+
uri: "<API_ENDPOINT>?api_action=contact_add&api_key=<API_KEY>&api_output=json"
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=7&query%5Blistid%5D=1&status%5B1%5D=1
|
56
|
+
headers:
|
57
|
+
User-Agent:
|
58
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
59
|
+
Accept-Encoding:
|
60
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
61
|
+
Accept:
|
62
|
+
- "*/*"
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 200
|
66
|
+
message: OK
|
67
|
+
headers:
|
68
|
+
X-Powered-By:
|
69
|
+
- PHP/5.3.3
|
70
|
+
Set-Cookie:
|
71
|
+
- PHPSESSID=ekg1bbi3tk9agelfvurprsnj10; path=/
|
72
|
+
- em_acp_globalauth_cookie=c6ead9798fb11b728939168ee2d579611; path=/; domain=zoolutions.api-us1.com;
|
73
|
+
secure
|
74
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 08:18:59 GMT; path=/;
|
75
|
+
domain=zoolutions.api-us1.com
|
76
|
+
Expires:
|
77
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
78
|
+
Pragma:
|
79
|
+
- no-cache
|
80
|
+
Content-Type:
|
81
|
+
- application/json; charset=utf-8
|
82
|
+
Cache-Control:
|
83
|
+
- no-store, max-age=0, must-revalidate
|
84
|
+
Transfer-Encoding:
|
85
|
+
- chunked
|
86
|
+
Date:
|
87
|
+
- Thu, 11 Aug 2016 08:19:00 GMT
|
88
|
+
Server:
|
89
|
+
- lighttpd/1.4.37
|
90
|
+
body:
|
91
|
+
encoding: UTF-8
|
92
|
+
string: '{"subscriber_id":1,"sendlast_should":0,"sendlast_did":0,"result_code":1,"result_message":"Contact
|
93
|
+
added","result_output":"json"}'
|
94
|
+
http_version:
|
95
|
+
recorded_at: Thu, 11 Aug 2016 08:19:00 GMT
|
96
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: "<API_ENDPOINT>/?api_action=contact_sync&api_key=<API_KEY>&api_output=json"
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=1&query%5Blistid%5D=1&status%5B1%5D=1
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 302
|
19
|
+
message: Found
|
20
|
+
headers:
|
21
|
+
X-Powered-By:
|
22
|
+
- PHP/5.3.3
|
23
|
+
Set-Cookie:
|
24
|
+
- PHPSESSID=3rl3tqcmtpjsqkm01llf3931g3; path=/
|
25
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 07:54:04 GMT; path=/;
|
26
|
+
domain=zoolutions.api-us1.com
|
27
|
+
Expires:
|
28
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
29
|
+
Cache-Control:
|
30
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
Location:
|
34
|
+
- http://zoolutions.activehosted.com
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Content-Type:
|
38
|
+
- text/html
|
39
|
+
Transfer-Encoding:
|
40
|
+
- chunked
|
41
|
+
Date:
|
42
|
+
- Thu, 11 Aug 2016 07:54:06 GMT
|
43
|
+
Server:
|
44
|
+
- lighttpd/1.4.37
|
45
|
+
body:
|
46
|
+
encoding: ASCII-8BIT
|
47
|
+
string: ''
|
48
|
+
http_version:
|
49
|
+
recorded_at: Thu, 11 Aug 2016 07:54:06 GMT
|
50
|
+
- request:
|
51
|
+
method: post
|
52
|
+
uri: "<API_ENDPOINT>?api_action=contact_sync&api_key=<API_KEY>&api_output=json"
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=7&query%5Blistid%5D=1&status%5B1%5D=1
|
56
|
+
headers:
|
57
|
+
User-Agent:
|
58
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
59
|
+
Accept-Encoding:
|
60
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
61
|
+
Accept:
|
62
|
+
- "*/*"
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 200
|
66
|
+
message: OK
|
67
|
+
headers:
|
68
|
+
X-Powered-By:
|
69
|
+
- PHP/5.3.3
|
70
|
+
Set-Cookie:
|
71
|
+
- PHPSESSID=vomdbc94pjeb9vqj5cinbq3424; path=/
|
72
|
+
- em_acp_globalauth_cookie=c6ead9798fb11b728939168ee2d579611; path=/; domain=zoolutions.api-us1.com;
|
73
|
+
secure
|
74
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 08:19:02 GMT; path=/;
|
75
|
+
domain=zoolutions.api-us1.com
|
76
|
+
Expires:
|
77
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
78
|
+
Pragma:
|
79
|
+
- no-cache
|
80
|
+
Content-Type:
|
81
|
+
- application/json; charset=utf-8
|
82
|
+
Cache-Control:
|
83
|
+
- no-store, max-age=0, must-revalidate
|
84
|
+
Transfer-Encoding:
|
85
|
+
- chunked
|
86
|
+
Date:
|
87
|
+
- Thu, 11 Aug 2016 08:19:03 GMT
|
88
|
+
Server:
|
89
|
+
- lighttpd/1.4.37
|
90
|
+
body:
|
91
|
+
encoding: UTF-8
|
92
|
+
string: '{"subscriber_id":1,"sendlast_should":0,"sendlast_did":0,"result_code":1,"result_message":"Contact
|
93
|
+
updated","result_output":"json"}'
|
94
|
+
http_version:
|
95
|
+
recorded_at: Thu, 11 Aug 2016 08:19:03 GMT
|
96
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,150 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: "<API_ENDPOINT>/?api_action=contact_sync&api_key=<API_KEY>&api_output=json"
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=1&query%5Blistid%5D=1&status%5B1%5D=1
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 302
|
19
|
+
message: Found
|
20
|
+
headers:
|
21
|
+
X-Powered-By:
|
22
|
+
- PHP/5.3.3
|
23
|
+
Set-Cookie:
|
24
|
+
- PHPSESSID=f0s9ooo96i0ps16d3tovvklf81; path=/
|
25
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 07:54:04 GMT; path=/;
|
26
|
+
domain=zoolutions.api-us1.com
|
27
|
+
Expires:
|
28
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
29
|
+
Cache-Control:
|
30
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
Location:
|
34
|
+
- http://zoolutions.activehosted.com
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Content-Type:
|
38
|
+
- text/html
|
39
|
+
Transfer-Encoding:
|
40
|
+
- chunked
|
41
|
+
Date:
|
42
|
+
- Thu, 11 Aug 2016 07:54:05 GMT
|
43
|
+
Server:
|
44
|
+
- lighttpd/1.4.37
|
45
|
+
body:
|
46
|
+
encoding: ASCII-8BIT
|
47
|
+
string: ''
|
48
|
+
http_version:
|
49
|
+
recorded_at: Thu, 11 Aug 2016 07:54:05 GMT
|
50
|
+
- request:
|
51
|
+
method: post
|
52
|
+
uri: "<API_ENDPOINT>?api_action=contact_sync&api_key=<API_KEY>&api_output=json"
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: email=mhenrixon%40me.com&first_name=Mikael&id=1&instantresponders%5B1%5D=1&ip4=127.0.0.1&last_name=Henriksson&p%5B1%5D=7&query%5Blistid%5D=1&status%5B1%5D=1
|
56
|
+
headers:
|
57
|
+
User-Agent:
|
58
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
59
|
+
Accept-Encoding:
|
60
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
61
|
+
Accept:
|
62
|
+
- "*/*"
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 200
|
66
|
+
message: OK
|
67
|
+
headers:
|
68
|
+
X-Powered-By:
|
69
|
+
- PHP/5.3.3
|
70
|
+
Set-Cookie:
|
71
|
+
- PHPSESSID=ggdlu1cg0lfrkbhe1s4dr2ltv3; path=/
|
72
|
+
- em_acp_globalauth_cookie=c6ead9798fb11b728939168ee2d579611; path=/; domain=zoolutions.api-us1.com;
|
73
|
+
secure
|
74
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 08:19:00 GMT; path=/;
|
75
|
+
domain=zoolutions.api-us1.com
|
76
|
+
Expires:
|
77
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
78
|
+
Pragma:
|
79
|
+
- no-cache
|
80
|
+
Content-Type:
|
81
|
+
- application/json; charset=utf-8
|
82
|
+
Cache-Control:
|
83
|
+
- no-store, max-age=0, must-revalidate
|
84
|
+
Transfer-Encoding:
|
85
|
+
- chunked
|
86
|
+
Date:
|
87
|
+
- Thu, 11 Aug 2016 08:19:01 GMT
|
88
|
+
Server:
|
89
|
+
- lighttpd/1.4.37
|
90
|
+
body:
|
91
|
+
encoding: UTF-8
|
92
|
+
string: '{"subscriber_id":1,"sendlast_should":0,"sendlast_did":0,"result_code":1,"result_message":"Contact
|
93
|
+
updated","result_output":"json"}'
|
94
|
+
http_version:
|
95
|
+
recorded_at: Thu, 11 Aug 2016 08:19:01 GMT
|
96
|
+
- request:
|
97
|
+
method: get
|
98
|
+
uri: "<API_ENDPOINT>?api_action=contact_view&api_key=<API_KEY>&api_output=json&id=1"
|
99
|
+
body:
|
100
|
+
encoding: US-ASCII
|
101
|
+
string: ''
|
102
|
+
headers:
|
103
|
+
User-Agent:
|
104
|
+
- ActiveCampaign Ruby Gem 0.1.13
|
105
|
+
Accept-Encoding:
|
106
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
107
|
+
Accept:
|
108
|
+
- "*/*"
|
109
|
+
response:
|
110
|
+
status:
|
111
|
+
code: 200
|
112
|
+
message: OK
|
113
|
+
headers:
|
114
|
+
X-Powered-By:
|
115
|
+
- PHP/5.3.3
|
116
|
+
Set-Cookie:
|
117
|
+
- PHPSESSID=2ok853204j37ga8cloeaii74j3; path=/
|
118
|
+
- em_acp_globalauth_cookie=c6ead9798fb11b728939168ee2d579611; path=/; domain=zoolutions.api-us1.com;
|
119
|
+
secure
|
120
|
+
- em_acp_globalauth_cookie=deleted; expires=Wed, 12-Aug-2015 08:19:01 GMT; path=/;
|
121
|
+
domain=zoolutions.api-us1.com
|
122
|
+
Expires:
|
123
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
124
|
+
Pragma:
|
125
|
+
- no-cache
|
126
|
+
Content-Type:
|
127
|
+
- application/json; charset=utf-8
|
128
|
+
Cache-Control:
|
129
|
+
- no-store, max-age=0, must-revalidate
|
130
|
+
Transfer-Encoding:
|
131
|
+
- chunked
|
132
|
+
Date:
|
133
|
+
- Thu, 11 Aug 2016 08:19:02 GMT
|
134
|
+
Server:
|
135
|
+
- lighttpd/1.4.37
|
136
|
+
body:
|
137
|
+
encoding: UTF-8
|
138
|
+
string: '{"id":"1","subscriberid":"1","listid":"1","formid":"0","seriesid":"0","sdate":"2016-08-11
|
139
|
+
10:18:01","udate":null,"status":"1","responder":"1","sync":"0","unsubreason":null,"unsubcampaignid":"0","unsubmessageid":"0","first_name":"Mikael","last_name":"Henriksson","ip4_sub":"2130706433","sourceid":"4","sourceid_autosync":"0","ip4_last":"2130706433","ip4_unsub":"0","listname":"Swedish
|
140
|
+
Players","lid":"1","ip4":"127.0.0.1","a_unsub_time":"","a_unsub_date":"","cdate":"2016-08-11
|
141
|
+
03:18:01","email":"mhenrixon@me.com","phone":"","orgid":"0","orgname":"","segmentio_id":"","bounced_hard":"0","bounced_soft":"0","bounced_date":null,"ip":"0.0.0.0","ua":null,"hash":"29230192814d84659315d9a164c36784","socialdata_lastcheck":null,"email_local":"","email_domain":"","sentcnt":"0","rating":"0","rating_tstamp":null,"gravatar":"0","deleted":"0","name":"Mikael
|
142
|
+
Henriksson","lists":{"1":{"id":"1","subscriberid":"1","listid":"1","formid":"0","seriesid":"0","sdate":"2016-08-11
|
143
|
+
10:18:01","udate":null,"status":"1","responder":"1","sync":"0","unsubreason":null,"unsubcampaignid":"0","unsubmessageid":"0","first_name":"Mikael","last_name":"Henriksson","ip4_sub":"2130706433","sourceid":"4","sourceid_autosync":"0","ip4_last":"2130706433","ip4_unsub":"0","listname":"Swedish
|
144
|
+
Players"},"7":{"id":"2","subscriberid":"1","listid":"7","formid":"0","seriesid":"0","sdate":"2016-08-11
|
145
|
+
10:19:00","udate":null,"status":"1","responder":"1","sync":"0","unsubreason":null,"unsubcampaignid":"0","unsubmessageid":"0","first_name":"Mikael","last_name":"Henriksson","ip4_sub":"2130706433","sourceid":"4","sourceid_autosync":"0","ip4_last":"2130706433","ip4_unsub":"0","listname":"Swedish
|
146
|
+
Players"}},"listslist":"1-7","fields":[],"actions":[],"campaign_history":[],"bounces":{"mailing":[],"mailings":0,"responder":[],"responders":0},"bouncescnt":0,"tags":[],"result_code":1,"result_message":"Success:
|
147
|
+
Something is returned","result_output":"json"}'
|
148
|
+
http_version:
|
149
|
+
recorded_at: Thu, 11 Aug 2016 08:19:02 GMT
|
150
|
+
recorded_with: VCR 3.0.3
|