toggl_api_docs icon indicating copy to clipboard operation
toggl_api_docs copied to clipboard

Document timeline API calls

Open kristerhaav opened this issue 12 years ago • 9 comments

kristerhaav avatar Jun 19 '14 08:06 kristerhaav

+1

mwillner avatar Mar 18 '15 17:03 mwillner

Has anyone found a way to access timeline via the API at all?

duarte avatar Apr 07 '15 12:04 duarte

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!

chrisatomix avatar Apr 08 '15 07:04 chrisatomix

thanks @chrisatomix :D :+1:

aminnaggar avatar Feb 08 '16 16:02 aminnaggar

How about delete an entry? would that be possible?

anboia avatar May 14 '19 02:05 anboia

+1 to this. It seems like a really big gap not to be able to delete timeline entries.

somaholiday avatar Mar 22 '20 22:03 somaholiday

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.

jreckers avatar Mar 01 '21 15:03 jreckers

Timeline API appears to no longer be functioning. (HTTP ERROR 418 "I am a teapot").

Are there plans to reactivate this?

edbock avatar Dec 08 '21 11:12 edbock

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

joeriharleman avatar Jun 27 '22 08:06 joeriharleman