File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,18 @@ $client->messages->create([
432
432
## Conversations
433
433
434
434
``` php
435
+ /**
436
+ * Create a conversation
437
+ * See more options here: https://developers.intercom.com/intercom-api-reference/reference#create-a-conversation
438
+ */
439
+ $client->conversations->create([
440
+ 'body' => 'Hello.',
441
+ 'from' => [
442
+ 'id' => '1234',
443
+ 'type' => 'user',
444
+ ],
445
+ ]);
446
+
435
447
/**
436
448
* List conversations for an admin
437
449
* See more options here: https://developers.intercom.io/reference#list-conversations
Original file line number Diff line number Diff line change 7
7
8
8
class IntercomConversations extends IntercomResource
9
9
{
10
+ /**
11
+ * Creates a Conversation.
12
+ *
13
+ * @see https://developers.intercom.com/intercom-api-reference/reference#create-a-conversation
14
+ * @param array $options
15
+ * @return stdClass
16
+ * @throws Exception
17
+ */
18
+ public function create (array $ options )
19
+ {
20
+ return $ this ->client ->post ('conversations ' , $ options );
21
+ }
22
+
10
23
/**
11
24
* Returns list of Conversations.
12
25
*
Original file line number Diff line number Diff line change 7
7
8
8
class IntercomConversationsTest extends TestCase
9
9
{
10
+ public function testConversationCreate ()
11
+ {
12
+ $ this ->client ->method ('post ' )->willReturn ('foo ' );
13
+
14
+ $ conversations = new IntercomConversations ($ this ->client );
15
+ $ this ->assertSame ('foo ' , $ conversations ->create ([]));
16
+ }
17
+
10
18
public function testConversationsList ()
11
19
{
12
20
$ this ->client ->method ('get ' )->willReturn ('foo ' );
You can’t perform that action at this time.
0 commit comments