README.rdoc in intercom-0.0.5 vs README.rdoc in intercom-0.0.6
- old
+ new
@@ -1,9 +1,11 @@
Ruby bindings for the Intercom API (https://api.intercom.io). See http://docs.intercom.io/api for more details.
Yardoc is available at http://rubydoc.info/github/intercom/intercom-ruby/master/frames
+For generating Intercom javascript script tags, please see https://github.com/intercom/intercom-rails
+
== Installation
gem install intercom
Using bundler:
@@ -22,15 +24,23 @@
POST,PUT,GET https://api.intercom.io/v1/users
POST,PUT,GET https://api.intercom.io/v1/users/messages
POST https://api.intercom.io/v1/users/impressions
-==== Users
+=== Examples:
- user = Intercom::User.find(:email => "bob@example.com")
+==== Users
+ user = Intercom::User.find_by_email("bob@example.com")
+ user.custom_data["average_monthly_spend"] = 1234.56
+ user.save
+ user = Intercom::User.find_by_user_id("bob@example.com")
user = Intercom::User.create(:email => "bob@example.com", :name => "Bob Smith")
user = Intercom::User.new(params)
user.save
+ Intercom::User.all.count
+ Intercom::User.all.each {|user| puts %Q(#{user.email} - #{user.custom_data["average_monthly_spend"]}) }
+ Intercom::User.all.map {|user| user.email }
+
==== Messages
Intercom::Message.create(:email => "bob@example.com", :body => "Example message from bob@example.com to your application on Intercom.")
Intercom::Message.find(:email => "bob@example.com", :thread_id => 123)