Document timeline API calls
+1
Has anyone found a way to access timeline via the API at all?
Yep, I dug into the JS on the Toggl website and found it's actually not too difficult:
curl -X GET -H "Authorization: Basic (MY_API_TOKEN)" -H "Cache-Control: no-cache" https://timeline.toggl.com/api/v8/timeline?start_date=1428451200&end_date=1428537599
Unlike most other API calls, the start_date/end_date in both the request and the response are actually Unix timestamps.
Obviously this API Call will only return timeline data for the owner of the API Key, because timeline data is private (even to Workspace administrators).
Sample JSON Response:
[{"start_time":1428452339,"end_time":1428452357,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"Inbox (3) - [email protected] - Google Mail - Google Chrome","idle":false},
{"start_time":1428452376,"end_time":1428452387,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"putty.exe","title":"Remote Server","idle":false},
{"start_time":1428452423,"end_time":1428452435,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"full.inc.php - Sublime Text 2","idle":false},
{"start_time":1428452435,"end_time":1428452535,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"products.inc.php - Sublime Text 2","idle":false},
{"start_time":1428452570,"end_time":1428452580,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"TogglDesktop.exe","title":"EditForm","idle":false},
{"start_time":1428452585,"end_time":1428453127,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"products.inc.php - Sublime Text 2","idle":false},
{"start_time":1428453151,"end_time":1428453165,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"products.inc.php - Sublime Text 2","idle":false},
{"start_time":1428453165,"end_time":1428453217,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"products.inc.php • - Sublime Text 2","idle":false},
{"start_time":1428453488,"end_time":1428453498,"desktop_id":"e6111d21-0123-218b-96c2-054c9223ea21","filename":"","title":"Computer","idle":false}]
Hope this helps!
thanks @chrisatomix :D :+1:
How about delete an entry? would that be possible?
+1 to this. It seems like a really big gap not to be able to delete timeline entries.
Greetings...,
Was wondering if any further clarification could be provided... i am including the following syntax in Postman,
curl -X GET -H "Authorization: Basic (MY_API_TOKEN)" -H "Cache-Control: no-cache" https://timeline.toggl.com/api/v8/timeline?start_date=1428451200&end_date=1428537599; but am getting an error, i am including my api token, and am admittedly a newbie...
curl --location --request GET 'https://api.track.toggl.com/api/v8/time_line?start_date= 1614142800&end_date=1614229199'
--header 'Authorization: Basic
Thanks in Advance.
Timeline API appears to no longer be functioning. (HTTP ERROR 418 "I am a teapot").
Are there plans to reactivate this?
Hello @kristerhaav!
Thank you for submitting your issue. Unfortunately this repository is largely unmaintained, which means issues remain unseen and do not get dealt with in a respectable manner. We're sorry for not getting back to you sooner.
This issue has been around for a long time so we will close it for now, but please let our excellent 24/5 support staff know you if you have any unresolved issues with our platform, documentation or APIs. They're also really good at noting down feature requests for our development teams. Please find them on our support page by clicking the little icon in the bottom right corner of the screen.
Kind regards, Joeri from Toggl