Skip to content

Commit 10b026d

Browse files
committed
Merge pull request #109 from intercom/RuairiK/add_attachment_suppport_PHP
Add support for attachments
2 parents e65ef68 + bb6fd8c commit 10b026d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Intercom/Service/config/intercom_public_conversation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@
193193
"location": "json",
194194
"required": true,
195195
"type": "string"
196+
},
197+
"attachment_urls": {
198+
"location": "json",
199+
"required": false,
200+
"type": "array"
196201
}
197202
},
198203
"responseClass": "ConversationModel",

tests/Intercom/Resources/ConversationTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ public function testReplyToConversation()
104104
$this->assertRequestJson(['user_id' => '45', 'type' => 'user', 'body' => 'my reply', 'message_type' => 'comment']);
105105
}
106106

107+
public function testReplyToConversationWithAttachment()
108+
{
109+
$this->setMockResponse($this->client, 'Conversation/Conversation.txt');
110+
$this->client->replyToConversation(['id' => '123456', 'user_id' => '45', 'type' => 'user', 'message_type' => 'comment', 'body' => 'my reply', 'attachment_urls' => ['http://www.example.com/attachment.png']]);
111+
112+
$this->assertRequest('POST', '/conversations/123456/reply');
113+
$this->assertRequestJson(['user_id' => '45', 'type' => 'user', 'body' => 'my reply', 'message_type' => 'comment', 'attachment_urls' => ['http://www.example.com/attachment.png']]);
114+
}
115+
107116
public function testReplyToConversationAsAdmin() {
108117
$this->setMockResponse($this->client, 'Conversation/Conversation.txt');
109118
$this->client->replyToConversation(['id' => '123456', 'admin_id' => '6', 'type' => 'admin', 'message_type' => 'comment', 'body' => 'my reply']);

0 commit comments

Comments
 (0)