File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ intercom.contacts.unarchive(contact)
114114# Delete a contact permanently
115115intercom.contacts.delete(contact)
116116
117+ # Deletes an archived contact permanently
118+ contact.delete_archived_contact(" 124" )
119+
117120# List all contacts
118121contacts = intercom.contacts.all
119122contacts.each { |contact | p contact.name }
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ def unarchive(contact)
4343 contact
4444 end
4545
46+ def delete_archived_contact ( id )
47+ @client . delete ( "/#{ collection_name } /#{ id } " , { } )
48+ end
49+
4650 private def raise_invalid_merge_error
4751 raise Intercom ::InvalidMergeError , 'Merging can only be performed on a lead into a user'
4852 end
Original file line number Diff line number Diff line change 260260 client . contacts . unarchive ( contact )
261261 end
262262
263+ it 'deletes an archived contact' do
264+ contact = Intercom ::Contact . new ( 'id' => '1' , 'archived' => true )
265+ client . expects ( :delete ) . with ( '/contacts/1' , { } )
266+ client . contacts . delete_archived_contact ( "1" )
267+ end
268+
263269 describe 'merging' do
264270 let ( :lead ) { Intercom ::Contact . from_api ( external_id : 'contact_id' , role : 'lead' ) }
265271 let ( :user ) { Intercom ::Contact . from_api ( id : 'external_id' , role : 'user' ) }
You can’t perform that action at this time.
0 commit comments