Skip to content

Commit 17227f4

Browse files
committed
Merge pull request #126 from intercom/EF/created_since
Adding support for created_since on the users endpoint
2 parents 45a0515 + a889986 commit 17227f4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Resources this API supports:
7979
<?php
8080
// Get a list of users
8181
$intercom->getUsers();
82+
// Get a list of users created in the past 3 days
83+
$intercom->getUsers(array("created_since" => "3"));
8284
// Find user by email
8385
$intercom->getUser(array("email" => "[email protected]"));
8486
// Find user by user_id

src/Intercom/Service/config/intercom_public_user.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
"location": "query",
4545
"required": false,
4646
"type": "string"
47+
},
48+
"created_since": {
49+
"location": "query",
50+
"required": false,
51+
"type": "string"
4752
}
4853
},
4954
"responseClass": "UserListModel",

tests/Intercom/Resources/UserTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ public function testGetUsersBySegmentID()
142142
$this->assertRequest('GET', '/users?segment_id=20');
143143
}
144144

145+
public function testGetUsersByCreatedSince()
146+
{
147+
$this->setMockResponse($this->client, 'User/UserList.txt');
148+
$this->client->getUsers(['created_since' => '1', 'hello'=>'hi']);
149+
150+
$this->assertRequest('GET', '/users?created_since=1');
151+
}
152+
145153
public function testUpdateUserNoID()
146154
{
147155
$this->setMockResponse($this->client, 'User/User.txt');

0 commit comments

Comments
 (0)