cbrooker / MMM-Todoist

This is an extension for the MagicMirror2 platform. It will display your Todoist todos on your MagicMirror.
MIT License
151 stars 56 forks source link

Todist API V7 is no longer supported #50

Closed simphide closed 5 years ago

simphide commented 5 years ago

Hello,

I just noticed that the module suddenly stopped working. After some research I found out that the used API V7 is no longer supported.

Can you maybe update the module so it supports the newest API?

Thank you!

tkotz8105 commented 5 years ago

I noticed it too this morning. I did some checking ... Besides the url change, it looks like the new API replaced at least the 'due_date_utc' item in v7 with 'due'. The 'due' field has multiple elements attached to it. The new 'due' field uses the 'YYYY-MM-DDTHH:MM format now. so the string reformatting that was needed before should no longer be necessary. Also, the new API no longer has the 'all_day' item. There may have been several other changes such as how it handles priority now that I have yet discovered but I have a local working copy that displays the Todoist task and the due date using the API.

simphide commented 5 years ago

Can you maybe share the local copy? That would be awesome!

Thanks in advance!

tkotz8105 commented 5 years ago

It is on my github fork at https://github.com/tkotz8105/MMM-Todoist

Only file that needed changing was MMM-Todoist.js

simphide commented 5 years ago

I don't know why, but your fork isn't for me. The List remains empty...

tkotz8105 commented 5 years ago

Can you see if there are any messages in your browser's console?

simphide commented 5 years ago

I fixed it by using your fork, but changing the API Base to https://api.todoist.com/sync

Changing the sorting Todist code to:

sortByTodoist: function (itemstoSort) { itemstoSort.sort(function (a, b) { var itemA = a.child_order, itemB = b.child_order; return itemA - itemB; }); return itemstoSort;

and changing "leagacy_project_id" to "project_id"

tkotz8105 commented 5 years ago

Great news.... interesting on the api_base url. I didn't know what using the new project_id would do so I used the legacy_project_id. It is also interesting on the need to change the sort as I hadn't touched it. Glad it's working for you.