Skip to content

namahu/togglForGoogleAppsScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TogglForGoogleAppsScript

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

How to add a library

  1. Open the script editor.
  2. Select a library from the resource menu.
  3. Enter MOTMJ6sZlZFwTl19-YkEtnR2gcmNGzY4e in the input field of "Add a library".
  4. Click the "Add" button.
  5. Select the latest version.
  6. Click the "Save" button.

Usage

First, get toggl object with API token.

const toggl = Toggl.getToggl('toggl api token');

Time entries

Start time entry

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 time entry

Stop running time tracking

toggl.stopTimeEntry();

Get running time entry

const runningTimeEntry = toggl.getRunningTimeEntry();

Users

Get current user data and time entries

// Only current user data
const user = toggl.getCurrentUser();
// Current user data and related data
const user = toggl.getCurrentUserWithRelatedData();

Workspaces

Get user workspaces

const workspaces = toggl.getAllWorkspaces();

AUTHER

namahu

LICENSE

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published