Created
December 12, 2016 22:39
-
-
Save chip/929be696d8742a6fa3d91d09b98fb532 to your computer and use it in GitHub Desktop.
Toggl Bot sample for Slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TOGGL is a web-based time-tracking service: http://toggl.com | |
import { togglApi, togglParser } from '../dist/togglApi' | |
const apiToken = process.env.TOGGL_API_TOKEN | |
// Request account profile from the Toggl API | |
togglApi({apiToken}).fetchData('/me') | |
.then(function(data) { | |
// Return your default workspace id so that we can then make calls for clients, projects, time entries, etc. | |
console.log(togglParser({ data }).workspaceId()) | |
}) | |
// TODO: API endpoints for Slack bot | |
// | |
// 1. Prompt user to enter their Toggl API key. /setup | |
// 2. Retrieve client listing. /clients | |
// 3. Generate invoice for client. /invoice | |
// | |
// Need to accept other input from user such as date range |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment