mailchimp_api_v3 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailchimp_api_v3.rb +10 -0
- data/lib/mailchimp_api_v3/client.rb +0 -4
- data/lib/mailchimp_api_v3/client/remote.rb +7 -5
- data/lib/mailchimp_api_v3/collection.rb +11 -0
- data/lib/mailchimp_api_v3/exception.rb +7 -0
- data/lib/mailchimp_api_v3/instance.rb +3 -1
- data/lib/mailchimp_api_v3/list.rb +2 -6
- data/lib/mailchimp_api_v3/member.rb +14 -0
- data/lib/mailchimp_api_v3/version.rb +1 -1
- data/spec/fixtures/cassettes/members_create_or_update.yml +730 -0
- data/spec/mailchimp_api_v3/member_spec.rb +2 -2
- data/spec/mailchimp_api_v3/members_spec.rb +23 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50da97b5f8e1e28910279d7d648f719d71ab93b2
|
4
|
+
data.tar.gz: ccea721d3b09e2b344bc9ce53894c846713ffafc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d634f48ef8dabd8fbf7eb1d34b58a5f57b770826a622aeade75fd1ecbcb2a029fbbe021a8eebc6fa273b5db976e8b003b34e9aa3e878d1fdcff7b2c233fd5b
|
7
|
+
data.tar.gz: a68ba6bc97a35b8cae94272cdd978e16c2fba528bdd9a8a4bc4f39fdf97e5d1bf572f3a6bd1de5532d467954ac0938442ae12c76432fb26eb37e295c5dbec724
|
data/lib/mailchimp_api_v3.rb
CHANGED
@@ -8,10 +8,6 @@ module Mailchimp
|
|
8
8
|
|
9
9
|
def lists(*args)
|
10
10
|
subclass_from Lists, *args
|
11
|
-
# raw_data = filter.respond_to?(:dup) ? filter.dup : filter
|
12
|
-
# data = raw_data.is_a?(String) ? { name: raw_data } : raw_data
|
13
|
-
# lists = Lists.new(self)
|
14
|
-
# data.empty? ? lists : lists.find_by(data)
|
15
11
|
end
|
16
12
|
|
17
13
|
def connected?
|
@@ -36,11 +36,13 @@ module Mailchimp
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def managed_remote_exception(e)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
Mailchimp::Exception
|
39
|
+
data = YAML.load(e.http_body) if e.respond_to? :http_body
|
40
|
+
exception_class_name = e.class.to_s
|
41
|
+
|
42
|
+
if Mailchimp::Exception::MAPPED_EXCEPTIONS.key? exception_class_name
|
43
|
+
fail Mailchimp::Exception::MAPPED_EXCEPTIONS[exception_class_name], data
|
44
|
+
elsif exception_class_name == 'RestClient::BadRequest'
|
45
|
+
Mailchimp::Exception.parse_invalid_resource_exception data
|
44
46
|
else
|
45
47
|
fail e
|
46
48
|
end
|
@@ -47,6 +47,17 @@ module Mailchimp
|
|
47
47
|
create(data)
|
48
48
|
end
|
49
49
|
|
50
|
+
def create_or_update(data)
|
51
|
+
clean_data = data.deep_stringify_keys
|
52
|
+
|
53
|
+
if clean_data.key? 'id'
|
54
|
+
instance = self.class::CHILD_CLASS.get @client, path, clean_data.delete('id')
|
55
|
+
instance ? instance.update(clean_data) : create(clean_data)
|
56
|
+
else
|
57
|
+
find_by(clean_data)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
50
61
|
def name_field
|
51
62
|
self.class.const_defined?(:NAME_FIELD) ? self.class::NAME_FIELD : 'name'
|
52
63
|
end
|
@@ -24,10 +24,17 @@ module Mailchimp
|
|
24
24
|
end
|
25
25
|
|
26
26
|
APIKeyError = Class.new(DataException)
|
27
|
+
NotFound = Class.new(DataException)
|
27
28
|
Duplicate = Class.new(DataException)
|
28
29
|
MissingField = Class.new(DataException)
|
29
30
|
BadRequest = Class.new(DataException)
|
31
|
+
|
30
32
|
UnknownAttribute = Class.new(RuntimeError)
|
31
33
|
MissingId = Class.new(RuntimeError)
|
34
|
+
|
35
|
+
MAPPED_EXCEPTIONS = {
|
36
|
+
'RestClient::ResourceNotFound' => NotFound,
|
37
|
+
'RestClient::Unauthorized' => APIKeyError
|
38
|
+
}
|
32
39
|
end
|
33
40
|
end
|
@@ -4,7 +4,9 @@ module Mailchimp
|
|
4
4
|
|
5
5
|
def self.get(client, collection_path, id)
|
6
6
|
data = client.get "#{collection_path}/#{id}"
|
7
|
-
new
|
7
|
+
data ? new(client, data, collection_path) : nil
|
8
|
+
rescue Mailchimp::Exception::NotFound
|
9
|
+
nil
|
8
10
|
end
|
9
11
|
|
10
12
|
# Instance methods
|
@@ -1,12 +1,8 @@
|
|
1
1
|
module Mailchimp
|
2
2
|
class List < Instance
|
3
3
|
def members(options = {})
|
4
|
-
|
5
|
-
|
6
|
-
options = OpenSSL::Digest.digest('MD5', options).unpack('H*').first
|
7
|
-
end
|
8
|
-
|
9
|
-
subclass_from Members, options
|
4
|
+
id = options.convert_to_id if options.is_a?(String) && options.could_be_an_email?
|
5
|
+
subclass_from Members, (id || options)
|
10
6
|
end
|
11
7
|
|
12
8
|
def interest_categories(options = {})
|
@@ -1,6 +1,14 @@
|
|
1
1
|
module Mailchimp
|
2
2
|
class List
|
3
3
|
class Member < Instance
|
4
|
+
# Class methods
|
5
|
+
|
6
|
+
def self.add_id_to(data)
|
7
|
+
clean_data = data.deep_stringify_keys
|
8
|
+
return clean_data unless clean_data.key? 'email_address'
|
9
|
+
clean_data.merge id: clean_data['email_address'].convert_to_id
|
10
|
+
end
|
11
|
+
|
4
12
|
def self.parse_name_from(data)
|
5
13
|
clean_data = data.deep_stringify_keys
|
6
14
|
fname, lname = name_parts_from clean_data
|
@@ -23,6 +31,8 @@ module Mailchimp
|
|
23
31
|
]
|
24
32
|
end
|
25
33
|
|
34
|
+
# Instance methods
|
35
|
+
|
26
36
|
def first_name
|
27
37
|
merge_fields['FNAME']
|
28
38
|
end
|
@@ -52,6 +62,10 @@ module Mailchimp
|
|
52
62
|
def create(data)
|
53
63
|
super Mailchimp::List::Member.parse_name_from(data)
|
54
64
|
end
|
65
|
+
|
66
|
+
def create_or_update(data)
|
67
|
+
super Mailchimp::List::Member.add_id_to(data)
|
68
|
+
end
|
55
69
|
end
|
56
70
|
end
|
57
71
|
end
|
@@ -0,0 +1,730 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists?count=500&exclude_fields=lists._links,_links&offset=0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Authorization:
|
15
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
16
|
+
User-Agent:
|
17
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '2354'
|
29
|
+
X-Request-Id:
|
30
|
+
- b7daec56-8142-4113-b808-4e2b296a0b5f
|
31
|
+
Link:
|
32
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json>; rel="describedBy"
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Date:
|
36
|
+
- Sat, 11 Jul 2015 12:41:37 GMT
|
37
|
+
Connection:
|
38
|
+
- keep-alive
|
39
|
+
body:
|
40
|
+
encoding: ASCII-8BIT
|
41
|
+
string: '{"lists":[{"id":"71937ea346","name":"My second list","contact":{"company":"InSite
|
42
|
+
Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"Select
|
43
|
+
One","zip":"E14 7DQ","country":"262","phone":"02075372125"},"permission_reminder":"Test
|
44
|
+
list for Xenapto testing","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam
|
45
|
+
Sayers","from_email":"sam@insitearts.com","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-07-09T10:17:28+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/bsNMtP","subscribe_url_long":"http://insitearts.us11.list-manage1.com/subscribe?u=1dbca289fd41b54838bcbb501&id=71937ea346","beamer_address":"us11-6692a2b3c3-e843e438a6@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":1,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":0,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-07-09T13:32:01+00:00","last_unsub_date":""}},{"id":"e73f5910ca","name":"My
|
46
|
+
first list","contact":{"company":"InSite Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"","zip":"E14
|
47
|
+
7DQ","country":"262","phone":"07917153555"},"permission_reminder":"Opt-in
|
48
|
+
only","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam Sayers","from_email":"sam@sayers.cc","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-06-27T14:49:18+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/brGTO9","subscribe_url_long":"http://insitearts.us11.list-manage.com/subscribe?u=1dbca289fd41b54838bcbb501&id=e73f5910ca","beamer_address":"us11-6692a2b3c3-bcd2a8b144@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":2,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":3,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-06-27T14:50:39+00:00","last_unsub_date":""}}],"total_items":2}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Sat, 11 Jul 2015 12:41:37 GMT
|
51
|
+
- request:
|
52
|
+
method: get
|
53
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists?count=500&exclude_fields=lists._links,_links&offset=0
|
54
|
+
body:
|
55
|
+
encoding: US-ASCII
|
56
|
+
string: ''
|
57
|
+
headers:
|
58
|
+
Accept:
|
59
|
+
- "*/*; q=0.5, application/xml"
|
60
|
+
Accept-Encoding:
|
61
|
+
- gzip, deflate
|
62
|
+
Authorization:
|
63
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
64
|
+
User-Agent:
|
65
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 200
|
69
|
+
message: OK
|
70
|
+
headers:
|
71
|
+
Server:
|
72
|
+
- nginx
|
73
|
+
Content-Type:
|
74
|
+
- application/json; charset=utf-8
|
75
|
+
Content-Length:
|
76
|
+
- '2353'
|
77
|
+
X-Request-Id:
|
78
|
+
- ee6e4d31-7d7f-45d8-8ece-d6daeeb942b4
|
79
|
+
Link:
|
80
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json>; rel="describedBy"
|
81
|
+
Vary:
|
82
|
+
- Accept-Encoding
|
83
|
+
Date:
|
84
|
+
- Sat, 11 Jul 2015 12:41:37 GMT
|
85
|
+
Connection:
|
86
|
+
- keep-alive
|
87
|
+
body:
|
88
|
+
encoding: ASCII-8BIT
|
89
|
+
string: '{"lists":[{"id":"71937ea346","name":"My second list","contact":{"company":"InSite
|
90
|
+
Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"Select
|
91
|
+
One","zip":"E14 7DQ","country":"262","phone":"02075372125"},"permission_reminder":"Test
|
92
|
+
list for Xenapto testing","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam
|
93
|
+
Sayers","from_email":"sam@insitearts.com","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-07-09T10:17:28+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/bsNMtP","subscribe_url_long":"http://insitearts.us11.list-manage.com/subscribe?u=1dbca289fd41b54838bcbb501&id=71937ea346","beamer_address":"us11-6692a2b3c3-e843e438a6@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":1,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":0,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-07-09T13:32:01+00:00","last_unsub_date":""}},{"id":"e73f5910ca","name":"My
|
94
|
+
first list","contact":{"company":"InSite Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"","zip":"E14
|
95
|
+
7DQ","country":"262","phone":"07917153555"},"permission_reminder":"Opt-in
|
96
|
+
only","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam Sayers","from_email":"sam@sayers.cc","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-06-27T14:49:18+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/brGTO9","subscribe_url_long":"http://insitearts.us11.list-manage.com/subscribe?u=1dbca289fd41b54838bcbb501&id=e73f5910ca","beamer_address":"us11-6692a2b3c3-bcd2a8b144@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":2,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":3,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-06-27T14:50:39+00:00","last_unsub_date":""}}],"total_items":2}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Sat, 11 Jul 2015 12:41:37 GMT
|
99
|
+
- request:
|
100
|
+
method: get
|
101
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
102
|
+
body:
|
103
|
+
encoding: US-ASCII
|
104
|
+
string: ''
|
105
|
+
headers:
|
106
|
+
Accept:
|
107
|
+
- "*/*; q=0.5, application/xml"
|
108
|
+
Accept-Encoding:
|
109
|
+
- gzip, deflate
|
110
|
+
Authorization:
|
111
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
112
|
+
User-Agent:
|
113
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
114
|
+
response:
|
115
|
+
status:
|
116
|
+
code: 200
|
117
|
+
message: OK
|
118
|
+
headers:
|
119
|
+
Server:
|
120
|
+
- nginx
|
121
|
+
Content-Type:
|
122
|
+
- application/json; charset=utf-8
|
123
|
+
Content-Length:
|
124
|
+
- '1260'
|
125
|
+
X-Request-Id:
|
126
|
+
- f730f278-592c-4139-abbd-b715a7b5caa7
|
127
|
+
Link:
|
128
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
129
|
+
rel="describedBy"
|
130
|
+
Vary:
|
131
|
+
- Accept-Encoding
|
132
|
+
Date:
|
133
|
+
- Sat, 11 Jul 2015 12:41:37 GMT
|
134
|
+
Connection:
|
135
|
+
- keep-alive
|
136
|
+
body:
|
137
|
+
encoding: ASCII-8BIT
|
138
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":2}'
|
139
|
+
http_version:
|
140
|
+
recorded_at: Sat, 11 Jul 2015 12:41:37 GMT
|
141
|
+
- request:
|
142
|
+
method: get
|
143
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
144
|
+
body:
|
145
|
+
encoding: US-ASCII
|
146
|
+
string: ''
|
147
|
+
headers:
|
148
|
+
Accept:
|
149
|
+
- "*/*; q=0.5, application/xml"
|
150
|
+
Accept-Encoding:
|
151
|
+
- gzip, deflate
|
152
|
+
Authorization:
|
153
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
154
|
+
User-Agent:
|
155
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
156
|
+
response:
|
157
|
+
status:
|
158
|
+
code: 200
|
159
|
+
message: OK
|
160
|
+
headers:
|
161
|
+
Server:
|
162
|
+
- nginx
|
163
|
+
Content-Type:
|
164
|
+
- application/json; charset=utf-8
|
165
|
+
Content-Length:
|
166
|
+
- '1260'
|
167
|
+
X-Request-Id:
|
168
|
+
- 47fb2e2e-51ff-40b3-976a-162738cc345b
|
169
|
+
Link:
|
170
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
171
|
+
rel="describedBy"
|
172
|
+
Vary:
|
173
|
+
- Accept-Encoding
|
174
|
+
Date:
|
175
|
+
- Sat, 11 Jul 2015 12:41:37 GMT
|
176
|
+
Connection:
|
177
|
+
- keep-alive
|
178
|
+
body:
|
179
|
+
encoding: ASCII-8BIT
|
180
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":2}'
|
181
|
+
http_version:
|
182
|
+
recorded_at: Sat, 11 Jul 2015 12:41:37 GMT
|
183
|
+
- request:
|
184
|
+
method: get
|
185
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb
|
186
|
+
body:
|
187
|
+
encoding: US-ASCII
|
188
|
+
string: ''
|
189
|
+
headers:
|
190
|
+
Accept:
|
191
|
+
- "*/*; q=0.5, application/xml"
|
192
|
+
Accept-Encoding:
|
193
|
+
- gzip, deflate
|
194
|
+
Authorization:
|
195
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
196
|
+
User-Agent:
|
197
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
198
|
+
response:
|
199
|
+
status:
|
200
|
+
code: 404
|
201
|
+
message: Not Found
|
202
|
+
headers:
|
203
|
+
Server:
|
204
|
+
- nginx
|
205
|
+
Content-Type:
|
206
|
+
- application/problem+json; charset=utf-8
|
207
|
+
Content-Length:
|
208
|
+
- '218'
|
209
|
+
X-Request-Id:
|
210
|
+
- 6ebaa496-aee1-4593-a450-ac6ccb8bb6e1
|
211
|
+
Link:
|
212
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
|
213
|
+
Vary:
|
214
|
+
- Accept-Encoding
|
215
|
+
Date:
|
216
|
+
- Sat, 11 Jul 2015 12:41:38 GMT
|
217
|
+
Connection:
|
218
|
+
- keep-alive
|
219
|
+
body:
|
220
|
+
encoding: ASCII-8BIT
|
221
|
+
string: '{"type":"http://kb.mailchimp.com/api/error-docs/404-resource-not-found","title":"Resource
|
222
|
+
Not Found","status":404,"detail":"The requested resource could not be found.","instance":"6ebaa496-aee1-4593-a450-ac6ccb8bb6e1"}'
|
223
|
+
http_version:
|
224
|
+
recorded_at: Sat, 11 Jul 2015 12:41:38 GMT
|
225
|
+
- request:
|
226
|
+
method: post
|
227
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members
|
228
|
+
body:
|
229
|
+
encoding: UTF-8
|
230
|
+
string: '{"merge_fields":{"FNAME":"Cat","LNAME":"Sayers"},"email_address":"cat@sayers.cc","status":"subscribed"}'
|
231
|
+
headers:
|
232
|
+
Accept:
|
233
|
+
- "*/*; q=0.5, application/xml"
|
234
|
+
Accept-Encoding:
|
235
|
+
- gzip, deflate
|
236
|
+
Authorization:
|
237
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
238
|
+
User-Agent:
|
239
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
240
|
+
Content-Length:
|
241
|
+
- '103'
|
242
|
+
response:
|
243
|
+
status:
|
244
|
+
code: 200
|
245
|
+
message: OK
|
246
|
+
headers:
|
247
|
+
Server:
|
248
|
+
- nginx
|
249
|
+
Content-Type:
|
250
|
+
- application/json; charset=utf-8
|
251
|
+
Content-Length:
|
252
|
+
- '2086'
|
253
|
+
X-Request-Id:
|
254
|
+
- e117d453-557a-4270-8e69-24fbdff5c6be
|
255
|
+
Link:
|
256
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json>; rel="describedBy"
|
257
|
+
Vary:
|
258
|
+
- Accept-Encoding
|
259
|
+
Date:
|
260
|
+
- Sat, 11 Jul 2015 12:41:38 GMT
|
261
|
+
Connection:
|
262
|
+
- keep-alive
|
263
|
+
body:
|
264
|
+
encoding: ASCII-8BIT
|
265
|
+
string: '{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Cat","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:38+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca","_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"update","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"PATCH","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"delete","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"DELETE"},{"rel":"activity","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/activity","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"},{"rel":"goals","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/goals","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"},{"rel":"notes","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/notes","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"}]}'
|
266
|
+
http_version:
|
267
|
+
recorded_at: Sat, 11 Jul 2015 12:41:38 GMT
|
268
|
+
- request:
|
269
|
+
method: get
|
270
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
271
|
+
body:
|
272
|
+
encoding: US-ASCII
|
273
|
+
string: ''
|
274
|
+
headers:
|
275
|
+
Accept:
|
276
|
+
- "*/*; q=0.5, application/xml"
|
277
|
+
Accept-Encoding:
|
278
|
+
- gzip, deflate
|
279
|
+
Authorization:
|
280
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
281
|
+
User-Agent:
|
282
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
283
|
+
response:
|
284
|
+
status:
|
285
|
+
code: 200
|
286
|
+
message: OK
|
287
|
+
headers:
|
288
|
+
Server:
|
289
|
+
- nginx
|
290
|
+
Content-Type:
|
291
|
+
- application/json; charset=utf-8
|
292
|
+
Content-Length:
|
293
|
+
- '1862'
|
294
|
+
X-Request-Id:
|
295
|
+
- 512fd688-2070-45a2-9fd7-877226d30fa4
|
296
|
+
Link:
|
297
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
298
|
+
rel="describedBy"
|
299
|
+
Vary:
|
300
|
+
- Accept-Encoding
|
301
|
+
Date:
|
302
|
+
- Sat, 11 Jul 2015 12:41:38 GMT
|
303
|
+
Connection:
|
304
|
+
- keep-alive
|
305
|
+
body:
|
306
|
+
encoding: ASCII-8BIT
|
307
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Cat","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:38+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
308
|
+
http_version:
|
309
|
+
recorded_at: Sat, 11 Jul 2015 12:41:38 GMT
|
310
|
+
- request:
|
311
|
+
method: get
|
312
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
313
|
+
body:
|
314
|
+
encoding: US-ASCII
|
315
|
+
string: ''
|
316
|
+
headers:
|
317
|
+
Accept:
|
318
|
+
- "*/*; q=0.5, application/xml"
|
319
|
+
Accept-Encoding:
|
320
|
+
- gzip, deflate
|
321
|
+
Authorization:
|
322
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
323
|
+
User-Agent:
|
324
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
325
|
+
response:
|
326
|
+
status:
|
327
|
+
code: 200
|
328
|
+
message: OK
|
329
|
+
headers:
|
330
|
+
Server:
|
331
|
+
- nginx
|
332
|
+
Content-Type:
|
333
|
+
- application/json; charset=utf-8
|
334
|
+
Content-Length:
|
335
|
+
- '1862'
|
336
|
+
X-Request-Id:
|
337
|
+
- b7b6d5c6-21cd-4c59-97db-a35386f2d0d2
|
338
|
+
Link:
|
339
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
340
|
+
rel="describedBy"
|
341
|
+
Vary:
|
342
|
+
- Accept-Encoding
|
343
|
+
Date:
|
344
|
+
- Sat, 11 Jul 2015 12:41:38 GMT
|
345
|
+
Connection:
|
346
|
+
- keep-alive
|
347
|
+
body:
|
348
|
+
encoding: ASCII-8BIT
|
349
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Cat","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:38+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
350
|
+
http_version:
|
351
|
+
recorded_at: Sat, 11 Jul 2015 12:41:38 GMT
|
352
|
+
- request:
|
353
|
+
method: get
|
354
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb
|
355
|
+
body:
|
356
|
+
encoding: US-ASCII
|
357
|
+
string: ''
|
358
|
+
headers:
|
359
|
+
Accept:
|
360
|
+
- "*/*; q=0.5, application/xml"
|
361
|
+
Accept-Encoding:
|
362
|
+
- gzip, deflate
|
363
|
+
Authorization:
|
364
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
365
|
+
User-Agent:
|
366
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
367
|
+
response:
|
368
|
+
status:
|
369
|
+
code: 200
|
370
|
+
message: OK
|
371
|
+
headers:
|
372
|
+
Server:
|
373
|
+
- nginx
|
374
|
+
Content-Type:
|
375
|
+
- application/json; charset=utf-8
|
376
|
+
Content-Length:
|
377
|
+
- '2086'
|
378
|
+
X-Request-Id:
|
379
|
+
- c57c59a3-b9c2-4aed-9e1e-11825167070f
|
380
|
+
Link:
|
381
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json>; rel="describedBy"
|
382
|
+
Vary:
|
383
|
+
- Accept-Encoding
|
384
|
+
Date:
|
385
|
+
- Sat, 11 Jul 2015 12:41:39 GMT
|
386
|
+
Connection:
|
387
|
+
- keep-alive
|
388
|
+
body:
|
389
|
+
encoding: ASCII-8BIT
|
390
|
+
string: '{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Cat","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:38+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca","_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"update","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"PATCH","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"delete","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"DELETE"},{"rel":"activity","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/activity","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"},{"rel":"goals","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/goals","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"},{"rel":"notes","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/notes","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"}]}'
|
391
|
+
http_version:
|
392
|
+
recorded_at: Sat, 11 Jul 2015 12:41:39 GMT
|
393
|
+
- request:
|
394
|
+
method: patch
|
395
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb
|
396
|
+
body:
|
397
|
+
encoding: UTF-8
|
398
|
+
string: '{"merge_fields":{"FNAME":"Catherine"},"email_address":"cat@sayers.cc","status":"subscribed"}'
|
399
|
+
headers:
|
400
|
+
Accept:
|
401
|
+
- "*/*; q=0.5, application/xml"
|
402
|
+
Accept-Encoding:
|
403
|
+
- gzip, deflate
|
404
|
+
Authorization:
|
405
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
406
|
+
User-Agent:
|
407
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
408
|
+
Content-Length:
|
409
|
+
- '92'
|
410
|
+
response:
|
411
|
+
status:
|
412
|
+
code: 200
|
413
|
+
message: OK
|
414
|
+
headers:
|
415
|
+
Server:
|
416
|
+
- nginx
|
417
|
+
Content-Type:
|
418
|
+
- application/json; charset=utf-8
|
419
|
+
Content-Length:
|
420
|
+
- '2092'
|
421
|
+
X-Request-Id:
|
422
|
+
- 7d2e444f-ab26-485b-8e30-87799a49f66d
|
423
|
+
Link:
|
424
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json>; rel="describedBy"
|
425
|
+
Vary:
|
426
|
+
- Accept-Encoding
|
427
|
+
Date:
|
428
|
+
- Sat, 11 Jul 2015 12:41:39 GMT
|
429
|
+
Connection:
|
430
|
+
- keep-alive
|
431
|
+
body:
|
432
|
+
encoding: ASCII-8BIT
|
433
|
+
string: '{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca","_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"update","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"PATCH","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"delete","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"DELETE"},{"rel":"activity","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/activity","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"},{"rel":"goals","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/goals","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"},{"rel":"notes","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/notes","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"}]}'
|
434
|
+
http_version:
|
435
|
+
recorded_at: Sat, 11 Jul 2015 12:41:39 GMT
|
436
|
+
- request:
|
437
|
+
method: get
|
438
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
439
|
+
body:
|
440
|
+
encoding: US-ASCII
|
441
|
+
string: ''
|
442
|
+
headers:
|
443
|
+
Accept:
|
444
|
+
- "*/*; q=0.5, application/xml"
|
445
|
+
Accept-Encoding:
|
446
|
+
- gzip, deflate
|
447
|
+
Authorization:
|
448
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
449
|
+
User-Agent:
|
450
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
451
|
+
response:
|
452
|
+
status:
|
453
|
+
code: 200
|
454
|
+
message: OK
|
455
|
+
headers:
|
456
|
+
Server:
|
457
|
+
- nginx
|
458
|
+
Content-Type:
|
459
|
+
- application/json; charset=utf-8
|
460
|
+
Content-Length:
|
461
|
+
- '1868'
|
462
|
+
X-Request-Id:
|
463
|
+
- 38b05944-e6fc-448c-8089-750e5a0645df
|
464
|
+
Link:
|
465
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
466
|
+
rel="describedBy"
|
467
|
+
Vary:
|
468
|
+
- Accept-Encoding
|
469
|
+
Date:
|
470
|
+
- Sat, 11 Jul 2015 12:41:39 GMT
|
471
|
+
Connection:
|
472
|
+
- keep-alive
|
473
|
+
body:
|
474
|
+
encoding: ASCII-8BIT
|
475
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
476
|
+
http_version:
|
477
|
+
recorded_at: Sat, 11 Jul 2015 12:41:39 GMT
|
478
|
+
- request:
|
479
|
+
method: get
|
480
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb
|
481
|
+
body:
|
482
|
+
encoding: US-ASCII
|
483
|
+
string: ''
|
484
|
+
headers:
|
485
|
+
Accept:
|
486
|
+
- "*/*; q=0.5, application/xml"
|
487
|
+
Accept-Encoding:
|
488
|
+
- gzip, deflate
|
489
|
+
Authorization:
|
490
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
491
|
+
User-Agent:
|
492
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
493
|
+
response:
|
494
|
+
status:
|
495
|
+
code: 200
|
496
|
+
message: OK
|
497
|
+
headers:
|
498
|
+
Server:
|
499
|
+
- nginx
|
500
|
+
Content-Type:
|
501
|
+
- application/json; charset=utf-8
|
502
|
+
Content-Length:
|
503
|
+
- '2092'
|
504
|
+
X-Request-Id:
|
505
|
+
- e7d11456-bd71-45d1-b543-a4146a6e2364
|
506
|
+
Link:
|
507
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json>; rel="describedBy"
|
508
|
+
Vary:
|
509
|
+
- Accept-Encoding
|
510
|
+
Date:
|
511
|
+
- Sat, 11 Jul 2015 12:41:39 GMT
|
512
|
+
Connection:
|
513
|
+
- keep-alive
|
514
|
+
body:
|
515
|
+
encoding: ASCII-8BIT
|
516
|
+
string: '{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca","_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"update","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"PATCH","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"delete","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"DELETE"},{"rel":"activity","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/activity","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"},{"rel":"goals","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/goals","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"},{"rel":"notes","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/notes","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"}]}'
|
517
|
+
http_version:
|
518
|
+
recorded_at: Sat, 11 Jul 2015 12:41:39 GMT
|
519
|
+
- request:
|
520
|
+
method: patch
|
521
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb
|
522
|
+
body:
|
523
|
+
encoding: UTF-8
|
524
|
+
string: '{"merge_fields":{"FNAME":"Catherine"},"email_address":"cat@sayers.cc","status":"subscribed"}'
|
525
|
+
headers:
|
526
|
+
Accept:
|
527
|
+
- "*/*; q=0.5, application/xml"
|
528
|
+
Accept-Encoding:
|
529
|
+
- gzip, deflate
|
530
|
+
Authorization:
|
531
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
532
|
+
User-Agent:
|
533
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
534
|
+
Content-Length:
|
535
|
+
- '92'
|
536
|
+
response:
|
537
|
+
status:
|
538
|
+
code: 200
|
539
|
+
message: OK
|
540
|
+
headers:
|
541
|
+
Server:
|
542
|
+
- nginx
|
543
|
+
Content-Type:
|
544
|
+
- application/json; charset=utf-8
|
545
|
+
Content-Length:
|
546
|
+
- '2092'
|
547
|
+
X-Request-Id:
|
548
|
+
- d42a895b-06df-4c8d-8223-ce0f35bfbb56
|
549
|
+
Link:
|
550
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json>; rel="describedBy"
|
551
|
+
Vary:
|
552
|
+
- Accept-Encoding
|
553
|
+
Date:
|
554
|
+
- Sat, 11 Jul 2015 12:41:39 GMT
|
555
|
+
Connection:
|
556
|
+
- keep-alive
|
557
|
+
body:
|
558
|
+
encoding: ASCII-8BIT
|
559
|
+
string: '{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca","_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"update","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"PATCH","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"},{"rel":"delete","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb","method":"DELETE"},{"rel":"activity","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/activity","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"},{"rel":"goals","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/goals","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"},{"rel":"notes","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members/b84d50ba2a40fdbca8e2771b9a5b94fb/notes","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"}]}'
|
560
|
+
http_version:
|
561
|
+
recorded_at: Sat, 11 Jul 2015 12:41:39 GMT
|
562
|
+
- request:
|
563
|
+
method: get
|
564
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
565
|
+
body:
|
566
|
+
encoding: US-ASCII
|
567
|
+
string: ''
|
568
|
+
headers:
|
569
|
+
Accept:
|
570
|
+
- "*/*; q=0.5, application/xml"
|
571
|
+
Accept-Encoding:
|
572
|
+
- gzip, deflate
|
573
|
+
Authorization:
|
574
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
575
|
+
User-Agent:
|
576
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
577
|
+
response:
|
578
|
+
status:
|
579
|
+
code: 200
|
580
|
+
message: OK
|
581
|
+
headers:
|
582
|
+
Server:
|
583
|
+
- nginx
|
584
|
+
Content-Type:
|
585
|
+
- application/json; charset=utf-8
|
586
|
+
Content-Length:
|
587
|
+
- '1868'
|
588
|
+
X-Request-Id:
|
589
|
+
- 5b9f5909-620a-4bd3-b22e-257802df54f8
|
590
|
+
Link:
|
591
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
592
|
+
rel="describedBy"
|
593
|
+
Vary:
|
594
|
+
- Accept-Encoding
|
595
|
+
Date:
|
596
|
+
- Sat, 11 Jul 2015 12:41:40 GMT
|
597
|
+
Connection:
|
598
|
+
- keep-alive
|
599
|
+
body:
|
600
|
+
encoding: ASCII-8BIT
|
601
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
602
|
+
http_version:
|
603
|
+
recorded_at: Sat, 11 Jul 2015 12:41:40 GMT
|
604
|
+
- request:
|
605
|
+
method: get
|
606
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
607
|
+
body:
|
608
|
+
encoding: US-ASCII
|
609
|
+
string: ''
|
610
|
+
headers:
|
611
|
+
Accept:
|
612
|
+
- "*/*; q=0.5, application/xml"
|
613
|
+
Accept-Encoding:
|
614
|
+
- gzip, deflate
|
615
|
+
Authorization:
|
616
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
617
|
+
User-Agent:
|
618
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
619
|
+
response:
|
620
|
+
status:
|
621
|
+
code: 200
|
622
|
+
message: OK
|
623
|
+
headers:
|
624
|
+
Server:
|
625
|
+
- nginx
|
626
|
+
Content-Type:
|
627
|
+
- application/json; charset=utf-8
|
628
|
+
Content-Length:
|
629
|
+
- '1868'
|
630
|
+
X-Request-Id:
|
631
|
+
- c51db264-8041-45e2-9261-29996738db02
|
632
|
+
Link:
|
633
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
634
|
+
rel="describedBy"
|
635
|
+
Vary:
|
636
|
+
- Accept-Encoding
|
637
|
+
Date:
|
638
|
+
- Sat, 11 Jul 2015 12:41:40 GMT
|
639
|
+
Connection:
|
640
|
+
- keep-alive
|
641
|
+
body:
|
642
|
+
encoding: ASCII-8BIT
|
643
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
644
|
+
http_version:
|
645
|
+
recorded_at: Sat, 11 Jul 2015 12:41:40 GMT
|
646
|
+
- request:
|
647
|
+
method: get
|
648
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
649
|
+
body:
|
650
|
+
encoding: US-ASCII
|
651
|
+
string: ''
|
652
|
+
headers:
|
653
|
+
Accept:
|
654
|
+
- "*/*; q=0.5, application/xml"
|
655
|
+
Accept-Encoding:
|
656
|
+
- gzip, deflate
|
657
|
+
Authorization:
|
658
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
659
|
+
User-Agent:
|
660
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
661
|
+
response:
|
662
|
+
status:
|
663
|
+
code: 200
|
664
|
+
message: OK
|
665
|
+
headers:
|
666
|
+
Server:
|
667
|
+
- nginx
|
668
|
+
Content-Type:
|
669
|
+
- application/json; charset=utf-8
|
670
|
+
Content-Length:
|
671
|
+
- '1868'
|
672
|
+
X-Request-Id:
|
673
|
+
- 67d64ce6-6235-4897-8ddd-12d227821ba1
|
674
|
+
Link:
|
675
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
676
|
+
rel="describedBy"
|
677
|
+
Vary:
|
678
|
+
- Accept-Encoding
|
679
|
+
Date:
|
680
|
+
- Sat, 11 Jul 2015 12:41:40 GMT
|
681
|
+
Connection:
|
682
|
+
- keep-alive
|
683
|
+
body:
|
684
|
+
encoding: ASCII-8BIT
|
685
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
686
|
+
http_version:
|
687
|
+
recorded_at: Sat, 11 Jul 2015 12:41:40 GMT
|
688
|
+
- request:
|
689
|
+
method: get
|
690
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=500&exclude_fields=members._links,_links&offset=0
|
691
|
+
body:
|
692
|
+
encoding: US-ASCII
|
693
|
+
string: ''
|
694
|
+
headers:
|
695
|
+
Accept:
|
696
|
+
- "*/*; q=0.5, application/xml"
|
697
|
+
Accept-Encoding:
|
698
|
+
- gzip, deflate
|
699
|
+
Authorization:
|
700
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
701
|
+
User-Agent:
|
702
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
703
|
+
response:
|
704
|
+
status:
|
705
|
+
code: 200
|
706
|
+
message: OK
|
707
|
+
headers:
|
708
|
+
Server:
|
709
|
+
- nginx
|
710
|
+
Content-Type:
|
711
|
+
- application/json; charset=utf-8
|
712
|
+
Content-Length:
|
713
|
+
- '1868'
|
714
|
+
X-Request-Id:
|
715
|
+
- 5b2668d0-b645-42cf-9c61-00aac25f5842
|
716
|
+
Link:
|
717
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
718
|
+
rel="describedBy"
|
719
|
+
Vary:
|
720
|
+
- Accept-Encoding
|
721
|
+
Date:
|
722
|
+
- Sat, 11 Jul 2015 12:41:40 GMT
|
723
|
+
Connection:
|
724
|
+
- keep-alive
|
725
|
+
body:
|
726
|
+
encoding: ASCII-8BIT
|
727
|
+
string: '{"members":[{"id":"140b91c107d2058dee730e75be0b1151","email_address":"ann@sayers.cc","unique_email_id":"37a55cdc48","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Ann","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:15+00:00","member_rating":2,"last_changed":"2015-07-07T12:05:57+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"a81216d35b4cbfa18632867228be02da","email_address":"bob@sayers.cc","unique_email_id":"3f73c23e26","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Bob","LNAME":"Example"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.133","timestamp_opt":"2015-06-27T14:50:39+00:00","member_rating":2,"last_changed":"2015-06-27T14:50:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"},{"id":"b84d50ba2a40fdbca8e2771b9a5b94fb","email_address":"cat@sayers.cc","unique_email_id":"223c7a01d2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"Catherine","LNAME":"Sayers"},"interests":{"ca7ab24b53":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"86.163.13.46","timestamp_opt":"2015-07-11T12:41:38+00:00","member_rating":2,"last_changed":"2015-07-11T12:41:39+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"e73f5910ca"}],"list_id":"e73f5910ca","total_items":3}'
|
728
|
+
http_version:
|
729
|
+
recorded_at: Sat, 11 Jul 2015 12:41:40 GMT
|
730
|
+
recorded_with: VCR 2.9.3
|
@@ -16,8 +16,8 @@ describe Mailchimp::List::Member, vcr: { cassette_name: 'member' } do
|
|
16
16
|
expect(member.name).to eq name
|
17
17
|
end
|
18
18
|
|
19
|
-
it 'has
|
20
|
-
expect(member.
|
19
|
+
it 'has a string repsentation' do
|
20
|
+
expect(member.to_s).to eq 'Ann Example <ann@sayers.cc>'
|
21
21
|
end
|
22
22
|
|
23
23
|
context 'updates name fields correctly' do
|
@@ -67,5 +67,28 @@ describe Mailchimp::List::Members do
|
|
67
67
|
member.delete # Tidy up
|
68
68
|
end
|
69
69
|
end
|
70
|
+
|
71
|
+
context '#create_or_update', vcr: { cassette_name: 'members_create_or_update' } do
|
72
|
+
let(:list) { Mailchimp.connect.lists 'My first list' }
|
73
|
+
let(:members) { list.members }
|
74
|
+
|
75
|
+
it 'creates when no match is found, udates otherwise' do
|
76
|
+
name = 'Cat Sayers'
|
77
|
+
data = { name: name, email_address: 'cat@sayers.cc', status: 'subscribed' }
|
78
|
+
|
79
|
+
# Create
|
80
|
+
expect { members.create_or_update data }.to change { list.members.count }.by(1)
|
81
|
+
|
82
|
+
# Update
|
83
|
+
data = { first_name: 'Catherine', email_address: 'cat@sayers.cc', status: 'subscribed' }
|
84
|
+
expect { members.create_or_update data }.not_to change { list.members.count }
|
85
|
+
expect(members.create_or_update data).to have_attributes name: 'Catherine Sayers'
|
86
|
+
|
87
|
+
# Unless we supply an id or equivalent, we won't end up updating anything
|
88
|
+
data = { name: 'Catherine Sayers' }
|
89
|
+
expect { members.create_or_update data }.not_to change { list.members.count }
|
90
|
+
expect(members.create_or_update data).to have_attributes name: 'Catherine Sayers'
|
91
|
+
end
|
92
|
+
end
|
70
93
|
end
|
71
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailchimp_api_v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xenapto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- spec/fixtures/cassettes/mailchimp.yml
|
248
248
|
- spec/fixtures/cassettes/member.yml
|
249
249
|
- spec/fixtures/cassettes/members.yml
|
250
|
+
- spec/fixtures/cassettes/members_create_or_update.yml
|
250
251
|
- spec/fixtures/cassettes/members_paging.yml
|
251
252
|
- spec/mailchimp_api_v3/account_spec.rb
|
252
253
|
- spec/mailchimp_api_v3/client_spec.rb
|
@@ -300,6 +301,7 @@ test_files:
|
|
300
301
|
- spec/fixtures/cassettes/mailchimp.yml
|
301
302
|
- spec/fixtures/cassettes/member.yml
|
302
303
|
- spec/fixtures/cassettes/members.yml
|
304
|
+
- spec/fixtures/cassettes/members_create_or_update.yml
|
303
305
|
- spec/fixtures/cassettes/members_paging.yml
|
304
306
|
- spec/mailchimp_api_v3/account_spec.rb
|
305
307
|
- spec/mailchimp_api_v3/client_spec.rb
|