MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Todoist accesstoken

    Scheduled Pinned Locked Moved Troubleshooting
    9 Posts 5 Posters 4.8k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      sizer
      last edited by

      Did you figure it out??

      N 1 Reply Last reply Reply Quote 0
      • N Offline
        ninjabreadman @sizer
        last edited by

        @sizer Go here:

        1. Create an app (e.g. “My Private MagicMirror”) in the developer’s console. If you don’t have a website, use example.com.
        2. Then with your client ID and secret, construct an OAuth query (with whatever scope your app will need) and visit in a browser.
        3. It will then redirect you to your app’s website with a code parameter. (If using example.com, it will fail to reach the site; just look at the address bar and find the code parameter.)
        4. Use thecode parameter to exchange for an access token (e.g. using curl):
        $ curl "https://todoist.com/oauth/access_token" \
            -d "client_id=0123456789abcdef" \
            -d "client_secret=secret" \
            -d "code=abcdef" \
            -d "redirect_uri=https://example.com"
        

        Problem with config or JavaScript? Copy/paste it into JSHint.
        Check out the detailed walkthroughs on install, config, modules, etc.

        zdenekZ 1 Reply Last reply Reply Quote 1
        • zdenekZ Offline
          zdenek @ninjabreadman
          last edited by

          @ninjabreadman great, but I’m lost. 1. is clear, but what to do now, where to construct OAuth (whetever is it)…?..

          thanks, Zdeněk

          N 1 Reply Last reply Reply Quote 0
          • N Offline
            ninjabreadman @zdenek
            last edited by

            @zdenek Go here. Follow the instructions to create an OAuth string, that will look something like this:
            https://todoist.com/oauth/authorize?client_id=0123456789abcdef&scope=data:read,data:delete&state=secretstring

            Problem with config or JavaScript? Copy/paste it into JSHint.
            Check out the detailed walkthroughs on install, config, modules, etc.

            zdenekZ 1 Reply Last reply Reply Quote 0
            • zdenekZ Offline
              zdenek @ninjabreadman
              last edited by zdenek

              @ninjabreadman thx. My steps:

              1. went to https://todoist.com/oauth/authorize?client_id=0123456789abcdef&scope=data:read,data:delete&state=secretstring
                where I used my client_id and a “state” used "client_secret
              2. got
                https://example.com/?state=client_secert&code=string_of_characters
              3. on MM from commandlind I run
              curl "https://todoist.com/oauth/access_token" \
                  -d "client_id=my_client_id" \
                  -d "client_secret=my_client_secret" \
                  -d "code=string_from_previous_step" \
                  -d "redirect_uri=https://example.com"
              
              1. got answer
                “access_token”:“another_string”,“token_type”:“Bearer”

              so, I guess, that “another_string” is the right think for the module = access_token, right?

              		{
              			module: 'MMM-Todoist',
              			position: 'top_center',	// This can be any of the regions. Best results in left or right regions.
              			//header: 'Todoist', // This is optional
              			config: { // See 'Configuration options' for more information.
               		         	accessToken: 'axxxxxxxxxxb',
              				maximumEntries: 60,
              				updateInterval: 10*60*1000, // Update every 10 minutes
              				//projects: [ 166564794 ],
              				fade: false
               				 }
              		},
              
              

              should be OK, but nothing :-(. Checked in browser:

              div id="module_10_MMM-Todoist" class="module MMM-Todoist MMM-Todoist">div class="module-content">table class="normal small light">/table>/div>/div>
              

              (removed < signs)

              in Console no Warnings, no Erros…

              any idea?

              1 Reply Last reply Reply Quote 0
              • zdenekZ Offline
                zdenek
                last edited by

                i’m soooooooooo stupid sorry. I thougt, without define any ProjectID I’ll get ToDo of all Projects in my account. Nope. After add of at least one ID, it works…

                sorry for annoying …
                Zdeněk

                N 1 Reply Last reply Reply Quote 0
                • N Offline
                  ninjabreadman @zdenek
                  last edited by

                  @zdenek No problem, it happens to all of us. Glad to hear it’s working!

                  Problem with config or JavaScript? Copy/paste it into JSHint.
                  Check out the detailed walkthroughs on install, config, modules, etc.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AgP42 Project Sponsor Module Developer
                    last edited by

                    Hello all,

                    I also get so many trouble to make it work, but thanks to your help it is now ok ! :grinning_face:

                    So no need to create that incredibly complicated “OAuth string”, the use of the “Test token” works perfectly fine :

                    0_1531575735336_todoist.png

                    But… It is mandatory to define “projects” value in the config.js file.
                    As the default value is [] I also consider it as optional…:flushed_face:

                    With this value defined, everything is OK !

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    • First post
                      Last post
                    Enjoying MagicMirror? Please consider a donation!
                    MagicMirror created by Michael Teeuw.
                    Forum managed by Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy
                      OSZAR »