-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get my user ID? #8
Comments
Temp work-around:
|
@darkpixel I'm kind of late here, sorry. Is it still actual? |
It may be, but I switched jobs and no longer have to provide reports based on Toggl data. ;) |
I can confirm that using the However, using the getUserData(options, callback) method will give you your user id in the JSON response object under the const config = require('./config')
const TogglClient = require('toggl-api')
const toggl = new TogglClient({apiToken: config.togglToken})
toggl.getUserData({}, (err, userData) => {
if (err) console.log(err)
console.log(userData.id)
}) EDIT: It appears PR #11 should fix the |
If I use curl to authenticate using an API token to the Toggl API, it returns a blob of JSON that includes my user ID.
If I authenticate using node-toggl-api and a username and password and call the
authenticate()
method, I get a blob of data back with my user ID.But if I call
authenticate()
when using an API Token, I get an errorError: No need to authenticate thus you use apiToken
and I don't see a way to get my user ID. Am I missing something?The text was updated successfully, but these errors were encountered: