Comments (12)
That works. So I think I figured this out. In my testing outside of my app I was searching with code such as the following:
client.list_leads(email: "[email protected]")
# total_results == 0
But actually email: needs to be in quotes as well, as follows:
client.list_leads("email: [email protected]")
# total_results == 4 (though only one lead actually has that exact email)
This despite the fact that it seems to work either way for a name query:
client.list_leads(name: "Test")
client.list_leads("name: Test")
# These 2 queries return the same results.
An additional piece of why I had difficulty troubleshooting this is because even though my production app does the email query the way that works, all of the emails I was using for testing began returning more than one result (a recent change it seems), and my code expects total_results to equal 1 when doing an email query. For some reason Close (even in the app) often returns extraneous results even when searching for a specific email (results with similar emails for example), but I believe that in the past when querying via the API with an email query it actually did formerly return just the 1 result.
Thanks so much for your help and your work on this! If you know of a way to query Close to get it to only return the results with exact matching email, that would be great to know. I suppose I could just limit to 1 result and assume the first one is the one that matches most closely.
Thanks again for your help.
from closeio.
@taylorbrooks @quantummachina @mgoren Thanks. I've pinged the team about this and we'll chime in soon.
from closeio.
I assume that at one point, this call returned results as expected?
client.list_leads(email: "[email protected]")
from closeio.
I just tested against my Close.io instance and it works as expected.
If you paste the email you're searching for into the Close.io app, do you get results? Maybe the email you're searching for was removed or the contact itself was removed.
from closeio.
Weird! Thanks so much for looking into that for me.
Yes, that call did work fine in the past, and it still works fine searching for that email within the Close.io app and using the sample python code provided by Close. Is there maybe an alternate syntax I can use with your gem to test finding a lead by email? Maybe client.get(...)?
Thanks!
from closeio.
What's the result of this?
client.list_leads('[email protected]')
from closeio.
I am tracking the same issue, it stopped working for us yesterday or so. Our code also was running fine before, and I just tested that solution @mgoren came with. Thank you. Even it is a workaround, it will help. Still looking for what changed back there.
from closeio.
Something must've changed on the API side then.
Any changes in the service that would have an effect here?
from closeio.
We are in the middle of migrating to some new infrastructure and it looks like it created this change in the search behavior. I will give another update shortly once we get to the bottom of this.
from closeio.
Upon further experimentation, I figured out a fix.
Originally I had been searching as follows:
client.list_leads(email: "[email protected]")
# worked in the past but now returns 0 results
When that stopped working, I changed to the code I mentioned above:
client.list_leads("email: [email protected]")
# returns multiple results, including extraneous ones
This successfully returned results, but included extraneous ones. To retrieve only exact matches I included quotes around the entire query but also around the email within the query:
client.list_leads('email: "[email protected]"')
# returns just the exact match
from closeio.
Following-up on this issue. We are in the middle of adding some more sophisticated email searching functionality by parsing addresses around the @
symbol. But this actually got inadvertently triggered in this particular case because the search terms are being single quoted instead of double quoted.
I believe all that needs to be done is change this line
Line 75 in 94e5232
to
query.map { |k,v| "#{k}:\"#{v}\"" }.join(' ')
so it uses double quotes.
Should probably also check if it is already wrapped in quotes just to be safe.
from closeio.
I believe this issue has been fixed, but in the event that it hasn't, please open a new issue.
from closeio.
Related Issues (20)
- updating custom fields for a lead HOT 2
- list_opportunities endpoint adds query param to filter queries HOT 1
- Seems like responses with code 400 aren't actually throwing errors when creating an opportunity HOT 2
- "You are setting a key that conflicts with a built-in method Hashie::Mash#object_id defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method." HOT 3
- Add multiple values for the same field
- Lead is returning hash instead of object HOT 7
- Paginate option returns result with symbolized keys HOT 2
- Wrong url for sent emails report HOT 1
- get request return plain html HOT 3
- List leads does not work properly HOT 1
- Update `email_account` resource to `connected_account` HOT 2
- Updating a contact's custom fields?
- Faraday warnings with gem closeio (~> 3.6) HOT 1
- Unable to List Contacts by attributes
- Advanced Filters API HOT 2
- Support Faraday 2.x HOT 3
- Faraday 2 upgrade is incompatible with Faraday 1.x HOT 7
- verifying webhook
- How to Pass Sorting Options?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from closeio.