API3
adam_a at December 20th, 2018 10:15 — #1
Hello,
I have to filter contacts by phone number but sometimes the API will not return the expected answer. For ex. I have a contact named John Doe with phone number (0123) 456-789 (saved like that in your database) and from API I have just phone number in 0123456789 format which will return empty array. How can I make a filter to escape the characters from your database ?
kevin at January 3rd, 2019 12:35 — #2
Hi @adam_a
I presuming you are querying like https://app.onepagecrm.com/api/v3/contacts.json?phone=0123
where 0123 is some substring that you want to filter contacts by?
We currently only search against what is stored in the DB. So what you suggest isn't currently possible.
I have created an issue on our backlog to look into allowing the querying by phone number to ignore non-number characters. I can't guarantee if/when this will be done tho. I will get back to you here when I have an update.
In the mean time one possible solution is implementing a convention on your side to store all contact phone numbers in a given format.
Regards,
Kevin
Powered by Discourse, best viewed with JavaScript enabled