File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
src/Intercom/Service/config Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,11 @@ $updated = $intercom->updateContact([
513513 'custom_attributes' => ['foo' => 'bar']
514514]);
515515
516+ //Delete a contact
517+ $deleted = $intercom->deleteContact([
518+ "id" => "530370b477ad7120001d"
519+ ]);
520+
516521//Get all contacts by email
517522$search = $intercom->getContacts(['email' => '
[email protected] ']);
518523
Original file line number Diff line number Diff line change 186186 "responseType" : " model" ,
187187 "summary" : " Creates the contact" ,
188188 "uri" : " /contacts"
189+ },
190+ "deleteContact" : {
191+ "httpMethod" : " DELETE" ,
192+ "parameters" : {
193+ "id" : {
194+ "location" : " json" ,
195+ "required" : false ,
196+ "type" : " string"
197+ },
198+ "user_id" : {
199+ "location" : " json" ,
200+ "required" : false ,
201+ "type" : " string"
202+ }
203+ },
204+ "responseClass" : " ContactModel" ,
205+ "responseType" : " model" ,
206+ "summary" : " Deletes a contact given id or user_id" ,
207+ "uri" : " /contacts"
189208 }
190209 },
191210 "models" : {
Original file line number Diff line number Diff line change @@ -44,6 +44,15 @@ public function testCreateContact()
4444 $ this ->assertEquals ("Silver Dove " , $ response ['pseudonym ' ]);
4545 }
4646
47+ public function testDeleteContact ()
48+ {
49+ $ this ->setMockResponse ($ this ->client , 'Contact/Contact.txt ' );
50+ $ response = $ this ->client ->deleteContact (['id ' => '1234 ' ]);
51+
52+ $ this ->assertRequest ('DELETE ' , '/contacts ' );
53+ $ this ->assertRequestJson (['id ' => '1234 ' ]);
54+ }
55+
4756 public function testConvertContact ()
4857 {
4958 $ this ->setMockResponse ($ this ->client , 'Contact/Contact.txt ' );
You can’t perform that action at this time.
0 commit comments