Skip to content
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

V8 API is deprecated and will be phased out soon, should change to v9 endpoints. #24

Open
LiamKarlMitchell opened this issue Jan 12, 2023 · 11 comments

Comments

@LiamKarlMitchell
Copy link

The V8 API is deprecated and will be phased out soon, more info about this here https://toggl.com/blog/toggl-track-api-v9
It should be updated to V9 endpoints.

We’re phasing out v8 within the next six months.
Last Updated: 12 April 202202 September 2022

So it's probably going to break everything soon just letting you know.

@rzfzr
Copy link
Collaborator

rzfzr commented Jan 12, 2023

Nice catch, I'll will be taking a look at it over the weekend

@LiamKarlMitchell
Copy link
Author

This came from an email with them about the duronly field when calling /api/v8/time_entries.
It is deprecated and always true, alternatively can just check if the end date is null.

"You can indeed check for the end date being null instead of relying on the deprecated duronly field."

@rzfzr
Copy link
Collaborator

rzfzr commented Jan 23, 2023

Ok, so following the docs v8 endpoints will be disabled on April 1st.

I've replaced the endpoints here, @LiamKarlMitchell can you give it a go? I don't have a running project that uses this module at the moment....

The docs mention some other work may be needed besides changing the endpoints, so I'm afraid it is not fully functional.

@rzfzr
Copy link
Collaborator

rzfzr commented Apr 18, 2024

Ok, so just coming back to this, the endpoint migration is not as straightforward as I thought, but they do have a guide, I'm implementing it here for now.

Todo list before the next release:

  • Replace all v8 endpoints
  • Test all endpoints (I will need a volunteer for the paid features)
  • Document all breaking changes
  • Ideally implement all the new endpoints
  • Update all original documentation links for each call

I also found something that didn't make sense to me on their migration guide (although I don't use projects):
GET /projects/{project_id}/project_users Becomes => /workspaces/{workspace_id}/project_users
getting the users on the new API should prob be workspace AND project specific, since "projects" are not deprecated.

@rzfzr
Copy link
Collaborator

rzfzr commented Apr 25, 2024

I have decided to organize the modules in the same abstraction as the API reference

  • Me
  • Preferences
  • Authentication
  • Time entries
  • Organizations
  • Invitations
  • Groups
  • Workspaces
  • Clients
  • Projects
  • Tasks
  • Tags
  • Approvals

@rzfzr rzfzr mentioned this issue Apr 26, 2024
@appinteractive
Copy link

@rzfzr thanks for this library, is it possilbe that you publish the beta version with v9 on npm?

@rzfzr
Copy link
Collaborator

rzfzr commented May 23, 2024

It is published already :)
Just install it with package@beta

@appinteractive
Copy link

It is published already :) Just install it with package@beta

I was searching it in the releases tab on GitHub and did not find it 🙈

@rzfzr
Copy link
Collaborator

rzfzr commented May 23, 2024

My bad, i did not update the release tabs as I published it only for testing on my own app.
I'll look into automating the release process

@appinteractive
Copy link

appinteractive commented May 23, 2024

checkSummaryGrouping is not defined is thrown when I want to get a summaryReport

client.summaryReport(
      { workspace_id, start_date, end_date },
      (err, report) => {
        if (err) {
          reject(err);
        } else {
          resolve(report);
        }
      }
    );

@rzfzr
Copy link
Collaborator

rzfzr commented May 23, 2024

The checklist above is updated, clients hasn't migrated completely yet, will check it out soon.

Edit. I just saw that 1. reports are served from a different endpoint and 2. toggl now provides a swagger config, so I don't think I'll be implementing this soon, rather I will look into generating the rest of the client.
@appinteractive In the meantime, if you feel like implementing just what you need from this, I can merge and publish that for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants