Skip to content

Commit fff4ee3

Browse files
remove /V1 from base url & added as part of api url
1 parent da6cd0c commit fff4ee3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Src/Notion.Client/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
internal class Constants
44
{
5-
internal static string BASE_URL = "https://api.notion.com/v1/";
5+
internal static string BASE_URL = "https://api.notion.com/";
66
internal static string DEFAULT_NOTION_VERSION = "2021-05-13";
77
}
88
}

Src/Notion.Client/DatabasesClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task<Database> RetrieveAsync(string databaseId)
2424
{
2525
try
2626
{
27-
return await _client.GetAsync<Database>($"databases/{databaseId}");
27+
return await _client.GetAsync<Database>($"/v1/databases/{databaseId}");
2828
}
2929
catch (Exception e)
3030
{
@@ -44,7 +44,7 @@ public async Task<PaginatedList<Database>> ListAsync(DatabasesListParameters dat
4444
{ "page_size", databasesListQueryParmaters?.PageSize }
4545
};
4646

47-
return await _client.GetAsync<PaginatedList<Database>>("databases", queryParams);
47+
return await _client.GetAsync<PaginatedList<Database>>("/v1/databases", queryParams);
4848
}
4949
catch (Exception e)
5050
{
@@ -58,7 +58,7 @@ public async Task<PaginatedList<Page>> QueryAsync(string databaseId, DatabasesQu
5858
try
5959
{
6060
var body = (IDatabaseQueryBodyParameters)databasesQueryParameters;
61-
return await _client.PostAsync<PaginatedList<Page>>($"databases/{databaseId}/query", body);
61+
return await _client.PostAsync<PaginatedList<Page>>($"/v1/databases/{databaseId}/query", body);
6262
}
6363
catch (Exception e)
6464
{

Src/Notion.Client/UsersClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task<User> RetrieveAsync(string userId)
2222
{
2323
try
2424
{
25-
return await _client.GetAsync<User>($"users/{userId}");
25+
return await _client.GetAsync<User>($"/v1/users/{userId}");
2626
}
2727
catch (Exception e)
2828
{
@@ -34,7 +34,7 @@ public async Task<PaginatedList<User>> ListAsync()
3434
{
3535
try
3636
{
37-
return await _client.GetAsync<PaginatedList<User>>("users");
37+
return await _client.GetAsync<PaginatedList<User>>("/v1/users");
3838
}
3939
catch (Exception e)
4040
{

0 commit comments

Comments
 (0)