{"action":"created","issue":{"url":"https://api.github.com/repos/amro/gibbon/issues/146","labels_url":"https://api.github.com/repos/amro/gibbon/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/amro/gibbon/issues/146/comments","events_url":"https://api.github.com/repos/amro/gibbon/issues/146/events","html_url":"https://github.com/amro/gibbon/issues/146","id":112410775,"number":146,"title":"Can't manage to upsert :-/","user":{"login":"sebabouche","id":6465147,"avatar_url":"https://avatars.githubusercontent.com/u/6465147?v=3","gravatar_id":"","url":"https://api.github.com/users/sebabouche","html_url":"https://github.com/sebabouche","followers_url":"https://api.github.com/users/sebabouche/followers","following_url":"https://api.github.com/users/sebabouche/following{/other_user}","gists_url":"https://api.github.com/users/sebabouche/gists{/gist_id}","starred_url":"https://api.github.com/users/sebabouche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebabouche/subscriptions","organizations_url":"https://api.github.com/users/sebabouche/orgs","repos_url":"https://api.github.com/users/sebabouche/repos","events_url":"https://api.github.com/users/sebabouche/events{/privacy}","received_events_url":"https://api.github.com/users/sebabouche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-20T16:42:37Z","updated_at":"2015-10-20T16:52:53Z","closed_at":null,"body":"Hi,\r\nI'm trying to take advantage from the fabulous **upsert** technique described in the README in a Rails App but with no success so far:\r\n\r\n    class SubscribeUserToMailingListJob < ActiveJob::Base\r\n        queue_as :default\r\n\r\n        def perform(user)\r\n            begin\r\n                gibbon = Gibbon::Request.new\r\n                member_id = Digest::MD5.hexdigest(user.email.downcase)\r\n                list = ENV[\"MAILCHIMP_LIST_ID\"]\r\n                gibbon.lists(list).members(member_id).upsert(body: {\r\n                                                            email_address: user.email, \r\n                                                            status: \"subscribed\",\r\n                                                            double_optin: false,\r\n                                                            merge_fields: {FROM: \"Store\"} \r\n                                                          })\r\n\r\n              # gibbon.lists(list).members.create(body: {\r\n              #                                           email_address: user.email, \r\n              #                                           status: \"subscribed\",\r\n              #                                           double_optin: false,\r\n              #                                           merge_fields: {FROM: \"Store\"} \r\n              #                                         })\r\n\r\n            rescue Exception => e\r\n                logger.error e.title\r\n                logger.error e.detail\r\n                logger.error e.body\r\n            end\r\n        end\r\n    end\r\n\r\nIt was working like a charm with create. But I was as expected getting errors when trying to create an already created subscriber.\r\n\r\nI've read this issue https://github.com/amro/gibbon/issues/145 and tried to trigger things from the console."},"comment":{"url":"https://api.github.com/repos/amro/gibbon/issues/comments/149631135","html_url":"https://github.com/amro/gibbon/issues/146#issuecomment-149631135","issue_url":"https://api.github.com/repos/amro/gibbon/issues/146","id":149631135,"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-10-20T16:52:53Z","updated_at":"2015-10-20T16:52:53Z","body":"Did you change the parameter, as I suggested? double_optin isn't a valid parameter in API v3, if I'm not mistaken."}}