Skip to content

Commit f0b2350

Browse files
authored
Merge pull request #163 from anaspk/anas/view-single-user
Get details of a single user
2 parents 8689ad2 + 09d1de5 commit f0b2350

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ $client->users->create([
5858
// Delete a user by ID
5959
$client->users->deleteUser("570680a8a1bcbca8a90001b9");
6060

61+
// Get a user by ID
62+
$client->users->getUser("570680a8a1bcbca8a90001b9");
63+
6164
// Add companies to a user
6265
$client->users->create([
6366
"email" => "[email protected]",

src/IntercomUsers.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ public function getUsers($options)
3939
{
4040
return $this->client->get("users", $options);
4141
}
42-
42+
43+
public function getUser($id, $options = [])
44+
{
45+
$path = $this->userPath($id);
46+
return $this->client->get($path, $options);
47+
}
48+
4349
public function deleteUser($id, $options = [])
4450
{
4551
$path = $this->userPath($id);
4652
return $this->client->delete($path, $options);
4753
}
48-
54+
4955
public function userPath($id)
5056
{
5157
return "users/" . $id;

0 commit comments

Comments
 (0)