Skip to content

Commit a0f2796

Browse files
committed
Merge pull request #103 from intercom/BL/contactpage
Fix contact pagination
2 parents 3d9361f + 36cac3e commit a0f2796

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changes
22
=========
3+
1.2.3
4+
5+
- Fixes Contacts iterator
6+
37
1.2.2
48

59
- Adding Contacts iterator

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In your composer.json file:
1717
```js
1818
{
1919
"require": {
20-
"intercom/intercom-php": "1.2.2"
20+
"intercom/intercom-php": "1.2.3"
2121
}
2222
}
2323
```
@@ -504,7 +504,6 @@ The metadata key values in the example are treated as follows-
504504
`Contacts` represent logged out users of your application.
505505

506506
```php
507-
<?
508507
//Create a new contact
509508
$response = $intercom->createContact(['email' => 'some_contact@example.com']);
510509

@@ -522,5 +521,10 @@ $response = $intercom->convertContact([
522521
"contact" => array("user_id" => 1),
523522
"user" => array("user_id" => 2)
524523
])
525-
>
524+
525+
//Iterate through Contacts with pagination:
526+
$iterator = $intercom->getIterator("getContacts");
527+
foreach ($iterator as $contact) {
528+
print_r($contact);
529+
}
526530
```

src/Intercom/IntercomAbstractClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class IntercomAbstractClient extends Client
1717
/** @var string */
1818
const DEFAULT_ACCEPT_HEADER = 'application/json';
1919

20-
const USER_AGENT = 'intercom-php/1.2.2';
20+
const USER_AGENT = 'intercom-php/1.2.3';
2121

2222

2323
/**

src/Intercom/IntercomBasicAuthClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function factory($config = [])
3030

3131
$client->setBasicAuth($config->get('app_id'), $config->get('api_key'));
3232

33-
$client->setUserAgent('intercom-php/1.2.2', true);
33+
$client->setUserAgent('intercom-php/1.2.3', true);
3434

3535
return $client;
3636
}

src/Intercom/IntercomClientTokenAuthClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static function factory($config = [])
3131

3232
$client->setBasicAuth($config->get('client_uuid'), $config->get('client_key'));
3333

34-
$client->setUserAgent('intercom-php/1.2.2', true);
34+
$client->setUserAgent('intercom-php/1.2.3', true);
3535

3636
$client->setDefaultOption('query/app_id', $config->get('app_id'));
3737

src/Intercom/Service/config/intercom_public_contact.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"uri": "/contacts?user_id={user_id}"
1818
},
1919
"getContacts": {
20+
"extends": "_abstract_pagination_page",
2021
"httpMethod": "GET",
2122
"parameters": {
2223
"email": {

0 commit comments

Comments
 (0)