1

I am trying to access the Google Tasks API from my Raspberry Pi to synchronize Tasks.

Now comes a bit of a rant:

Because it should run on my headless Raspberry Pi, I cannot use a webbrowser there. In the Tasks API Docs it says I can use an API key. But I tried and it didn't work. I then learned, for the Tasks API, no API keys are allowed. Also stated here. Contradictory information in the docs, but even Google is not perfect. Okay.

Then I tried to use OAuth2 for devices with limited input. I couldn't run a web browser, but getting the device code from logs seemed okay. I could not find info why it shouldn't work so I tried it. But it also didn't work, as there are only a few scopes allowed. I guess I did not look well enough but come on. The docs are super confusing when it comes to authentication and what is allowed. Why would it let me add an OAuth limited-input Client in the Google Console, if it isn't even allowed?

So my question is: How do I authenticate a Google Tasks API App, that cannot open a webbrowser and go through the standard OAuth flow? Is it just not possible? Did I just do something wrong and Google is indeed perfect?

  • How it could work, but is pretty tedious: I could use normal OAuth, generate a token, transfer the token to the Raspberry Pi, which can refresh it if needed. But if I do not access the API for 7 days (app has external user type and status "testing"), the token would be expired and I have to do all that jazz again.. – Tibor Völcker Jun 24 '21 at 10:39
  • You could use a refresh token as well. However, where specifically did you get this info "I then learned, for the Tasks API, no API keys are allowed."? You mentioned that you'd already this - what part specifically did not work as expected? – ale13 Jun 25 '21 at 11:15
  • @ale13 When sending any requests, I get a `401: Request is missing required authentication credential. ...` This is because I use private user data (the tasks are considered that). I was able to restrict the api key to only use the Tasks API, which also didn't make sense to me. Can you get it to work with an API key? – Tibor Völcker Jun 26 '21 at 13:01
  • I'm currently experiencing the same problem.I have a simple headless application that needs to access Google Tasks API. It looks like it is not possible ATM. – Wer Bn Sep 16 '21 at 08:04

0 Answers0