toggl / toggl_api_docs

Documentation for the Toggl API
1.4k stars 235 forks source link

404 on https://www.toggl.com/api/v8/sessions #319

Closed alexkuc closed 6 years ago

alexkuc commented 6 years ago

Opening page https://www.toggl.com/api/v8/sessions results in 404 error. The same occurs when I use curl.

curl -d -v -u <my_api>:api_token -X POST https://www.toggl.com/api/v8/sessions

Outcome: 404 page not found

Is API broken? Or am I doing something wrong?

AuHau commented 6 years ago

Just tried and works for me:

curl -u XXX:api_token \
        -H "Content-Type: application/json" \
        -d '' \
        -X POST https://www.toggl.com/api/v8/sessions
alexkuc commented 6 years ago

@AuHau You are right, it works! May I suggest to modify API docs? It appears the current example in api docs is not working but the example provided above does work.

Authentication with a session cookie

curl --data="" -v -u 1971800d4d82861d8f2c1651fea4d212:api_token -X POST https://www.toggl.com/api/v8/sessions

AuHau commented 6 years ago

Glad to help! :-) From what I have seen I don't think they will accept the PR with the chagnes. Toggl is working on v9 of API and I think they do not want to spend time on the old documentation...

I would suggest closing the issue, though ;-)

alexkuc commented 6 years ago

@AuHau Any chance to see what v9 is like? Or it's internal/private at the moment?

AuHau commented 6 years ago

Well I would also like to see that as I am working on rewrite of one API wrapper and it would be cool to target already the new version, but there is still no updated documentation and I have talked with Toggl a bit and it seems it is still under development, so they will release stable documentation only when they pronounce the API as a stable, which still might take a while...

That said there are already some ways to peek under the hood. First of all, there is very general info here: https://github.com/toggl/toggl_api_docs/blob/master/api_v9_reports_v3_basics.md But more importantly their web client (toggl.com/app) is already mostly using the v9, so just open Developer Tools and see the calls ;-)

alexkuc commented 6 years ago

Well, fair enough. Hopefully, when it's released (v9) to the general public, we won't have too much to re-write (writing an AppleScript wrapper here).