intercom-ruby: `find_all` does not find multiple users with same email address
Version info
- intercom-ruby version: 3.5.9
- Ruby version: 2.3.3p222
Expected behavior
Return all users that match a given email address.
Actual behavior
Intercom::MultipleMatchingUsersError: Multiple existing users match this email address xx@example.com - must be more specific using user_id
Steps to reproduce
intercom.users.find_all(type: 'users', email:'xx@example.com').each_with_index { |u,i| p u }
Question
How to fetch all users that match a given email address without providing any additional information?
The intercom web-interface (search) can do it, but how is it done via the API? We don’t know any userids, only the email address.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 22 (10 by maintainers)
Just want to add that we consider this a bug, not a feature. A portion of our users is inaccessible through the API.
This is completely bananas - your data suddenly becomes unqueryable in this dimension as soon as you get a single dup in Intercom…
As noted, this is an issue with the API which we will be addressing in the near future, it is on our short term plan. So I will close this issue as it is not an SDK issue and something we are addressing on our API. we can then look into if there is any issue once we make the change on the API
Ah, wonderful! Thanks @theandrewykim, @jonnyom
Hi all, Yeah, this is a restriction at the moment with the API, i.e. it looks for a specific match so if you have multiple emails it will return the error. So it is not a restriction with the SDK as such. We are aware of this issue and thanks for bringing it up. It is frustrating given that you can identify duplicates via the web UI. We are trialling something internally to see if it resolves this issue to allow you search for users with multiple similar attributes such as email. I cannot provide an ETA at the moment but we if it works we will update the API which should resolve this issue. I will leave this issue open as it may be something other people want to comment on even for suggestions of how they would like it to work as well
np, thanks for noting that. we do understand that this is a restriction for a number of use cases so we are tacking it as such, i.e. something that needs to be resolved.