{"action":"created","issue":{"url":"https://api.github.com/repos/intercom/intercom-ruby/issues/159","labels_url":"https://api.github.com/repos/intercom/intercom-ruby/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/intercom/intercom-ruby/issues/159/comments","events_url":"https://api.github.com/repos/intercom/intercom-ruby/issues/159/events","html_url":"https://github.com/intercom/intercom-ruby/pull/159","id":81931797,"number":159,"title":"WIP client based intercom ruby","user":{"login":"josler","id":167061,"avatar_url":"https://avatars.githubusercontent.com/u/167061?v=3","gravatar_id":"","url":"https://api.github.com/users/josler","html_url":"https://github.com/josler","followers_url":"https://api.github.com/users/josler/followers","following_url":"https://api.github.com/users/josler/following{/other_user}","gists_url":"https://api.github.com/users/josler/gists{/gist_id}","starred_url":"https://api.github.com/users/josler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josler/subscriptions","organizations_url":"https://api.github.com/users/josler/orgs","repos_url":"https://api.github.com/users/josler/repos","events_url":"https://api.github.com/users/josler/events{/privacy}","received_events_url":"https://api.github.com/users/josler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-28T13:42:55Z","updated_at":"2015-05-28T17:31:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/intercom/intercom-ruby/pulls/159","html_url":"https://github.com/intercom/intercom-ruby/pull/159","diff_url":"https://github.com/intercom/intercom-ruby/pull/159.diff","patch_url":"https://github.com/intercom/intercom-ruby/pull/159.patch"},"body":"```ruby\r\nclient = Intercom::Client.new('app_id', 'api_key')\r\n\r\n# find user by email\r\nuser = client.users.find(email: 'test1@example.com')\r\nputs user.email\r\n\r\n# loop over all users\r\nclient.users.all.each do |user|\r\n  puts user.email\r\nend\r\n\r\n# save existing\r\nuser.user_id = \"77bnh4\"\r\nclient.users.save(user)\r\n\r\n# create new, then delete (2 requests)\r\nu = client.users.create( user_id: 'doodoo' )\r\nclient.users.delete(u)\r\n```"},"comment":{"url":"https://api.github.com/repos/intercom/intercom-ruby/issues/comments/106511125","html_url":"https://github.com/intercom/intercom-ruby/pull/159#issuecomment-106511125","issue_url":"https://api.github.com/repos/intercom/intercom-ruby/issues/159","id":106511125,"user":{"login":"josler","id":167061,"avatar_url":"https://avatars.githubusercontent.com/u/167061?v=3","gravatar_id":"","url":"https://api.github.com/users/josler","html_url":"https://github.com/josler","followers_url":"https://api.github.com/users/josler/followers","following_url":"https://api.github.com/users/josler/following{/other_user}","gists_url":"https://api.github.com/users/josler/gists{/gist_id}","starred_url":"https://api.github.com/users/josler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josler/subscriptions","organizations_url":"https://api.github.com/users/josler/orgs","repos_url":"https://api.github.com/users/josler/repos","events_url":"https://api.github.com/users/josler/events{/privacy}","received_events_url":"https://api.github.com/users/josler/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T17:31:57Z","updated_at":"2015-05-28T17:31:57Z","body":"messages:\r\n\r\n```ruby\r\nclient.messages.create(:from => { :type => \"user\", :email => \"jim@example.com\" }, :body => \"halp\")\r\n```\r\n\r\nnotes:\r\n\r\n```ruby\r\nclient.notes.create(\"body\" => \"Note to leave on user\"\r\nclient.notes.find(id: '123')\r\n```"}}