Golang client library for the V8 Todoist Sync API. This repository is in development.
Influenced by Google's Github API Golang Client: https://github.com/google/go-github
go get -u github.com/ides15/todoist
All that is required to set up a client is your Todoist API token, which can be found at https://todoist.com/prefs/integrations
client, err := todoist.NewClient("<YOUR_TODOIST_API_TOKEN>")
if err != nil {
panic(err)
}
Through todoist.Client
, you can work with any Todoist resource (projects, notes, items, etc).
(See the tests for the most up-to-date examples)
package main
import (
"context"
"fmt"
"github.com/ides15/todoist"
)
func main() {
client, err := todoist.NewClient("<YOUR_TODOIST_API_TOKEN>")
if err != nil {
panic(err)
}
projects, _, err := client.Projects.List(context.Background(), "")
if err != nil {
panic(err)
}
for _, p := range projects {
fmt.Println(p.ID, p.Name)
}
}