Skip to content

Commit 8a89cb6

Browse files
authored
Adding example to query multiple users (#456)
1 parent 20dcfc5 commit 8a89cb6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ intercom.users.all.map {|user| user.email }
9191
intercom.users.find_all(type: 'users', page: 1, per_page: 10, created_since: 2, order: :asc).to_a.each_with_index {|usr, i| puts "#{i+1}: #{usr.name}"};
9292
# Paginate through your list of users choosing how many to return per page (default and max is 50 per page)
9393
intercom.users.find_all(type: 'users', page: 1, per_page: 10, order: :asc).to_a.each_with_index {|usr, i| puts "#{i+1}: #{usr.name}"}
94+
95+
# Duplicate users? If you have duplicate users you can search for them via their email address.
96+
# Note this feature is only available from version 1.1 of the API so you will need to switch to that version
97+
# This will return multiple users if they have the same email address
98+
usrs = intercom.users.find_all(type: 'users', email: '[email protected]', page: 1, per_page: 10, order: :asc)
99+
# This returns a user.list so you can access it via
100+
usrs.to_a.each_with_index {|usr, i| puts "#{i+1}: #{usr.id}"};
101+
94102
# If you have over 10,000 users then you will need to use the scroll function to list your users
95103
# otherwise you will encounter a page limit with list all your users
96104
# You can use the scroll method to list all your users

0 commit comments

Comments
 (0)