README.md in intercom-3.0.6 vs README.md in intercom-3.1.0
- old
+ new
@@ -20,11 +20,11 @@
gem install intercom
Using bundler:
- gem 'intercom', "~> 3.0.6"
+ gem 'intercom', "~> 3.1.0"
## Basic Usage
### Configure your client
@@ -143,25 +143,25 @@
#### Conversations
```ruby
# FINDING CONVERSATIONS FOR AN ADMIN
# Iterate over all conversations (open and closed) assigned to an admin
-intercom.conversations.find_all(:type => 'admin', :id => '7').each do {|convo| ... }
+intercom.conversations.find_all(:type => 'admin', :id => '7').each {|convo| ... }
# Iterate over all open conversations assigned to an admin
-intercom.conversations.find_all(:type => 'admin', :id => 7, :open => true).each do {|convo| ... }
+intercom.conversations.find_all(:type => 'admin', :id => 7, :open => true).each {|convo| ... }
# Iterate over closed conversations assigned to an admin
-intercom.conversations.find_all(:type => 'admin', :id => 7, :open => false).each do {|convo| ... }
+intercom.conversations.find_all(:type => 'admin', :id => 7, :open => false).each {|convo| ... }
# Iterate over closed conversations for assigned an admin, before a certain moment in time
-intercom.conversations.find_all(:type => 'admin', :id => 7, :open => false, :before => 1374844930).each do {|convo| ... }
+intercom.conversations.find_all(:type => 'admin', :id => 7, :open => false, :before => 1374844930).each {|convo| ... }
# FINDING CONVERSATIONS FOR A USER
# Iterate over all conversations (read + unread, correct) with a user based on the users email
-intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user').each do {|convo| ... }
+intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user').each {|convo| ... }
# Iterate over through all conversations (read + unread) with a user based on the users email
-intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user', :unread => false).each do {|convo| ... }
+intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user', :unread => false).each {|convo| ... }
# Iterate over all unread conversations with a user based on the users email
-intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user', :unread => true).each do {|convo| ... }
+intercom.conversations.find_all(:email => 'joe@example.com', :type => 'user', :unread => true).each {|convo| ... }
# FINDING A SINGLE CONVERSATION
conversation = intercom.conversations.find(:id => '1')
# INTERACTING WITH THE PARTS OF A CONVERSATION
@@ -173,11 +173,29 @@
conversation.conversation_parts[1].body
# REPLYING TO CONVERSATIONS
# User (identified by email) replies with a comment
intercom.conversations.reply(:id => conversation.id, :type => 'user', :email => 'joe@example.com', :message_type => 'comment', :body => 'foo')
-# Admin (identified by email) replies with a comment
-intercom.conversations.reply(:id => conversation.id, :type => 'admin', :email => 'bob@example.com', :message_type => 'comment', :body => 'bar')
+# Admin (identified by id) replies with a comment
+intercom.conversations.reply(:id => conversation.id, :type => 'admin', :admin_id => '123', :message_type => 'comment', :body => 'bar')
+
+# Open
+intercom.conversations.open(id: conversation.id, admin_id: '123')
+
+# Close
+intercom.conversations.close(id: conversation.id, admin_id: '123')
+
+# Assign
+intercom.conversations.assign(id: conversation.id, admin_id: '123', assignee_id: '124')
+
+# Reply and Open
+intercom.conversations.reply(:id => conversation.id, :type => 'admin', :admin_id => '123', :message_type => 'open', :body => 'bar')
+
+# Reply and Close
+intercom.conversations.reply(:id => conversation.id, :type => 'admin', :admin_id => '123', :message_type => 'close', :body => 'bar')
+
+# ASSIGNING CONVERSATIONS TO ADMINS
+intercom.conversations.reply(:id => conversation.id, :type => 'admin', :assignee_id => assignee_admin.id, :admin_id => admin.id, :message_type => 'assignment')
# MARKING A CONVERSATION AS READ
intercom.conversations.mark_read(conversation.id)
```