Skip to content

Commit c9f84d8

Browse files
author
Kevin Antoine
authored
Merge pull request #216 from intercom/AK/add-options-to-conversations
add options to getConversations
2 parents cc02174 + 1d55af5 commit c9f84d8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ $client->companies->update([
220220

221221
// Creating or Update a company with custom attributes.
222222
$client->companies->update([
223-
"name" => "foocorp",
223+
"name" => "foocorp",
224224
"id" => "3",
225225
"custom_attributes" => [
226226
"foo" => "bar",
@@ -271,6 +271,11 @@ $client->conversations->getConversations([
271271

272272
// Get a single conversation
273273
$client->conversations->getConversation("1234")
274+
// Get a single conversation with plaintext comments
275+
$client->conversations->getConversation("1234", [
276+
"display_as" => "plaintext"
277+
])
278+
274279

275280
// Reply to a conversation
276281
// See more options here: https://developers.intercom.io/reference#replying-to-a-conversation

src/IntercomConversations.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public function getConversations($options)
3636
* @return mixed
3737
* @throws \GuzzleHttp\Exception\GuzzleException
3838
*/
39-
public function getConversation($id)
39+
public function getConversation($id, $options = [])
4040
{
4141
$path = $this->conversationPath($id);
42-
return $this->client->get($path, []);
42+
return $this->client->get($path, $options);
4343
}
4444

4545
/**
@@ -55,7 +55,7 @@ public function replyToConversation($id, $options)
5555
$path = $this->conversationReplyPath($id);
5656
return $this->client->post($path, $options);
5757
}
58-
58+
5959
/**
6060
* Creates Conversation Reply to last conversation. (no need to specify Conversation ID.)
6161
* @see https://developers.intercom.io/reference#replying-to-users-last-conversation
@@ -68,7 +68,7 @@ public function replyToLastConversation($options)
6868
$path = 'conversations/last/reply';
6969
return $this->client->post($path, $options);
7070
}
71-
71+
7272
/**
7373
* Marks a Conversation as read based on the given Conversation ID.
7474
* @see https://developers.intercom.io/reference#marking-a-conversation-as-read
@@ -82,7 +82,7 @@ public function markConversationAsRead($id)
8282
$data = ['read' => true];
8383
return $this->client->put($path, $data);
8484
}
85-
85+
8686
/**
8787
* Returns endpoint path to Conversation with given ID.
8888
* @param string $id

0 commit comments

Comments
 (0)