TickTickSharp 1.1.0
dotnet add package TickTickSharp --version 1.1.0
NuGet\Install-Package TickTickSharp -Version 1.1.0
<PackageReference Include="TickTickSharp" Version="1.1.0" />
<PackageVersion Include="TickTickSharp" Version="1.1.0" />
<PackageReference Include="TickTickSharp" />
paket add TickTickSharp --version 1.1.0
#r "nuget: TickTickSharp, 1.1.0"
#:package TickTickSharp@1.1.0
#addin nuget:?package=TickTickSharp&version=1.1.0
#tool nuget:?package=TickTickSharp&version=1.1.0
TickTickSharp
A modern, strongly-typed .NET client library for the TickTick Open API. Built with .NET 8 and designed for productivity applications that need to integrate with TickTick's task management platform.
โจ Features
- ๐ Strongly Typed - Work with
TimeZoneInfo
,RecurrencePattern
, andTrigger
objects instead of raw strings - ๐ Recurrence Support - Full support for daily, weekly, monthly, and yearly recurring tasks using industry-standard RRULE format
- โฐ Smart Reminders - Easy creation of reminders with natural time expressions (15 minutes before, 1 day before, etc.)
- ๐ Timezone Aware - Built-in support for
TimeZoneInfo
with automatic conversion to TickTick's format - ๐ Complete CRUD - Full support for tasks, projects, and subtasks
- ๐ฏ Clean Architecture - Internal DTO/Mapper pattern keeps the public API clean while handling TickTick's JSON format
- โก Async/Await - Modern async patterns throughout
- ๐งช Well Tested - Comprehensive integration tests
๐ Quick Start
Installation
dotnet add package TickTickSharp
Authentication Setup
Note: This library does not handle OAuth authentication flows. You need to implement the OAuth flow yourself to obtain an access token.
Create a TickTick Application
- Go to the TickTick Developer Console
- Create a new application
- Note your
client_id
andclient_secret
Implement OAuth Flow
- Implement the OAuth 2.0 authorization code flow
- Redirect users to:
https://ticktick.com/oauth/authorize?client_id=YOUR_CLIENT_ID&scope=tasks:write&response_type=code&redirect_uri=YOUR_REDIRECT_URI
- Exchange the authorization code for an access token using your
client_secret
- See TickTick OAuth Documentation for detailed steps
Initialize the Client Once you have an access token, initialize the client:
using TickTickSharp.Client;
var client = new TickTickClient("your-access-token");
Important: Access tokens expire and need to be refreshed. Implement token refresh logic in your application as this library only handles API calls with valid tokens.
Basic Usage
// Create a simple task
var task = new TickTickSharp.Models.Task
{
Title = "Review quarterly reports",
Content = "Go through Q3 financial reports and sales data",
ProjectId = "project-id",
DueDate = DateTime.Now.AddDays(3),
TimeZone = TimeZoneInfo.Local,
Priority = 2
};
var createdTask = await client.CreateTaskAsync(task);
๐ Examples
Working with Projects
// Get all projects
var projects = await client.GetProjectsAsync();
// Create a new project
var project = new Project
{
Name = "Marketing Campaign",
Color = "#FF5722",
ViewMode = "list",
Kind = "TASK"
};
var newProject = await client.CreateProjectAsync(project);
Recurring Tasks
Create recurring tasks using strongly-typed recurrence patterns:
using Ical.Net.DataTypes;
// Daily standup meeting
var dailyTask = new TickTickSharp.Models.Task
{
Title = "Daily Standup",
ProjectId = projectId,
StartDate = DateTime.Today.AddHours(9), // 9 AM
DueDate = DateTime.Today.AddHours(9.5), // 9:30 AM
Recurrence = new RecurrencePattern(FrequencyType.Daily, 1),
TimeZone = TimeZoneInfo.Local
};
// Weekly team meeting (every Monday and Friday)
var weeklyTask = new TickTickSharp.Models.Task
{
Title = "Team Sync",
ProjectId = projectId,
Recurrence = new RecurrencePattern(FrequencyType.Weekly, 1)
{
ByDay = new List<WeekDay>
{
new WeekDay(DayOfWeek.Monday),
new WeekDay(DayOfWeek.Friday)
}
},
TimeZone = TimeZoneInfo.Local
};
// Monthly report (15th of every month)
var monthlyTask = new TickTickSharp.Models.Task
{
Title = "Monthly Report",
ProjectId = projectId,
Recurrence = new RecurrencePattern(FrequencyType.Monthly, 1)
{
ByMonthDay = new List<int> { 15 }
},
TimeZone = TimeZoneInfo.Local
};
Smart Reminders
Add reminders using natural time expressions:
using Ical.Net.DataTypes;
var taskWithReminders = new TickTickSharp.Models.Task
{
Title = "Important Meeting",
ProjectId = projectId,
DueDate = DateTime.Now.AddDays(1).Date.AddHours(14), // Tomorrow at 2 PM
Reminders = new List<Trigger>
{
new Trigger(new Duration(seconds: 0)), // At due time
new Trigger(new Duration(minutes: -15)), // 15 minutes before
new Trigger(new Duration(hours: -2)), // 2 hours before
new Trigger(new Duration(days: -1)) // 1 day before
},
TimeZone = TimeZoneInfo.Local
};
Tasks with Subtasks
var taskWithSubtasks = new TickTickSharp.Models.Task
{
Title = "Website Redesign",
Content = "Complete overhaul of company website",
ProjectId = projectId,
Items = new List<ChecklistItem>
{
new ChecklistItem { Title = "Design mockups", Status = 0, SortOrder = 1 },
new ChecklistItem { Title = "Frontend development", Status = 0, SortOrder = 2 },
new ChecklistItem { Title = "Content migration", Status = 0, SortOrder = 3 },
new ChecklistItem { Title = "Testing & QA", Status = 0, SortOrder = 4 }
}
};
Task Operations
// Get a specific task
var task = await client.GetTaskAsync(projectId, taskId);
// Update a task
task.Title = "Updated title";
task.Priority = 3;
var updatedTask = await client.UpdateTaskAsync(taskId, task);
// Complete a task
await client.CompleteTaskAsync(projectId, taskId);
// Delete a task
await client.DeleteTaskAsync(projectId, taskId);
๐๏ธ Architecture
TickTickSharp uses a clean architecture with DTOs and mappers to provide a strongly-typed API while maintaining compatibility with TickTick's JSON format:
User Code (Strongly Typed Models)
โ Mappers
Internal DTOs (JSON Serialization)
โ HTTP Client
TickTick API
Key Components
- Public Models - Clean, strongly-typed classes (
Task
,Project
,ChecklistItem
) - Internal DTOs - JSON serialization models with proper API format
- Mappers - Handle conversion between public models and DTOs
- Client - HTTP communication layer with proper error handling
๐ง Configuration
Custom HttpClient
var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(30);
var client = new TickTickClient("your-access-token", httpClient);
Error Handling
try
{
var task = await client.CreateTaskAsync(newTask);
}
catch (HttpRequestException ex)
{
// Handle API errors
Console.WriteLine($"API Error: {ex.Message}");
}
๐งช Testing
The library includes comprehensive integration tests. To run them:
Set up your TickTick access token:
dotnet user-secrets set "TickTick:AccessToken" "your-token" --project src/TickTickSharp.Tests
Run the tests:
dotnet test src/TickTickSharp.Tests
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
- Clone the repository
- Install .NET 8 SDK
- Set up your TickTick access token for testing
- Run
dotnet build
to build the solution - Run
dotnet test
to execute tests
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
โ ๏ธ Disclaimer
This is an unofficial library and is not affiliated with, endorsed by, or connected to TickTick or Appest Inc. TickTick is a trademark of Appest Inc.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Ical.Net (>= 5.1.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- System.Text.Json (>= 8.0.6)
-
net8.0
- Ical.Net (>= 5.1.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- System.Text.Json (>= 8.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.