Skip to content

Commit 9eb9dec

Browse files
authored
Merge branch 'intercom:master' into delete-company
2 parents 285c111 + 6ba3318 commit 9eb9dec

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# intercom-php
22

3-
[![Code Climate](https://codeclimate.com/repos/537da4a7e30ba062b101be9c/badges/2aa25d4736f09f40282e/gpa.svg)](https://codeclimate.com/repos/537da4a7e30ba062b101be9c/feed) [![Circle CI](https://circleci.com/gh/intercom/intercom-php.png?style=badge)](https://circleci.com/gh/intercom/intercom-php)
3+
[![Circle CI](https://circleci.com/gh/intercom/intercom-php.png?style=shield)](https://circleci.com/gh/intercom/intercom-php)
4+
[![packagist](https://img.shields.io/packagist/v/intercom/intercom-php.svg)](https://packagist.org/packages/intercom/intercom-php)
5+
![Intercom API Version](https://img.shields.io/badge/Intercom%20API%20Version-1.3-blue)
46

5-
Official PHP bindings to the Intercom API
7+
> Official PHP bindings to the [Intercom API](https://api.intercom.io/docs)
8+
9+
## Project Updates
10+
11+
### Maintenance
12+
13+
We're currently building a new team to provide in-depth and dedicated SDK support.
14+
15+
In the meantime, we'll be operating on limited capacity, meaning all pull requests will be evaluated on a best effort basis and will be limited to critical issues.
16+
17+
We'll communicate all relevant updates as we build this new team and support strategy in the coming months.
618

719
## Installation
820

@@ -435,6 +447,18 @@ $client->messages->create([
435447
## Conversations
436448

437449
```php
450+
/**
451+
* Create a conversation
452+
* See more options here: https://developers.intercom.com/intercom-api-reference/reference#create-a-conversation
453+
*/
454+
$client->conversations->create([
455+
'body' => 'Hello.',
456+
'from' => [
457+
'id' => '1234',
458+
'type' => 'user',
459+
],
460+
]);
461+
438462
/**
439463
* List conversations for an admin
440464
* See more options here: https://developers.intercom.io/reference#list-conversations

src/IntercomConversations.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77

88
class 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
*

tests/IntercomConversationsTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
class 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');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy