File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,18 @@ $client->messages->create([
432432## Conversations
433433
434434``` 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+
435447/**
436448 * List conversations for an admin
437449 * See more options here: https://developers.intercom.io/reference#list-conversations
Original file line number Diff line number Diff line change 77
88class IntercomConversations extends IntercomResource
99{
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+
1023 /**
1124 * Returns list of Conversations.
1225 *
Original file line number Diff line number Diff line change 77
88class IntercomConversationsTest extends TestCase
99{
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+
1018 public function testConversationsList ()
1119 {
1220 $ this ->client ->method ('get ' )->willReturn ('foo ' );
You can’t perform that action at this time.
0 commit comments