TickTickSharp 1.1.0

dotnet add package TickTickSharp --version 1.1.0
                    
NuGet\Install-Package TickTickSharp -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TickTickSharp" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TickTickSharp" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="TickTickSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TickTickSharp --version 1.1.0
                    
#r "nuget: TickTickSharp, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TickTickSharp@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TickTickSharp&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=TickTickSharp&version=1.1.0
                    
Install as a Cake Tool

TickTickSharp

NuGet Version NuGet Downloads License: MIT

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, and Trigger 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.

  1. Create a TickTick Application

  2. 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
  3. 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:

  1. Set up your TickTick access token:

    dotnet user-secrets set "TickTick:AccessToken" "your-token" --project src/TickTickSharp.Tests
    
  2. 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

  1. Clone the repository
  2. Install .NET 8 SDK
  3. Set up your TickTick access token for testing
  4. Run dotnet build to build the solution
  5. Run dotnet test to execute tests

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 191 7/19/2025
1.0.0 189 7/19/2025