Noko.Net
1.0.0
dotnet add package Noko.Net --version 1.0.0
NuGet\Install-Package Noko.Net -Version 1.0.0
<PackageReference Include="Noko.Net" Version="1.0.0" />
<PackageVersion Include="Noko.Net" Version="1.0.0" />
<PackageReference Include="Noko.Net" />
paket add Noko.Net --version 1.0.0
#r "nuget: Noko.Net, 1.0.0"
#:package Noko.Net@1.0.0
#addin nuget:?package=Noko.Net&version=1.0.0
#tool nuget:?package=Noko.Net&version=1.0.0
Noko.Net
A .NET client library for the Noko time-tracking API (v2).
Installation
dotnet add package Noko.Net
Quick start
using NokoAPI;
// Create a client with your personal access token
var client = new NokoClient(
new UserAgent("MyApp", "1.0"),
"your-personal-access-token");
// Create a time entry
var entry = await client.Entries.CreateAsync(new CreateEntryRequest
{
Date = DateOnly.FromDateTime(DateTime.Today),
Minutes = 60,
ProjectId = 123,
Description = "Implemented feature #45"
});
// List recent entries with filters
var entries = await client.Entries.GetAsync(new GetEntriesRequest
{
FromDate = DateOnly.FromDateTime(DateTime.Today.AddDays(-7)),
Billable = true
});
// Paginate through all results
var page = await client.Tags.GetAsync(new GetTagsRequest());
while (true)
{
foreach (var tag in page)
Console.WriteLine($"{tag.Id}: {tag.Name}");
var next = await client.GetNextPageAsync(page);
if (next == null) break;
page = next;
}
Authentication
Noko uses personal access tokens for authentication. Generate one from your Noko account and pass it when creating the client.
// Simple constructor
var client = new NokoClient(new UserAgent("MyApp", "1.0"), "your-token");
// Or via config for more control
var config = NokoClientConfig.BuildDefault(new UserAgent("MyApp", "1.0"))
.WithPersonalAccessToken("your-token")
.WithTimeout(TimeSpan.FromSeconds(30));
var client = new NokoClient(config);
Configuration
NokoClientConfig provides fluent setters for customizing client behavior:
var config = NokoClientConfig.BuildDefault(new UserAgent("MyApp", "1.0"), "your-token")
.WithTimeout(TimeSpan.FromSeconds(30)) // Custom request timeout
.WithHttpMessageHandler(myPollyHandler) // Polly, logging, or mock handler
.WithBaseAddress(new Uri("https://custom.url/")) // Custom API base URL
.WithJsonSerializerOptions(myOptions); // Custom JSON serialization
IHttpClientFactory integration
For production services using dependency injection, you can supply your own HttpClient:
// In Startup / Program.cs
services.AddHttpClient("Noko", client =>
{
client.BaseAddress = new Uri("https://api.nokotime.com/v2/");
client.DefaultRequestHeaders.Add("X-NokoToken", token);
client.DefaultRequestHeaders.UserAgent.Add(
new UserAgent("MyApp", "1.0").CreateHeader());
});
// In your service
var httpClient = httpClientFactory.CreateClient("Noko");
var config = NokoClientConfig.BuildDefault(new UserAgent("MyApp", "1.0"))
.WithHttpClient(httpClient);
var client = new NokoClient(config);
The library never disposes a caller-supplied HttpClient.
Pagination
List endpoints return Paginated<T>, which wraps List<T> and exposes First, Next, Previous, and Last link properties. Use the helper methods on INokoClient to navigate:
var page = await client.Entries.GetAsync(new GetEntriesRequest());
var next = await client.GetNextPageAsync(page); // null if no next page
var prev = await client.GetPreviousPageAsync(page); // null if no previous page
var first = await client.GetFirstPageAsync(page);
var last = await client.GetLastPageAsync(page);
Error handling
The library throws typed exceptions for HTTP errors:
| Exception | HTTP Status |
|---|---|
APIBadRequestException |
400 |
APIForbiddenException |
403 |
APINotFoundException |
404 |
APITooManyRequestsException |
429 |
APIServiceUnavailableException |
503 |
APITooManyRequestsException includes a RetryAfter property with the server-suggested wait duration.
Available resources
| Resource | Property | Operations |
|---|---|---|
| Entries | client.Entries |
Get, Create, Edit, Delete, Approve, Unapprove, Mark Invoiced |
| Projects | client.Projects |
Get, Create, Edit, Delete, Archive, Unarchive, Merge |
| Tags | client.Tags |
Get, Create, Edit, Delete, Merge |
| Users | client.Users |
Get, Create, Edit, Delete, Activate, Deactivate, Project Access |
| Current User | client.CurrentUser |
Get, Edit |
| Teams | client.Teams |
Get, Create, Edit, Delete, Manage Users |
| Timers | client.Timers |
Get, Create, Edit, Delete, Start, Pause, Log |
| Invoices | client.Invoices |
Get, Create, Edit, Delete, Mark Paid/Unpaid, Manage Entries/Expenses |
| Expenses | client.Expenses |
Get, Create, Edit, Delete |
| Inbox Entries | client.InboxEntries |
Get, Log, Discard |
| Project Groups | client.ProjectGroups |
Get, Create, Edit, Delete, Manage Projects |
| Webhooks | client.Webhooks |
Get, Create, Edit, Delete, Enable, Disable, Manage Events |
| Broadcast Receivers | client.BroadcastReceivers |
Get, Create, Edit, Delete, Enable, Disable, Manage Subjects |
| Account | client.Account |
Get |
Links
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CommunityToolkit.Diagnostics (>= 8.4.0)
- Flurl (>= 4.0.0)
-
net8.0
- CommunityToolkit.Diagnostics (>= 8.4.0)
- Flurl (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 100 | 4/10/2026 |