Skip to content

Commit d21fa99

Browse files
authored
Merge pull request #424 from intercom/jonny/add_contact_example_to_readme
Adding clearer instructions for find_all with contacts
2 parents 67c4fdd + 8821f34 commit d21fa99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ intercom.conversations.find_all(email: '[email protected]', type: 'user').each {|c
191191
intercom.conversations.find_all(email: '[email protected]', type: 'user', unread: false).each {|convo| ... }
192192
# Iterate over all unread conversations with a user based on the users email
193193
intercom.conversations.find_all(email: '[email protected]', type: 'user', unread: true).each {|convo| ... }
194+
# Iterate over all conversations for a user with their Intercom user ID
195+
intercom.conversations.find_all(intercom_user_id: '536e564f316c83104c000020', type: 'user').each {|convo| ... }
196+
# Iterate over all conversations for a lead
197+
# NOTE: to iterate over a lead's conversations you MUST use their Intercom User ID and type User
198+
intercom.conversations.find_all(intercom_user_id: lead.id, type: 'user').each {|convo| ... }
194199

195200
# FINDING A SINGLE CONVERSATION
196201
conversation = intercom.conversations.find(id: '1')

0 commit comments

Comments
 (0)