{"action":"created","issue":{"url":"https://api.github.com/repos/amro/gibbon/issues/157","labels_url":"https://api.github.com/repos/amro/gibbon/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/amro/gibbon/issues/157/comments","events_url":"https://api.github.com/repos/amro/gibbon/issues/157/events","html_url":"https://github.com/amro/gibbon/issues/157","id":116855455,"number":157,"title":"Upsert producing 400 error","user":{"login":"astjohn","id":47390,"avatar_url":"https://avatars.githubusercontent.com/u/47390?v=3","gravatar_id":"","url":"https://api.github.com/users/astjohn","html_url":"https://github.com/astjohn","followers_url":"https://api.github.com/users/astjohn/followers","following_url":"https://api.github.com/users/astjohn/following{/other_user}","gists_url":"https://api.github.com/users/astjohn/gists{/gist_id}","starred_url":"https://api.github.com/users/astjohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astjohn/subscriptions","organizations_url":"https://api.github.com/users/astjohn/orgs","repos_url":"https://api.github.com/users/astjohn/repos","events_url":"https://api.github.com/users/astjohn/events{/privacy}","received_events_url":"https://api.github.com/users/astjohn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-13T21:28:02Z","updated_at":"2015-11-14T02:22:01Z","closed_at":"2015-11-14T02:15:45Z","body":"Thanks for this great library. I keep running into `Gibbon::MailChimpError: the server responded with status 400`. I read a past issue that stated this might occur for existing email addresses. To combat this, I've attempted to use upsert.\r\n\r\n```\r\nsubscriber_hash = Digest::MD5.hexdigest(\"abc123@gmail.com\")\r\nparams = {:status=>\"subscribe\", :language=>\"en\", :email_address=>\"abc123@gmail.com\", :merge_fields=>{:FNAME=>\"Jimmy\", :LNAME=>\"Bean\"}}\r\n\r\ngibbon.lists(\"abc123\").members(subscriber_hash).upsert(body: params)\r\n=>\r\nGibbon::MailChimpError: the server responded with status 400\r\n```\r\n\r\nThe error is produced whether the email exists or not in the list. I've replaced the list_id from the actual in the example above. \r\n\r\nYour help is greatly appreciated. \r\n"},"comment":{"url":"https://api.github.com/repos/amro/gibbon/issues/comments/156610771","html_url":"https://github.com/amro/gibbon/issues/157#issuecomment-156610771","issue_url":"https://api.github.com/repos/amro/gibbon/issues/157","id":156610771,"user":{"login":"amro","id":16900,"avatar_url":"https://avatars.githubusercontent.com/u/16900?v=3","gravatar_id":"","url":"https://api.github.com/users/amro","html_url":"https://github.com/amro","followers_url":"https://api.github.com/users/amro/followers","following_url":"https://api.github.com/users/amro/following{/other_user}","gists_url":"https://api.github.com/users/amro/gists{/gist_id}","starred_url":"https://api.github.com/users/amro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amro/subscriptions","organizations_url":"https://api.github.com/users/amro/orgs","repos_url":"https://api.github.com/users/amro/repos","events_url":"https://api.github.com/users/amro/events{/privacy}","received_events_url":"https://api.github.com/users/amro/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T02:22:01Z","updated_at":"2015-11-14T02:22:01Z","body":"Glad it worked!\n\n\n> On Nov 13, 2015, at 9:15 PM, Adam St. John <notifications@github.com> wrote:\n> \n> Damn. The subscribed typo was exactly it. Guess it was a long day. Sorry! Good point about the downcase. We have that in the real code block. Thanks again!\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}