mailchimp_api_v3 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +38 -0
  3. data/.hound.yml +4 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +26 -0
  6. data/CODE_OF_CONDUCT.md +15 -0
  7. data/Gemfile +2 -0
  8. data/Guardfile +16 -0
  9. data/LICENSE +29 -0
  10. data/README.md +44 -0
  11. data/lib/mailchimp.rb +8 -0
  12. data/lib/mailchimp/account.rb +14 -0
  13. data/lib/mailchimp/client.rb +44 -0
  14. data/lib/mailchimp/client/remote.rb +79 -0
  15. data/lib/mailchimp/collection.rb +45 -0
  16. data/lib/mailchimp/collection/paging.rb +70 -0
  17. data/lib/mailchimp/exception.rb +40 -0
  18. data/lib/mailchimp/instance.rb +31 -0
  19. data/lib/mailchimp/interest.rb +9 -0
  20. data/lib/mailchimp/interest_categories.rb +23 -0
  21. data/lib/mailchimp/interest_category.rb +19 -0
  22. data/lib/mailchimp/interests.rb +25 -0
  23. data/lib/mailchimp/list.rb +20 -0
  24. data/lib/mailchimp/lists.rb +21 -0
  25. data/lib/mailchimp/member.rb +15 -0
  26. data/lib/mailchimp/members.rb +23 -0
  27. data/lib/mailchimp/version.rb +3 -0
  28. data/mailchimp_api_v3.gemspec +34 -0
  29. data/spec/fixtures/cassettes/mailchimp.yml +710 -0
  30. data/spec/fixtures/cassettes/members.yml +266 -0
  31. data/spec/mailchimp/account_spec.rb +17 -0
  32. data/spec/mailchimp/client_spec.rb +56 -0
  33. data/spec/mailchimp/exception_spec.rb +45 -0
  34. data/spec/mailchimp/interest_categories_spec.rb +55 -0
  35. data/spec/mailchimp/interest_category_spec.rb +27 -0
  36. data/spec/mailchimp/interest_spec.rb +22 -0
  37. data/spec/mailchimp/interests_spec.rb +49 -0
  38. data/spec/mailchimp/list_spec.rb +36 -0
  39. data/spec/mailchimp/lists_spec.rb +15 -0
  40. data/spec/mailchimp/member_spec.rb +21 -0
  41. data/spec/mailchimp/members_spec.rb +34 -0
  42. data/spec/mailchimp_spec.rb +20 -0
  43. data/spec/spec_helper.rb +29 -0
  44. data/spec/support/api_key.rb +7 -0
  45. data/spec/support/vcr_setup.rb +14 -0
  46. metadata +288 -0
@@ -0,0 +1,266 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us11.api.mailchimp.com/3.0/lists?count=500&exclude_fields=lists._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 df8658fb18403e29ef4a8437a8eb3705-us11
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
+ - '1647'
29
+ X-Request-Id:
30
+ - 652e3f6c-ccf1-41e9-b759-a18c7732e8a7
31
+ Link:
32
+ - <https://us11.api.mailchimp.com/schema/3.0/Lists/Collection.json>; rel="describedBy"
33
+ Vary:
34
+ - Accept-Encoding
35
+ Date:
36
+ - Wed, 01 Jul 2015 14:30:32 GMT
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: ASCII-8BIT
41
+ string: '{"lists":[{"id":"e73f5910ca","name":"My first list","contact":{"company":"InSite
42
+ Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"","zip":"E14
43
+ 7DQ","country":"262","phone":"07917153555"},"permission_reminder":"Opt-in
44
+ 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":2,"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":""}}],"_links":[{"rel":"self","href":"https://us11.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://us11.api.mailchimp.com/schema/3.0/Lists/Collection.json"},{"rel":"parent","href":"https://us11.api.mailchimp.com/3.0/","method":"GET","targetSchema":"https://us11.api.mailchimp.com/schema/3.0/Root.json"},{"rel":"create","href":"https://us11.api.mailchimp.com/3.0/lists","method":"POST","schema":"https://us11.api.mailchimp.com/schema/3.0/Lists/Instance.json"}],"total_items":1}'
45
+ http_version:
46
+ recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
47
+ - request:
48
+ method: get
49
+ uri: https://us11.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links&offset=0
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Authorization:
59
+ - apikey df8658fb18403e29ef4a8437a8eb3705-us11
60
+ User-Agent:
61
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
62
+ response:
63
+ status:
64
+ code: 200
65
+ message: OK
66
+ headers:
67
+ Server:
68
+ - nginx
69
+ Content-Type:
70
+ - application/json; charset=utf-8
71
+ Content-Length:
72
+ - '8557'
73
+ X-Request-Id:
74
+ - acf5f935-1ae1-4851-ad92-357d60b3ff2a
75
+ Link:
76
+ - <https://us11.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
77
+ rel="describedBy"
78
+ Vary:
79
+ - Accept-Encoding
80
+ Date:
81
+ - Wed, 01 Jul 2015 14:30:32 GMT
82
+ Connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: ASCII-8BIT
86
+ string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
87
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
88
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
89
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
90
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
91
+ 19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
92
+ Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
93
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
94
+ 11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
95
+ Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
96
+ 22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
97
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
98
+ Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
99
+ 07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
100
+ Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
101
+ 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
102
+ Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
103
+ 02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
104
+ http_version:
105
+ recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
106
+ - request:
107
+ method: get
108
+ uri: https://us11.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links&offset=10
109
+ body:
110
+ encoding: US-ASCII
111
+ string: ''
112
+ headers:
113
+ Accept:
114
+ - "*/*; q=0.5, application/xml"
115
+ Accept-Encoding:
116
+ - gzip, deflate
117
+ Authorization:
118
+ - apikey df8658fb18403e29ef4a8437a8eb3705-us11
119
+ User-Agent:
120
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
121
+ response:
122
+ status:
123
+ code: 200
124
+ message: OK
125
+ headers:
126
+ Server:
127
+ - nginx
128
+ Content-Type:
129
+ - application/json; charset=utf-8
130
+ Content-Length:
131
+ - '8557'
132
+ X-Request-Id:
133
+ - acf5f935-1ae1-4851-ad92-357d60b3ff2a
134
+ Link:
135
+ - <https://us11.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
136
+ rel="describedBy"
137
+ Vary:
138
+ - Accept-Encoding
139
+ Date:
140
+ - Wed, 01 Jul 2015 14:30:32 GMT
141
+ Connection:
142
+ - keep-alive
143
+ body:
144
+ encoding: ASCII-8BIT
145
+ string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
146
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
147
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
148
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
149
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
150
+ 19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
151
+ Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
152
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
153
+ 11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
154
+ Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
155
+ 22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
156
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
157
+ Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
158
+ 07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
159
+ Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
160
+ 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
161
+ Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
162
+ 02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
163
+ http_version:
164
+ recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
165
+ - request:
166
+ method: get
167
+ uri: https://us11.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links&offset=20
168
+ body:
169
+ encoding: US-ASCII
170
+ string: ''
171
+ headers:
172
+ Accept:
173
+ - "*/*; q=0.5, application/xml"
174
+ Accept-Encoding:
175
+ - gzip, deflate
176
+ Authorization:
177
+ - apikey df8658fb18403e29ef4a8437a8eb3705-us11
178
+ User-Agent:
179
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
180
+ response:
181
+ status:
182
+ code: 200
183
+ message: OK
184
+ headers:
185
+ Server:
186
+ - nginx
187
+ Content-Type:
188
+ - application/json; charset=utf-8
189
+ Content-Length:
190
+ - '8557'
191
+ X-Request-Id:
192
+ - acf5f935-1ae1-4851-ad92-357d60b3ff2a
193
+ Link:
194
+ - <https://us11.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
195
+ rel="describedBy"
196
+ Vary:
197
+ - Accept-Encoding
198
+ Date:
199
+ - Wed, 01 Jul 2015 14:30:32 GMT
200
+ Connection:
201
+ - keep-alive
202
+ body:
203
+ encoding: ASCII-8BIT
204
+ string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
205
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
206
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
207
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
208
+ Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
209
+ 19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
210
+ Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
211
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
212
+ 11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
213
+ Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
214
+ 22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
215
+ 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
216
+ Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
217
+ 07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
218
+ Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
219
+ 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
220
+ Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
221
+ 02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
222
+ http_version:
223
+ recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
224
+ - request:
225
+ method: get
226
+ uri: https://us11.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links&offset=30
227
+ body:
228
+ encoding: US-ASCII
229
+ string: ''
230
+ headers:
231
+ Accept:
232
+ - "*/*; q=0.5, application/xml"
233
+ Accept-Encoding:
234
+ - gzip, deflate
235
+ Authorization:
236
+ - apikey df8658fb18403e29ef4a8437a8eb3705-us11
237
+ User-Agent:
238
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
239
+ response:
240
+ status:
241
+ code: 200
242
+ message: OK
243
+ headers:
244
+ Server:
245
+ - nginx
246
+ Content-Type:
247
+ - application/json; charset=utf-8
248
+ Content-Length:
249
+ - '8557'
250
+ X-Request-Id:
251
+ - acf5f935-1ae1-4851-ad92-357d60b3ff2a
252
+ Link:
253
+ - <https://us11.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
254
+ rel="describedBy"
255
+ Vary:
256
+ - Accept-Encoding
257
+ Date:
258
+ - Wed, 01 Jul 2015 14:30:32 GMT
259
+ Connection:
260
+ - keep-alive
261
+ body:
262
+ encoding: ASCII-8BIT
263
+ string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24 19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24 22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"}],"total_items":37}'
264
+ http_version:
265
+ recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
266
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'mailchimp'
4
+
5
+ describe Mailchimp::Account, vcr: { cassette_name: 'mailchimp' } do
6
+ it 'is the expected class' do
7
+ expect(Mailchimp.connect.account).to be_a Mailchimp::Account
8
+ end
9
+
10
+ it 'has a name' do
11
+ expect(Mailchimp.connect.account.name).to eq 'InSite Arts'
12
+ end
13
+
14
+ it 'has an id' do
15
+ expect(Mailchimp.connect.account.id).to eq '1dbca289fd41b54838bcbb501'
16
+ end
17
+ end
@@ -0,0 +1,56 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'mailchimp'
4
+
5
+ describe Mailchimp::Client, vcr: { cassette_name: 'mailchimp' } do
6
+ context 'unauthorized API key' do
7
+ let(:bad_key) { 'xxxxxxxxxx-us11' }
8
+
9
+ it 'raises an exception if we try to get data' do
10
+ expect { Mailchimp::Client.new(bad_key).account }.to raise_error Mailchimp::Exception::APIKeyError
11
+ end
12
+
13
+ it 'says it is not connected' do
14
+ expect(Mailchimp::Client.new(bad_key).connected?).to be_falsey
15
+ end
16
+ end
17
+
18
+ context 'valid API key' do
19
+ it 'says it is connected' do
20
+ expect(Mailchimp::Client.new.connected?).to be_truthy
21
+ end
22
+
23
+ it 'is the expected class' do
24
+ expect(Mailchimp::Client.new).to be_a Mailchimp::Client
25
+ end
26
+
27
+ it 'has an account method' do
28
+ expect(Mailchimp::Client.new.account).to be_a Mailchimp::Account
29
+ end
30
+
31
+ it 'has a lists collection' do
32
+ lists = Mailchimp::Client.new.lists
33
+ expect(lists).to be_an Array
34
+ expect(lists.sample).to be_a Mailchimp::List
35
+ end
36
+ end
37
+
38
+ context 'problems we can retry the request for' do
39
+ let(:client) { Mailchimp::Client.new }
40
+
41
+ it 'eventually raises the exception' do
42
+ allow(client).to receive(:remote_no_payload).and_raise SocketError.new('test message')
43
+
44
+ expect { client.account }.to raise_error { |e|
45
+ expect(e).to be_an(SocketError)
46
+ expect(e.message).to eq('test message')
47
+ }
48
+ end
49
+
50
+ it 'only raises the exception after several retries' do
51
+ allow(client).to receive(:remote_no_payload).twice.and_raise SocketError.new('test message')
52
+ allow(client).to receive(:remote_no_payload).and_return '"id":1'
53
+ expect { client.account }.not_to raise_error
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'mailchimp'
4
+
5
+ describe Mailchimp::Exception::APIKeyError, vcr: { cassette_name: 'mailchimp' } do
6
+ let(:bad_key) { 'xxxxxxxxxx-us11' }
7
+
8
+ it 'raises an exception if the API key is not valid' do
9
+ expect { Mailchimp.connect(bad_key).account }.to raise_error { |e|
10
+ expect(e).to be_a Mailchimp::Exception::APIKeyError
11
+ expect(e.type).to eq 'http://kb.mailchimp.com/api/error-docs/401-api-key-invalid'
12
+ expect(e.title).to eq 'API Key Invalid'
13
+ expect(e.status).to eq 401
14
+ expect(e.detail).to eq 'Your API key may be invalid, or you\'ve attempted to access the wrong datacenter.'
15
+ }
16
+ end
17
+
18
+ it 'does not raise an exception if the API key is valid' do
19
+ expect { Mailchimp.connect.account }.not_to raise_error
20
+ end
21
+ end
22
+
23
+ describe Mailchimp::Exception::UnknownAttribute, vcr: { cassette_name: 'mailchimp' } do
24
+ let(:account) { Mailchimp.connect.account }
25
+
26
+ it 'returns a known attribute' do
27
+ expect { account.name }.not_to raise_error
28
+ end
29
+
30
+ it 'fails if we ask for an unknown attribute' do
31
+ expect { account.blarbleferry }.to raise_error Mailchimp::Exception::UnknownAttribute
32
+ end
33
+ end
34
+
35
+ describe Mailchimp::Exception::MissingId, vcr: { cassette_name: 'mailchimp' } do
36
+ let(:account) { Mailchimp.connect.account }
37
+
38
+ it 'accepts data with an id' do
39
+ expect { account.fail_unless_id_in 'id' => 1 }.not_to raise_error
40
+ end
41
+
42
+ it 'fails if we supply data without an id' do
43
+ expect { account.fail_unless_id_in 'name' => 'Terry' }.to raise_error Mailchimp::Exception::MissingId
44
+ end
45
+ end
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'mailchimp'
4
+
5
+ describe Mailchimp::List::InterestCategories, vcr: { cassette_name: 'mailchimp' } do
6
+ let(:list) { Mailchimp.connect.lists.first }
7
+ let(:interest_categories) { list.interest_categories }
8
+
9
+ it 'is the expected class' do
10
+ expect(interest_categories).to be_a Mailchimp::List::InterestCategories
11
+ end
12
+
13
+ it 'has a count' do
14
+ expect(interest_categories.count).to eq 2
15
+ end
16
+
17
+ it 'finds a matching instance' do
18
+ data = { 'title' => 'Colors' }
19
+ interest_category = interest_categories.find data
20
+ expect(interest_category).to be_a Mailchimp::List::InterestCategory
21
+ expect(interest_category.id).to eq '2ce011eb68'
22
+ end
23
+
24
+ context 'adding a new instance' do
25
+ context '#create' do
26
+ it 'can add a new instance' do
27
+ data = { 'title' => 'Days', 'type' => 'checkboxes' }
28
+ interest_category = interest_categories.create data
29
+ expect(interest_category).to be_a Mailchimp::List::InterestCategory
30
+ expect(interest_category.title).to eq 'Days'
31
+ end
32
+
33
+ it 'fails adding an instance with the same details' do
34
+ data = { 'title' => 'Colors', 'type' => 'checkboxes' }
35
+ expect { interest_categories.create data }.to raise_error Mailchimp::Exception::Duplicate
36
+ end
37
+ end
38
+
39
+ context '#first_or_create' do
40
+ it 'finds an instance with the same details' do
41
+ data = { 'title' => 'Colors', 'type' => 'checkboxes' }
42
+ interest_category = interest_categories.first_or_create data
43
+ expect(interest_category).to be_a Mailchimp::List::InterestCategory
44
+ expect(interest_category.title).to eq 'Colors'
45
+ end
46
+
47
+ it 'creates a new instance if one does not yet exist' do
48
+ data = { 'title' => 'Sex', 'type' => 'radio' }
49
+ interest_category = interest_categories.first_or_create data
50
+ expect(interest_category).to be_a Mailchimp::List::InterestCategory
51
+ expect(interest_category.title).to eq 'Sex'
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'mailchimp'
4
+
5
+ describe Mailchimp::List::InterestCategory, vcr: { cassette_name: 'mailchimp' } do
6
+ let(:lists) { Mailchimp.connect.lists }
7
+ let(:list) { lists.first }
8
+ let(:interest_category) { list.interest_categories.first }
9
+
10
+ it 'is the expected class' do
11
+ expect(interest_category).to be_a Mailchimp::List::InterestCategory
12
+ end
13
+
14
+ it 'has a title' do
15
+ expect(interest_category.title).to eq 'Colors'
16
+ end
17
+
18
+ it 'has an id' do
19
+ expect(interest_category.id).to eq '2ce011eb68'
20
+ end
21
+
22
+ it 'has an interests collection' do
23
+ interests = interest_category.interests
24
+ expect(interests).to be_an Array
25
+ expect(interests.sample).to be_a Mailchimp::List::InterestCategory::Interest
26
+ end
27
+ end