Skip to main content
Question

I cannot update all my contacts' 'last_seen_at' field

  • December 11, 2022
  • 2 replies
  • 58 views

I am using the intercom-ruby gem to update all my contacts.

 

I retrieve all my contacts with :

contacts = intercom.contacts.all

Then I try to update all of them (only the last_seen_at field with the date of today) :

contacts.each do |contact|
contact.last_seen_at = date_of_today.to_time
intercom.contacts.save(contact)
end

The issue I have is that everytime it works for a few hundreds of contacts, but at one point it fails with some errors. The error in dev is :

ArgumentError: invalid byte sequence in UTF-8
Caused by:
JSON::ParserError: 859: unexpected token at 'HTTP/1.1 0 Unknown Reason-Phrase
Status: 0
Vary: Accept,Accept-Encoding

The error in prod is :

ETIMEDOUT error

 

The thing is that I have tens of thousands of contacts.

 

Many thanks for your help !

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

2 replies

Racheal
Intercom Team
Forum|alt.badge.img+5
  • Customer Support Engineer
  • 512 replies
  • December 15, 2022

Hey @elliot t​ Racheal from the support engineer team hereπŸ‘‹ 

 

I can see you're already working with my teammates on this issue. For future viewers it sounds like we are running into a timeout error here due to the request being too large.


  • Author
  • New Participant
  • 1 reply
  • December 15, 2022

Hey @racheal​ many thanks for the follow up, much appreciated.


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