This is a library for handling Toggl API with Google Apps Script
The following APIs are currently supported:
- Time entries
- start a time entry
- stop a time entry
- get running time entry
- Users
- get current user data and time entries
- Workspaces
- get user workspaces
- Open the script editor.
- Select a library from the resource menu.
- Enter
MOTMJ6sZlZFwTl19-YkEtnR2gcmNGzY4e
in the input field of "Add a library". - Click the "Add" button.
- Select the latest version.
- Click the "Save" button.
First, get toggl object with API token.
const toggl = Toggl.getToggl('toggl api token');
Calling the startTimeEntry function with a TimeEntry object as an argument starts measurement.
Time Entry properties required for this function:
- description
- Details of measurement target.
- created_with
- the name of your client app
const timeEntries = {
description: 'time entry sample',
created_with: 'your client app'
};
toggl.startTimeEntry(timeEntries);
Stop running time tracking
toggl.stopTimeEntry();
const runningTimeEntry = toggl.getRunningTimeEntry();
// Only current user data
const user = toggl.getCurrentUser();
// Current user data and related data
const user = toggl.getCurrentUserWithRelatedData();
const workspaces = toggl.getAllWorkspaces();
MIT