Skip to main content
Answered

Is `source.url` in conversations searchable with non-trivial string operators?


  • New Participant
  • 1 reply

I am trying to search `source.url` using the contains ("~") or starts with ("^") operators to filter to a specific domain, and am getting no results. When I search using equals ("="), results are returned but that isn't viable as the URLs may change. For example:

curl -X POST \
--data '{ "query": { "field": "source.url", "operator": "~", "value": "test.com" }}' \
-H 'Authorization: Bearer XXXX' \
-H 'Accept: application/json' \
-H 'Intercom-Version: 2.3' \
-H 'Content-Type: application/json' \
'https://api.intercom.io/conversations/search#39;
 
{"type":"conversation.list","pages":{"type":"pages","page":1,"per_page":150,"total_pages":0},"total_count":0,"conversations":[]}
 
curl -X POST \
--data '{ "query": { "field": "source.url", "operator": "^", "value": "https://www.test.comquot; }}' \
-H 'Authorization: Bearer XXXX' \
-H 'Accept: application/json' \
-H 'Intercom-Version: 2.3' \
-H 'Content-Type: application/json' \
'https://api.intercom.io/conversations/search#39;
 
{"type":"conversation.list","pages":{"type":"pages","page":1,"per_page":150,"total_pages":0},"total_count":0,"conversations":[]}
 
curl -X POST \
--data '{ "query": { "field": "source.url", "operator": "=", "value": "https://www.test.com/specific/urlquot; }}' \
-H 'Authorization: Bearer XXXX' \
-H 'Accept: application/json' \
-H 'Intercom-Version: 2.3' \
-H 'Content-Type: application/json' \
'https://api.intercom.io/conversations/search#39;
 
{"type":"conversation.list","pages":{"type":"pages","page":1,"per_page":150,"total_pages":1},"total_count":1,"conversations": ... }}

The above examples have been made generic and API tokens removed, however the results are from when I run them using our own data. As an addendum, string searches using other fields, like "source.author.name", "~", "Vince", do return results.

 

Is there a way to search using my original query, or should I download all conversations and filter after the fact?

 

Thanks in advance!

Best answer by Eric Fitz

Hey @vince​, I checked in with our support engineers, and they've advised me that the best way to achieve what you're looking to do is to download all conversations and filter after the fact, as you suggested.

View original
Did this topic help you find an answer to your question?

4 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • July 20, 2021

Hey @roy s11​, you're someone who knows a lot about our API, do you reckon you'd be able to help @vince​ here?


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • Answer
  • July 22, 2021

Hey @vince​, I checked in with our support engineers, and they've advised me that the best way to achieve what you're looking to do is to download all conversations and filter after the fact, as you suggested.


  • Author
  • New Participant
  • 1 reply
  • July 22, 2021

Thanks! I appreciate you taking the time.


  • New Participant
  • 1 reply
  • September 30, 2022

I have the same problem, as the docs say, filtering using ~ or ^ is possible because source.url is a string but no results are retrieved, please fix this.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings