{"action":"created","issue":{"url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/14","labels_url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/14/comments","events_url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/14/events","html_url":"https://github.com/GetAmbassador/mbsy/issues/14","id":85139130,"number":14,"title":"Help with referral events","user":{"login":"martinstreicher","id":31319,"avatar_url":"https://avatars.githubusercontent.com/u/31319?v=3","gravatar_id":"","url":"https://api.github.com/users/martinstreicher","html_url":"https://github.com/martinstreicher","followers_url":"https://api.github.com/users/martinstreicher/followers","following_url":"https://api.github.com/users/martinstreicher/following{/other_user}","gists_url":"https://api.github.com/users/martinstreicher/gists{/gist_id}","starred_url":"https://api.github.com/users/martinstreicher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinstreicher/subscriptions","organizations_url":"https://api.github.com/users/martinstreicher/orgs","repos_url":"https://api.github.com/users/martinstreicher/repos","events_url":"https://api.github.com/users/martinstreicher/events{/privacy}","received_events_url":"https://api.github.com/users/martinstreicher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T15:08:37Z","updated_at":"2015-06-04T15:15:28Z","closed_at":null,"body":"I am unable to get referrals to work. Here is the call I am making...\r\n\r\n```\r\nMbsy::Event.create(\r\n  :auto_create=>1,\r\n  :campaign_uid=>29561,\r\n  :email=>\"martin.streicher+2@locomotivellc.com\", \r\n  :email_new_ambassador=>1,\r\n  :revenue=>99, \r\n  :short_code=>\"18964313\", \r\n  :transaction_uid=>\"5\")\r\n```\r\n\r\nI assume that:\r\n* email is the email address of the person that just signed up.\r\n* short_code is the short_code assigned to the referring ambassador.\r\n\r\nI do get a new ambassador with that email address. However, I cannot get the referring ambassador to earn any revenue. The response I get is:\r\n\r\n```\r\n{\r\n    \"referring_ambassador\" => {\r\n              \"first_name\" => nil,\r\n               \"last_name\" => nil,\r\n                   \"email\" => nil,\r\n                     \"uid\" => nil,\r\n              \"commission\" => nil,\r\n           \"balance_money\" => 0,\r\n          \"balance_points\" => 0,\r\n           \"memorable_url\" => \"http://mbsy.co\",\r\n        \"unique_referrals\" => 0,\r\n                 \"sandbox\" => nil,\r\n                 \"custom1\" => \"\",\r\n                 \"custom2\" => \"\",\r\n                 \"custom3\" => \"\"\r\n    },\r\n              \"ambassador\" => {\r\n              \"first_name\" => \"\",\r\n               \"last_name\" => \"\",\r\n              \"created_at\" => \"2015-06-04T15:05:00.837-4000\",\r\n                   \"email\" => \"martin.streicher+2@locomotivellc.com\",\r\n                     \"uid\" => nil,\r\n           \"balance_money\" => \"0.00\",\r\n          \"balance_points\" => \"0.00\",\r\n           \"memorable_url\" => \"http://mbsy.co/realvolve/18964324\",\r\n        \"unique_referrals\" => \"0\",\r\n            \"count_shares\" => \"0\",\r\n                 \"sandbox\" => \"0\",\r\n                 \"custom1\" => \"\",\r\n                 \"custom2\" => \"\",\r\n                 \"custom3\" => \"\",\r\n                  \"groups\" => \"2\",\r\n          \"campaign_links\" => [\r\n            [0] {\r\n                        \"campaign_uid\" => \"29561\",\r\n                       \"campaign_name\" => \"Test\",\r\n                \"campaign_description\" => \"Test\",\r\n                      \"initial_reward\" => {\r\n                    \"type_text\" => \"Flat Monetary\",\r\n                    \"type_code\" => \"F\",\r\n                       \"amount\" => \"1\"\r\n                },\r\n                    \"recurring_reward\" => {\r\n                    \"type_text\" => \"None\",\r\n                    \"type_code\" => \"D\",\r\n                       \"amount\" => \"0\"\r\n                },\r\n                             \"sandbox\" => \"0\",\r\n                             \"private\" => \"0\",\r\n                    \"facebook_enabled\" => \"0\",\r\n                                 \"url\" => \"http://mbsy.co/cjvhB\",\r\n                  \"total_money_earned\" => \"0.00\",\r\n                 \"total_points_earned\" => \"0.00\",\r\n                    \"unique_referrals\" => \"0\"\r\n            }\r\n        ]\r\n    },\r\n                 \"company\" => {\r\n          \"company_name\" => \"Realvolve\",\r\n           \"company_url\" => \"http://www.realvolve.com\",\r\n         \"company_email\" => \"martin.streicher@realvolve.com\",\r\n            \"point_name\" => \"points\",\r\n        \"outgoing_email\" => \"ambassadors@realvolve.com\",\r\n            \"avatar_url\" => \"https://ambassador-api.s3.amazonaws.com/generic_avatar.png\"\r\n    }\r\n}\r\n```\r\n\r\n... which looks right except the top portion is empty. I would expect the short code to be enough to connect the revenue event with an ambassador. \r\n\r\nHow do I add a revenue event to referring ambassador? Is the short code the campaign short code? If so, how does one tie that together. \r\n\r\nWhat URL should the ambassador be sharing? I assumed it was the mbsy.co/realvolve/#### URL. \r\n\r\nHelp!. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/comments/108931492","html_url":"https://github.com/GetAmbassador/mbsy/issues/14#issuecomment-108931492","issue_url":"https://api.github.com/repos/GetAmbassador/mbsy/issues/14","id":108931492,"user":{"login":"martinstreicher","id":31319,"avatar_url":"https://avatars.githubusercontent.com/u/31319?v=3","gravatar_id":"","url":"https://api.github.com/users/martinstreicher","html_url":"https://github.com/martinstreicher","followers_url":"https://api.github.com/users/martinstreicher/followers","following_url":"https://api.github.com/users/martinstreicher/following{/other_user}","gists_url":"https://api.github.com/users/martinstreicher/gists{/gist_id}","starred_url":"https://api.github.com/users/martinstreicher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinstreicher/subscriptions","organizations_url":"https://api.github.com/users/martinstreicher/orgs","repos_url":"https://api.github.com/users/martinstreicher/repos","events_url":"https://api.github.com/users/martinstreicher/events{/privacy}","received_events_url":"https://api.github.com/users/martinstreicher/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T15:15:28Z","updated_at":"2015-06-04T15:15:28Z","body":"\nIs the short code unique per ambassador and campaign? I assume so and I assume that I want to send this particular code back to the user as their unique URL to share? \n\n\n\n\nOn Jun 4, 2015, at 11:13 AM, Jeff Epstein <notifications@github.com> wrote:\n\n> Your assumptions are correct, the reason why it's not working is because that isn't short_code of that Ambassador. You actually used the \"Ambassador ID\" (which is appended to the end of the Memorable URL) -- the short_code is appended to the campaign URLs.\n> \n> For example, the short code of the referred party is \"cjvhB\"\n> \n> \n> Once you make that change, it will work. Thanks!\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n\n"}}