{"id":20560314,"url":"https://github.com/andreaskoch/togglapi","last_synced_at":"2025-04-14T14:06:01.341Z","repository":{"id":57502001,"uuid":"68528130","full_name":"andreaskoch/togglapi","owner":"andreaskoch","description":"A go wrapper for the Toggl API","archived":false,"fork":false,"pushed_at":"2016-10-03T12:32:44.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T14:17:49.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreaskoch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-18T14:56:49.000Z","updated_at":"2024-06-21T14:17:49.341Z","dependencies_parsed_at":"2022-09-13T08:01:12.015Z","dependency_job_id":null,"html_url":"https://github.com/andreaskoch/togglapi","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Ftogglapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Ftogglapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Ftogglapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Ftogglapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreaskoch","download_url":"https://codeload.github.com/andreaskoch/togglapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224873086,"owners_count":17384078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T03:54:12.582Z","updated_at":"2024-11-16T03:54:13.192Z","avatar_url":"https://github.com/andreaskoch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toggl API for go\n\nA go wrapper for the Toggl API\n\n`github.com/andreaskoch/togglapi` is a simple wrapper for the Toggl API (https://github.com/toggl/toggl_api_docs).\n\n[![Build Status](https://travis-ci.org/andreaskoch/togglapi.svg?branch=master)](https://travis-ci.org/andreaskoch/togglapi)\n\n## Installation\n\nDownload `github.com/andreaskoch/togglapi`:\n\n```bash\ngo get github.com/andreaskoch/togglapi\n```\n\n## Supported API methods\n\n`github.com/andreaskoch/togglapi` currently only supports the following methods of the Toggl API:\n\n- Clients\n\t- `CreateClient(client Client) (Client, error)`\n\t- `GetClients() ([]Client, error)`\n- Workspaces\n\t- `GetWorkspaces() ([]Workspace, error)`\n- Projects\n\t- `CreateProject(project Project) (Project, error)`\n\t- `GetProjects(workspaceID int) ([]Project, error)`\n- Time Entries\n\t- `CreateTimeEntry(timeEntry TimeEntry) (TimeEntry, error)`\n\t- `GetTimeEntries(start, end time.Time) ([]TimeEntry, error)`\n\nI might add the missing methods in the future, but if you need them now please add them and send me a pull-request.\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t\"github.com/andreaskoch/togglapi\"\n)\n\nfunc main() {\n\tapiToken := \"Your-API-Token\"\n\tbaseURL := \"https://www.toggl.com/api/v8\"\n\tapi := togglapi.NewAPI(baseURL, apiToken)\n\n  // workspaces\n\tworkspaces, workspacesError := api.GetWorkspaces()\n\t...\n\n  // clients\n\tclients, clientsError := api.GetClients()\n  ...\n\n  // projects by workspace\n  for _, workspace := range workspaces {\n\t\tprojects, projectsError := api.GetProjects(workspace.ID)\n\t\t...\n\t}\n\n\t// time entries\n\tstop := time.Now()\n\tstart := stop.AddDate(0, -1, 0)\n\ttimeEntries, timeEntriesError := api.GetTimeEntries(start, stop)\n  ...\n}\n```\n\nYou can also have a look at the **example command line utility**: [example/main.go](example/main.go)\n\n```bash\ncd $GOPATH/src/github.com/andreaskoch/togglapi/example\ngo run main.go Your-Toggl-API-Token\n```\n\n## Development\n\nRun the unit tests:\n\n```bash\ncd $GOPATH/src/github.com/andreaskoch/togglapi\nmake test\n```\n\nCreate code coverage reports:\n\n```bash\ncd $GOPATH/src/github.com/andreaskoch/togglapi\nmake coverage\n```\n\n## Licensing\n\nTogglCSV is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Ftogglapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaskoch%2Ftogglapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Ftogglapi/lists"}