Each Task in Todo.ly is represented by an Item in the system. Items can be in hierarchy containing other items. User can decide to collapse the children items and don’t see it. This is persisted in the database as ‘Collapsed’ field for each item. Each task can have a Due Date, and a Priority.
Items API Methods
The following code snippet contains the C# representation of the class.
public class ItemObject
public long Id;
public string Content;
public int ItemType;
public bool? Checked;
public long? ProjectId;
public long? ParentId;
public string Path;
public bool? Collapsed;
public string DateString;
public int DateStringPriority;
public string DueDate;
public RecurrenceObject Recurrence;
public int? ItemOrder;
public int? Priority;
public string LastSyncedDateTime;
public List<ItemObject> Children = new List<ItemObject>();
public string CreatedDate;
public string LastCheckedDate;
public string LastUpdatedDate;
public bool? Deleted;
The most important field is the Content field that holds the task itself what to do. Like “Call Mike”.
There are several fields created only for the API to help displaying the items quickly in any 3rd party application.
ItemType represents what’s the exact type/state of this field when displaying it.
public enum ItemType
CheckItem = 1,
Path field helps to create a Hierarchy of the fields. It holds the Ids of all the parent back to the root separated by space. A root item has empty Path.
The ‘Item with Id 1055’ has an empty Path.
The ‘Item with Id 1056’ has a Path ‘ 1055’
The ‘Item with Id 1057’ has a Path ‘ 1055 1056’
DateString and DateStringPriority
These fields help to display the unified short Due date label for an Item, and helps to determine the color of the Due date label.
The value means:
- 0 Normal
- 1 Overdue
- 2 Today
This object is currently not used on the Todo.ly interface. However it can store Recurrence information of the Task. You are welcome to use it.
The class diagram of the RecurrenceObject:
public class RecurrenceObject
public int RepeatType = 0; //Daily, Weekly, Monthly, Yearly recurrence
public int SelectDays = 0; //If Daily, on every x days
public int SelectWeeks = 0; //If Weekly on every x weeks
public bool Weekday0 = false; //If Weekly on every Sunday
public bool Weekday1 = false; //If Weekly on every Monday
public bool Weekday2 = false; //If Weekly on every Tuesday
public bool Weekday3 = false; //If Weekly on every Wednesday
public bool Weekday4 = false; //If Weekly on every Thursday
public bool Weekday5 = false; //If Weekly on every Friday
public bool Weekday6 = false; //If Weekly on every Saturday
public int SelectMonths = 0; //If Monthly, in every x Months
public bool MonthByMonthDay = false; //If Monthly on every 2nd Monday, or last Friday, etc.
public bool MonthByDay = false; //If Monthly and not MonthByMonthDay, on every 26th of the month
public int SelectYears = 0; //If Yearly, in every x year.
public DateTime OriginalDate; //Holds the first Due date for later calculation. Never changes.
public enum RepeatType
Daily = 1,
There are four levels of Priority. 4 represents the normal priority, and 1 is the highest priority.
The color coding for the Priorities used on Todo.ly:
- 1 = “#FF3300”
- 2 = “#168BB8”
- 3 = “#51992D”
- 4 = “#000000”
This property should hold the last time this item has been received from the server. It’s should only be used when client sends data to the server and wants to sync the data with the server. If you specify the date, server will merge the changes you are sending. If it’s empty server will just applies the changes you are sending, but that could cause issues if this item has been updated on the server and you are overwriting the changes. Always specify this value and server will sync your changes.
This property is in UTC format.
The time this item has been created.
The time this item has been checked. There might be multiple times a user can check an item (in case of recurrence) so this property hold the last time it happened.
This defines the date when this item has been updated last time.