Skip to content

Commit 8409f89

Browse files
committed
Update README
1 parent 06d1aec commit 8409f89

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For generating Intercom JavaScript script tags for Rails, please see https://git
1010

1111
## Upgrading information
1212

13-
Version 4 of intercom-ruby is not backwards compatible with previous versions. Please see our [migration guide](https://github.com/intercom/ruby_v4/wiki/Migration-guide-for-v4) for full details of breaking changes.
13+
Version 4 of intercom-ruby is not backwards compatible with previous versions. Please see our [migration guide](https://github.com/intercom/intercom-ruby/wiki/Migration-guide-for-v4) for full details of breaking changes.
1414

1515
This version of the gem is compatible with `Ruby 2.1` and above.
1616

@@ -66,6 +66,8 @@ Resources this API supports:
6666
### Examples
6767

6868
#### Contacts
69+
Note that this is a new resource compatible only with the new [Contacts API](https://developers.intercom.com/intercom-api-reference/reference#contacts-model) released in API v2.0.
70+
6971
```ruby
7072
# Create a contact with "lead" role
7173
contact = intercom.contacts.create(email: "some_contact2@example.com", role: "lead")
@@ -122,10 +124,10 @@ contact.notes.each {|n| p n.body}
122124

123125
# Add a contact to a company
124126
company = intercom.companies.find(id: "123")
125-
contact.add_company(id: company.id})
127+
contact.add_company(id: company.id)
126128

127129
# Remove a contact from a company
128-
contact.remove_company(id: company.id})
130+
contact.remove_company(id: company.id)
129131

130132
# List companies for a contact
131133
contact.companies.each {|c| p c.name}
@@ -307,14 +309,19 @@ conversation = intercom.conversations.find(id: '1')
307309
# INTERACTING WITH THE PARTS OF A CONVERSATION
308310
# Getting the subject of a part (only applies to email-based conversations)
309311
conversation.source.subject
312+
310313
# Get the part_type of the first part
311314
conversation.conversation_parts.first.part_type
315+
312316
# Get the body of the second part
313317
conversation.conversation_parts[1].body
318+
314319
# Get statistics related to the conversation
315-
conversation.statistics["first_contact_reply_at"]
316-
# Get information about the rating of a conversation
317-
conversation.conversation_rating.rating
320+
conversation.statistics.time_to_admin_reply
321+
conversation.statistics.last_assignment_at
322+
323+
# Get information on the sla applied to a conversation
324+
conversation.sla_applied.sla_name
318325

319326
# REPLYING TO CONVERSATIONS
320327
# User (identified by email) replies with a comment
@@ -366,14 +373,13 @@ intercom.conversations.run_assignment_rules(conversation.id)
366373
# For full detail on possible queries, please refer to the API documentation:
367374
# https://developers.intercom.com/intercom-api-reference/reference
368375

369-
# Search for open conversations, getting 10 per page and sorting by the created_at date
376+
# Search for open conversations sorted by the created_at date
370377
conversations = intercom.conversations.search(
371378
query: {
372379
field: "open",
373380
operator: "=",
374381
value: true
375382
},
376-
per_page: 10,
377383
sort_field: "created_at",
378384
sort_order: "descending"
379385
)
@@ -387,10 +393,10 @@ conversation = intercom.conversations.find(id: "1")
387393
admin = intercom.admins.find(id: "1")
388394

389395
# Add a tag to a conversation
390-
conversation.add_tag(id: tag.id, admin_id: admin.id})
396+
conversation.add_tag(id: tag.id, admin_id: admin.id)
391397

392398
# Remove a tag from a conversation
393-
conversation.remove_tag(id: tag.id, admin_id: admin.id})
399+
conversation.remove_tag(id: tag.id, admin_id: admin.id)
394400

395401
```
396402

0 commit comments

Comments
 (0)