@@ -68,9 +68,12 @@ user = intercom.users.find(user_id: "1")
6868user = intercom.users.find(id: " 1" )
6969# Create a user
7070user
= intercom.users.create(
email: " [email protected] " ,
name: " Bob Smith" ,
signed_up_at: Time .now.to_i)
71- # Delete a user
71+ # archive a user
72+ user = intercom.users.find(id: " 1" ) user = intercom.users.find(id: " 1" )
73+ deleted_user = intercom.users.delete(user) archived_user = intercom.users.archive(user)
74+ # request a hard delete for a user(https://developers.intercom.com/intercom-api-reference/reference#delete-users)
7275user = intercom.users.find(id: " 1" )
73- deleted_user = intercom.users.delete (user)
76+ deleted_user = intercom.users.request_hard_delete (user)
7477# Update custom_attributes for a user
7578user.custom_attributes[" average_monthly_spend" ] = 1234.56
7679intercom.users.save(user)
@@ -135,7 +138,7 @@ intercom.companies.all.map {|company| company.name }
135138# Get a list of users in a company by Intercom Company ID
136139intercom.companies.users_by_intercom_company_id(company.id)
137140# Get a list of users in a company by external company_id
138- intercom.companies.users_by_company_id(company.company_id)
141+ intercom.companies.users_by_company_id(company.company_id)
139142# Get a large list of companies using scroll
140143intercom.companies.scroll.each { |comp | puts comp.name}
141144# Please see users scroll for more details of how to use scroll
@@ -198,7 +201,7 @@ intercom.conversations.find_all(email: '
[email protected] ', type: 'user', unread:
198201intercom.conversations.find_all(
email: ' [email protected] ' ,
type: ' user' ,
unread: true ).each {|
convo | ... }
199202# Iterate over all conversations for a user with their Intercom user ID
200203intercom.conversations.find_all(intercom_user_id: ' 536e564f316c83104c000020' , type: ' user' ).each {|convo | ... }
201- # Iterate over all conversations for a lead
204+ # Iterate over all conversations for a lead
202205# NOTE: to iterate over a lead's conversations you MUST use their Intercom User ID and type User
203206intercom.conversations.find_all(intercom_user_id: lead.id, type: ' user' ).each {|convo | ... }
204207
@@ -228,7 +231,7 @@ intercom.conversations.open(id: conversation.id, admin_id: '123')
228231intercom.conversations.close(id: conversation.id, admin_id: ' 123' )
229232
230233# Assign
231- # Note: Conversations can be assigned to teams. However, the entity that performs the operation of assigning the conversation has to be an existing teammate.
234+ # Note: Conversations can be assigned to teams. However, the entity that performs the operation of assigning the conversation has to be an existing teammate.
232235# You can use `intercom.admins.all.each {|a| puts a.inspect if a.type == 'admin' }` to list all of your teammates.
233236intercom.conversations.assign(id: conversation.id, admin_id: ' 123' , assignee_id: ' 124' )
234237
@@ -417,8 +420,8 @@ contact = intercom.contacts.find(id: "536e564f316c83104c000020")
417420intercom.contacts.convert(contact, Intercom ::User .new (email: email))
418421# Using find with email will not work here. See https://github.com/intercom/intercom-ruby/issues/419 for more information
419422
420- # Delete a contact
421- intercom.contacts.delete (contact)
423+ # archive a contact
424+ intercom.contacts.archive (contact)
422425
423426# Get a large list of contacts using scroll
424427intercom.contacts.scroll.each { |lead | puts lead.id}
0 commit comments