Skip to content

Commit 718363d

Browse files
add api to retrieve a user
1 parent d48be10 commit 718363d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Src/Notion.Client/UsersClient.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace Notion.Client
55
{
66
public interface IUsersClient
77
{
8+
Task<User> RetrieveAsync(string userId);
89
Task<PaginatedList<User>> ListAsync();
910
}
1011

@@ -17,6 +18,18 @@ public UsersClient(IRestClient client)
1718
_client = client;
1819
}
1920

21+
public async Task<User> RetrieveAsync(string userId)
22+
{
23+
try
24+
{
25+
return await _client.GetAsync<User>($"users/{userId}");
26+
}
27+
catch (Exception e)
28+
{
29+
return null;
30+
}
31+
}
32+
2033
public async Task<PaginatedList<User>> ListAsync()
2134
{
2235
try

0 commit comments

Comments
 (0)