Skip to content

Commit 09fc0ce

Browse files
authored
Merge pull request #141 from klimesf/readme-fix
Improved README
2 parents a114c87 + 9c602c6 commit 09fc0ce

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@ Requires PHP 5.6.
1111

1212
Using Composer:
1313

14-
```json
15-
{
16-
"require": {
17-
"intercom/intercom-php": "2.0.0"
18-
}
19-
}
14+
The recommended way to install intercom-php is through [Composer](https://getcomposer.org):
15+
16+
First, install Composer:
17+
18+
```
19+
$ curl -sS https://getcomposer.org/installer | php
2020
```
2121

22+
Next, install the latest intercom-php:
23+
24+
```
25+
$ php composer.phar require intercom/intercom-php
26+
```
27+
28+
Finally, you can include the files in your PHP script:
29+
30+
```php
31+
require "vendor/autoload.php";
32+
```
2233

2334
## Clients
2435

@@ -33,12 +44,12 @@ $client = new IntercomClient(appId, apiKey);
3344
```php
3445
// Create/update a user
3546
$client->users->create([
36-
'email' => '[email protected]'
47+
"email" => "[email protected]"
3748
]);
3849

3950
// Add companies to a user
4051
$client->users->create([
41-
'email' => '[email protected]',
52+
"email" => "[email protected]",
4253
"companies" => [
4354
[
4455
"id" => "3"
@@ -47,7 +58,7 @@ $client->users->create([
4758
]);
4859

4960
// Find user by email
50-
$client->users->getUsers(['email' => '[email protected]']);
61+
$client->users->getUsers(["email" => "[email protected]"]);
5162
```
5263

5364
## Leads
@@ -236,5 +247,5 @@ When listing, the Intercom API may return a pagination object:
236247
You can grab the next page of results using the client:
237248

238249
```php
239-
$client->nextPage(response['pages']);
250+
$client->nextPage($response["pages"]);
240251
```

0 commit comments

Comments
 (0)