3

I am trying to fetch the Gmail Inbox RSS feed using curl:

curl -H "Authorization: Bearer <my token>" https://mail.google.com/mail/feed/atom

The above command fails to fetch the feed and I get the following in my terminal.

<HTML>
<HEAD>
<TITLE>Unauthorized</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unauthorized</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

I have read-only access available to my token. Is it insufficient? I've also tried accessing the feed using simple GET https://mail.google.com/mail/feed/atom command and then providing my credentials through the terminal. That fails as well. Though I am able to load it properly in my web browser. What am I missing here? Also, I'd like to state that I don't have a GSuite account.

1 Answers1

0

Instead of a token, you can try to use Basic Auth as this answer:

wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O- "https://user:password1@mail.google.com/mail/feed/atom"
kenorb
  • 26,615