mailchimp-api 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mailchimp.rb +3 -1
  2. data/lib/mailchimp/api.rb +15 -9
  3. metadata +2 -2
@@ -22,8 +22,10 @@ module Mailchimp
22
22
  raise Error, 'You must provide a MailChimp API key' unless apikey
23
23
 
24
24
  @apikey = apikey
25
- if @apikey.split('-').length == 2
25
+ if @apikey.split('-').length == 2
26
26
  @host = "https://#{@apikey.split('-')[1]}.api.mailchimp.com"
27
+ else
28
+ raise InvalidApiKeyError, 'Your MailChimp API key must contain a suffix subdomain (e.g. "-us8").'
27
29
  end
28
30
 
29
31
  @session = Excon.new @host
@@ -479,7 +479,7 @@ module Mailchimp
479
479
  # - [Array] data An array of structs representing individual conversations
480
480
  # - [String] unique_id A string identifying this particular conversation
481
481
  # - [Int] message_count The total number of messages in this conversation
482
- # - [String] campaign_id The unique identifier of the campaign this conversation is associated with
482
+ # - [String] campaign_id The unique identifier of the campaign this conversation is associated with (will be null if the campaign has been deleted)
483
483
  # - [String] list_id The unique identifier of the list this conversation is associated with
484
484
  # - [Int] unread_messages The number of messages in this conversation which have not yet been read.
485
485
  # - [String] from_label A label representing the sender of this message.
@@ -517,7 +517,7 @@ module Mailchimp
517
517
  return @master.call 'conversations/messages', _params
518
518
  end
519
519
 
520
- # Retrieve conversation messages
520
+ # Reply to a conversation
521
521
  # @param [String] conversation_id the unique_id of the conversation to retrieve the messages for, can be obtained by calling converstaions/list().
522
522
  # @param [String] message the text of the message you want to send.
523
523
  # @return [Hash] Message data from the created message
@@ -556,7 +556,7 @@ module Mailchimp
556
556
  # - [Int] line_num optional the line number of the item on the order. We will generate these if they are not passed
557
557
  # - [Int] product_id the store's internal Id for the product. Lines that do no contain this will be skipped
558
558
  # - [String] sku optional the store's internal SKU for the product. (max 30 bytes)
559
- # - [String] product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
559
+ # - [String] product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id) (max 500 bytes)
560
560
  # - [Int] category_id (required) the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
561
561
  # - [String] category_name (required) the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
562
562
  # - [Double] qty optional the quantity of the item ordered - defaults to 1
@@ -1171,12 +1171,13 @@ module Mailchimp
1171
1171
  # Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list in order to be included - this <strong>will not</strong> subscribe them to the list!
1172
1172
  # @param [String] id the list id to connect to. Get by calling lists/list()
1173
1173
  # @param [Int] seg_id the id of the static segment to modify - get from lists/static-segments()
1174
- # @param [Array] batch an array of structs for each address using the following keys:
1174
+ # @param [Array] batch an array of email structs, each with with one of the following keys:
1175
1175
  # - [String] email an email address
1176
- # - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
1176
+ # - [String] euid the unique id for an email address (not list related) - the email "id" returned from lists/member-info(), Webhooks, Campaigns, etc.
1177
1177
  # - [String] leid the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
1178
1178
  # @return [Hash] an array with the results of the operation
1179
1179
  # - [Int] success_count the total number of successful updates (will include members already in the segment)
1180
+ # - [Int] error_count the total number of errors
1180
1181
  # - [Array] errors structs for each error including:
1181
1182
  # - [String] email whatever was passed in the email parameter
1182
1183
  # - [String] email the email address added
@@ -1297,7 +1298,7 @@ module Mailchimp
1297
1298
  # - [String] email an email address
1298
1299
  # - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
1299
1300
  # - [String] leid the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
1300
- # @param [Array] merge_vars array of new field values to update the member with. See merge_vars in lists/subscribe() for details.
1301
+ # @param [Hash] merge_vars new field values to update the member with. See merge_vars in lists/subscribe() for details.
1301
1302
  # @param [String] email_type change the email type preference for the member ("html" or "text"). Leave blank to keep the existing preference (optional)
1302
1303
  # @param [Boolean] replace_interests flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
1303
1304
  # @return [Hash] the ids for this subscriber
@@ -1369,7 +1370,7 @@ module Mailchimp
1369
1370
  # - [String] from_subject optional - only lists that have a default from email matching this
1370
1371
  # - [String] created_before optional - only show lists that were created before this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
1371
1372
  # - [String] created_after optional - only show lists that were created since this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
1372
- # - [Boolean] exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
1373
+ # - [Boolean] exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to false
1373
1374
  # @param [Int] start optional - control paging of lists, start results at this list #, defaults to 1st page of data (page 0)
1374
1375
  # @param [Int] limit optional - control paging of lists, number of lists to return with each call, defaults to 25 (max=100)
1375
1376
  # @param [String] sort_field optional - "created" (the created date, default) or "web" (the display order in the web app). Invalid values will fall back on "created" - case insensitive.
@@ -1472,7 +1473,7 @@ module Mailchimp
1472
1473
  # - [Boolean] fb_comments optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true".
1473
1474
  # - [Boolean] timewarp optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time.
1474
1475
  # - [Boolean] ecomm360 optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign
1475
- # - [Array] crm_tracking optional If set, an array of structs to enable CRM tracking for:
1476
+ # - [Hash] crm_tracking optional If set, a struct to enable CRM tracking for:
1476
1477
  # - [Hash] salesforce optional Enable SalesForce push back
1477
1478
  # - [Bool] campaign optional - if true, create a Campaign object and update it with aggregate stats
1478
1479
  # - [Bool] notes optional - if true, attempt to update Contact notes based on email address
@@ -1618,6 +1619,11 @@ module Mailchimp
1618
1619
  # - [Int] comments_total total number of comments left on this campaign
1619
1620
  # - [Int] comments_unread total number of unread comments for this campaign based on the login the apikey belongs to
1620
1621
  # - [Hash] summary if available, the basic aggregate stats returned by reports/summary
1622
+ # - [Hash] social_card If a social card has been attached to this campaign:
1623
+ # - [String] title The title of the campaign used with the card
1624
+ # - [String] description The description used with the card
1625
+ # - [String] image_url The URL of the image used with the card
1626
+ # - [String] enabled Whether or not the social card is enabled for this campaign.
1621
1627
  # - [Array] errors structs of any errors found while loading lists - usually just from providing invalid list ids
1622
1628
  # - [String] filter the filter that caused the failure
1623
1629
  # - [String] value the filter value that caused the failure
@@ -2240,7 +2246,7 @@ module Mailchimp
2240
2246
  # - [Int] unique_opens the unique opens for this timezone
2241
2247
  # - [Int] clicks the total clicks for this timezone
2242
2248
  # - [String] last_click the date/time of the last click for this timezone
2243
- # - [Int] unique_opens the unique clicks for this timezone
2249
+ # - [Int] unique_clicks the unique clicks for this timezone
2244
2250
  # - [Int] bounces the total bounces for this timezone
2245
2251
  # - [Int] total the total number of members sent to in this timezone
2246
2252
  # - [Int] sent the total number of members delivered to in this timezone
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailchimp-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-09 00:00:00.000000000 Z
12
+ date: 2014-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json