Ruby bindings not working when searching contacts collection | Community
Skip to main content
Answered

Ruby bindings not working when searching contacts collection

  • July 24, 2025
  • 1 reply
  • 28 views

Hi,

We are using the ruby bindings from the official repo here and there are a few examples on how to search for contacts, for instance:

# Search for contacts by email
contacts = intercom.contacts.search(
  "query": {
    "field": 'email',
    "operator": '=',
    "value": 'some_contact@example.com'
  }
)
contacts.each {|c| p c.email}
# For full detail on possible queries, please refer to the API documentation:
# https://developers.intercom.com/intercom-api-reference/reference

When trying to access the resulting collection I always get a Resource Not Found (Intercom::ResourceNotFound) error. 

Doing this same search for the same contact with cURL or with the ruby net/http client works fine and returns the contact.

Is the search in the ruby gem broken?

Best answer by gusrub

Well, I finally figured it out, it seems that per the documentation the search contacts is only available in API version 2.x and newer:

Note that this is a new resource compatible only with the new Contacts API released in API v2.0.

 

So in order for it to work you have to set the client to explicitly use this version like so:

# With a versioned app:
intercom = Intercom::Client.new(token: 'my_token', api_version: '2.2')

Otherwise it seems the client will default to an older version where search is not supported.

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

1 reply

  • Author
  • New Participant
  • 1 reply
  • Answer
  • July 24, 2025

Well, I finally figured it out, it seems that per the documentation the search contacts is only available in API version 2.x and newer:

Note that this is a new resource compatible only with the new Contacts API released in API v2.0.

 

So in order for it to work you have to set the client to explicitly use this version like so:

# With a versioned app:
intercom = Intercom::Client.new(token: 'my_token', api_version: '2.2')

Otherwise it seems the client will default to an older version where search is not supported.


Reply